Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v2-master' into merge-v2-master
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-cox committed Aug 20, 2019
2 parents 4cad165 + 2e46084 commit cb71535
Show file tree
Hide file tree
Showing 26 changed files with 335 additions and 324 deletions.
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
# Change Log

## 2.5.0

[Full Changelog](https://github.com/cloudfoundry-incubator/stratos/compare/2.4.0...2.5.0)

This release contains a number of fixes and improvements:

**Fixes:**

- Fix connect to IBM Cloud [\#3715](https://github.com/cloudfoundry-incubator/stratos/pull/3715)
- Create route - owned domains not proposed [\#3685](https://github.com/cloudfoundry-incubator/stratos/issues/3685)
- Fixed connect endpoint issues in Firefox [\#3679](https://github.com/cloudfoundry-incubator/stratos/pull/3679)
- Fixed connect endpoint rendering issue in Firefox [\#3678](https://github.com/cloudfoundry-incubator/stratos/pull/3678)
- Fix ExpressionChangedAfterItHasBeenCheckedError exception on home page [\#3667](https://github.com/cloudfoundry-incubator/stratos/pull/3667)
- Fix bosh prometheus metrics [\#3602](https://github.com/cloudfoundry-incubator/stratos/pull/3602)
- Fix stepper height on Chrome pre v72 & Bleeding of error style in stateful-icon [\#3599](https://github.com/cloudfoundry-incubator/stratos/pull/3599)
- Remove sidenav header underline [\#3556](https://github.com/cloudfoundry-incubator/stratos/issues/3556)
- cf/spaces routes: fixed breadcrumbs path for apps [\#3572](https://github.com/cloudfoundry-incubator/stratos/pull/3572)
- No space/org shown in cell app instances page [\#3536](https://github.com/cloudfoundry-incubator/stratos/issues/3536)
- Services Marketplace: cf endpoint on card when multiple cf connected [\#3560](https://github.com/cloudfoundry-incubator/stratos/pull/3560)
- Setup screens are missing header [\#3557](https://github.com/cloudfoundry-incubator/stratos/issues/3557)
- /uaa page is still available in a configured system [\#3056](https://github.com/cloudfoundry-incubator/stratos/issues/3056)
- Endpoint login exposes user credentials via query string [\#3160](https://github.com/cloudfoundry-incubator/stratos/issues/3160)
- Don't send registration info in query string [\#3777](https://github.com/cloudfoundry-incubator/stratos/pull/3777)

**Improvements:**

- Add Application Autoscaler UI [\#3455](https://github.com/cloudfoundry-incubator/stratos/pull/3455)
- Quotas: org/space quotas: listing and management [\#3650](https://github.com/cloudfoundry-incubator/stratos/pull/3650)
- Quotas: allow quota to be specified on creation/edit of org/space [\#3593](https://github.com/cloudfoundry-incubator/stratos/pull/3593)
- Refactor setup config [\#3694](https://github.com/cloudfoundry-incubator/stratos/pull/3694)
- Helm Chart: Add imagelist to the helm chart [\#3638](https://github.com/cloudfoundry-incubator/stratos/pull/3638)
- Support separate auth and token endpoints [\#3635](https://github.com/cloudfoundry-incubator/stratos/pull/3635)
- Improve failed connection message for cf & metrics endpoints [\#3600](https://github.com/cloudfoundry-incubator/stratos/pull/3600)
- Handle endpoint types that do no support connect [\#3596](https://github.com/cloudfoundry-incubator/stratos/pull/3596)
- Make disconnected endpoints more obviously different [\#3554](https://github.com/cloudfoundry-incubator/stratos/issues/3554)
- Always build with go modules [\#3589](https://github.com/cloudfoundry-incubator/stratos/pull/3589)
- Don't show cell metrics when they're not available [\#3586](https://github.com/cloudfoundry-incubator/stratos/pull/3586)
- Handle 'no auth' auth type in optional connect step [\#3535](https://github.com/cloudfoundry-incubator/stratos/issues/3535)
- Notifications page: Add a back button [\#3523](https://github.com/cloudfoundry-incubator/stratos/issues/3523)

## 2.4.0

[Full Changelog](https://github.com/cloudfoundry-incubator/stratos/compare/2.3.0...2.4.0)
Expand Down
53 changes: 53 additions & 0 deletions build/tools/changelog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env node

console.log('Collecting Change Log');

let since = '>=2019-05-03';

const request = require('request-promise-native');
const repo = 'cloudfoundry-incubator/stratos';
const fs = require('fs');

let url = 'https://api.github.com/search/issues?q=state:closed+repo:' + repo + '+updated:' + since;
url = url + '&per_page=100';

const fileName = './log.md';

console.log(url);

let total = -1;
let fetched = 0;
let results = [];

function fetchPage(url, page) {
const pageUrl = url + '&page=' + page;
return request(pageUrl, {
headers: {
'User-Agent': 'Changelog'
},
json: true}).then(data => {
console.log('Fetched page : ' + page);

if (page === 1) {
total = data.total_count;
console.log('Total results : ' + total);
}
fetched += data.items.length;
results = results.concat(data.items);

if (fetched < total) {
return fetchPage(url, page + 1);
}
console.log('Got all data');
});
}

fetchPage(url, 1).then(data => {
fs.writeFileSync(fileName, '# Changes\n');
for(let i = 0; i<results.length;i++) {
const item = results[i];
let line = '- ' + item.title + ' [\\#' + item.number + '](' + item.html_url + ')\n';
fs.appendFileSync(fileName, line);
};

});
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
FROM {{BASE_IMAGE}}
{{#IS_SLE}}
RUN zypper addrepo -G -t yum -c 'http://nginx.org/packages/sles/12' nginx
RUN zypper addrepo -t rpm-md -G -c '{{SMT_INTERNAL_SERVER}}' smt_internal_server
{{/IS_SLE}}
RUN zypper -n ref && \
zypper -n up && \
zypper in -y nginx
zypper in -y nginx apache2-utils

{{#IS_SLE}}
RUN zypper rr smt_internal_server
{{/IS_SLE}}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stratos",
"version": "2.4.0",
"version": "2.5.0",
"description": "Stratos Console",
"main": "index.js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { RequestMethod, RequestOptions, URLSearchParams } from '@angular/http';

import { IQuotaDefinition } from '../../../core/src/core/cf-api.types';
import {
QuotaFormValues,
} from '../../../core/src/features/cloud-foundry/quota-definition-form/quota-definition-form.component';
import {
EntityInlineChildAction,
EntityInlineParentAction,
Expand All @@ -16,7 +19,6 @@ import {
} from '../cf-entity-factory';
import { CFStartAction } from './cf-action.types';


export const GET_QUOTA_DEFINITION = '[QuotaDefinition] Get one';
export const GET_QUOTA_DEFINITION_SUCCESS = '[QuotaDefinition] Get one success';
export const GET_QUOTA_DEFINITION_FAILED = '[QuotaDefinition] Get one failed';
Expand Down Expand Up @@ -68,6 +70,30 @@ export const DELETE_SPACE_QUOTA_DEFINITION_FAILED = '[QuotaDefinitions] Delete s
const quotaDefinitionEntitySchema = cfEntityFactory(quotaDefinitionEntityType);
const spaceQuotaEntitySchema = cfEntityFactory(spaceQuotaEntityType);

const UNLIMITED = -1;
function orgSpaceQuotaFormValuesToApiObject(formValues: QuotaFormValues, isOrg = true, orgGuid?: string): IQuotaDefinition {
const res: IQuotaDefinition = {
name: formValues.name,
total_services: formValues.totalServices || UNLIMITED,
total_routes: formValues.totalRoutes || UNLIMITED,
memory_limit: formValues.memoryLimit,
app_task_limit: formValues.appTasksLimit || UNLIMITED,
total_service_keys: formValues.totalServiceKeys || UNLIMITED,
instance_memory_limit: formValues.instanceMemoryLimit || UNLIMITED,
non_basic_services_allowed: formValues.nonBasicServicesAllowed,
total_reserved_route_ports: formValues.totalReservedRoutePorts || UNLIMITED,
app_instance_limit: formValues.appInstanceLimit || UNLIMITED,
};
if (isOrg) {
// Required for org quotas
res.total_private_domains = formValues.totalPrivateDomains || UNLIMITED;
} else if (orgGuid) {
// Required for creating space quota
res.organization_guid = orgGuid;
}
return res;
}

export class GetQuotaDefinitions extends CFStartAction implements PaginatedAction {
constructor(
public paginationKey: string,
Expand Down Expand Up @@ -209,12 +235,12 @@ export class DisassociateSpaceQuota extends CFStartAction implements ICFAction {
}

export class CreateQuotaDefinition extends CFStartAction implements ICFAction {
constructor(public endpointGuid: string, public createQuota: IQuotaDefinition) {
constructor(public endpointGuid: string, public createQuota: QuotaFormValues) {
super();
this.options = new RequestOptions();
this.options.url = `quota_definitions`;
this.options.method = RequestMethod.Post;
this.options.body = createQuota;
this.options.body = orgSpaceQuotaFormValuesToApiObject(createQuota);
this.guid = createQuota.name;
}
actions = [
Expand All @@ -232,12 +258,12 @@ export class UpdateQuotaDefinition extends CFStartAction implements ICFAction {

public static UpdateExistingQuota = 'Updating-Existing-Quota';

constructor(public guid: string, public endpointGuid: string, updateQuota: IQuotaDefinition) {
constructor(public guid: string, public endpointGuid: string, updateQuota: QuotaFormValues) {
super();
this.options = new RequestOptions();
this.options.url = `quota_definitions/${guid}`;
this.options.method = RequestMethod.Put;
this.options.body = updateQuota;
this.options.body = orgSpaceQuotaFormValuesToApiObject(updateQuota);
}
actions = [
UPDATE_QUOTA_DEFINITION,
Expand Down Expand Up @@ -272,12 +298,12 @@ export class DeleteQuotaDefinition extends CFStartAction implements ICFAction {
}

export class CreateSpaceQuotaDefinition extends CFStartAction implements ICFAction {
constructor(public endpointGuid: string, public createQuota: IQuotaDefinition) {
constructor(public endpointGuid: string, orgGuid: string, public createQuota: QuotaFormValues) {
super();
this.options = new RequestOptions();
this.options.url = `space_quota_definitions`;
this.options.method = RequestMethod.Post;
this.options.body = createQuota;
this.options.body = orgSpaceQuotaFormValuesToApiObject(createQuota, false, orgGuid);
this.guid = createQuota.name;
}
actions = [
Expand All @@ -295,12 +321,12 @@ export class UpdateSpaceQuotaDefinition extends CFStartAction implements ICFActi

public static UpdateExistingSpaceQuota = 'Updating-Existing-Space-Quota';

constructor(public guid: string, public endpointGuid: string, updateQuota: IQuotaDefinition) {
constructor(public guid: string, public endpointGuid: string, updateQuota: QuotaFormValues) {
super();
this.options = new RequestOptions();
this.options.url = `space_quota_definitions/${guid}`;
this.options.method = RequestMethod.Put;
this.options.body = updateQuota;
this.options.body = orgSpaceQuotaFormValuesToApiObject(updateQuota, false);
}
actions = [
UPDATE_SPACE_QUOTA_DEFINITION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class CloudFoundrySpaceService {
)
);
this.quotaLink$ = combineLatest(this.quotaDefinition$, this.spaceQuotaDefinition$).pipe(
map(([quota, spaceQuota]) => {
map(([quota, spaceQuota]) => {
if (!spaceQuota) {
return [
'/cloud-foundry',
Expand All @@ -170,12 +170,12 @@ export class CloudFoundrySpaceService {
this.cfGuid,
'organizations',
this.orgGuid,
'space',
'spaces',
this.spaceGuid,
'space-quota'
];
}
)
)
);
}

Expand Down
7 changes: 6 additions & 1 deletion src/frontend/packages/core/src/app.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ import { DomainMismatchComponent } from './features/setup/domain-mismatch/domain
import { ConsoleUaaWizardComponent } from './features/setup/uaa-wizard/console-uaa-wizard.component';
import { UpgradePageComponent } from './features/setup/upgrade-page/upgrade-page.component';
import { SharedModule } from './shared/shared.module';
import { NotSetupGuardService } from './core/not-setup-guard.service';

const appRoutes: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: 'uaa', component: ConsoleUaaWizardComponent },
{
path: 'uaa',
component: ConsoleUaaWizardComponent,
canActivate: [NotSetupGuardService]
},
{ path: 'upgrade', component: UpgradePageComponent },
{ path: 'domainMismatch', component: DomainMismatchComponent },
{ path: 'login', loadChildren: './features/login/login.module#LoginModule' },
Expand Down
2 changes: 2 additions & 0 deletions src/frontend/packages/core/src/core/core.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { MomentModule } from 'ngx-moment';
import { NoContentMessageComponent } from '../shared/components/no-content-message/no-content-message.component';
import { RecentEntitiesComponent } from '../shared/components/recent-entities/recent-entities.component';
import { AuthGuardService } from './auth-guard.service';
import { NotSetupGuardService } from './not-setup-guard.service';
import { ButtonBlurOnClickDirective } from './button-blur-on-click.directive';
import { BytesToHumanSize, MegaBytesToHumanSize } from './byte-formatters.pipe';
import { ClickStopPropagationDirective } from './click-stop-propagation.directive';
Expand Down Expand Up @@ -63,6 +64,7 @@ import { WindowRef } from './window-ref/window-ref.service';
],
providers: [
AuthGuardService,
NotSetupGuardService,
PageHeaderService,
EventWatcherService,
WindowRef,
Expand Down
45 changes: 45 additions & 0 deletions src/frontend/packages/core/src/core/not-setup-guard.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { Injectable } from '@angular/core';
import { CanActivate } from '@angular/router';
import { Store } from '@ngrx/store';
import { Observable, of as observableOf } from 'rxjs';
import { map, catchError, tap } from 'rxjs/operators';

import { RouterNav } from '../../../store/src/actions/router.actions';
import { AppState } from '../../../store/src/app-state';
import { HttpClient } from '@angular/common/http';
import { environment } from '../environments/environment';

const { proxyAPIVersion } = environment;

@Injectable()
export class NotSetupGuardService implements CanActivate {

constructor(
private http: HttpClient,
private store: Store<AppState>
) { }

canActivate(): Observable<boolean> {

const url = `/pp/${proxyAPIVersion}/auth/session/verify`;
return this.http.get(url).pipe(
map(v => {
// If the requests succeeds, then the user has a session, so everything must be setup already
return false;
}),
catchError(err => {
const needsSetup = err.status === 503 && err.headers.has('stratos-setup-required');
return observableOf(needsSetup);
}),
tap(result => {
// False means already setup, so should not be able to access /uaa endpoint
if (!result) {
this.store.dispatch(new RouterNav({
path: ['/not-found']
}));
}
})
);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,7 @@ export class CreateQuotaStepComponent {

submit: StepOnNextFunction = () => {
const formValues = this.form.formGroup.value;
const UNLIMITED = -1;

this.store.dispatch(new CreateQuotaDefinition(this.cfGuid, {
name: formValues.name,
total_services: formValues.totalServices || UNLIMITED,
total_routes: formValues.totalRoutes || UNLIMITED,
memory_limit: formValues.memoryLimit,
instance_memory_limit: formValues.instanceMemoryLimit,
app_task_limit: formValues.appTasksLimit,
total_private_domains: formValues.totalPrivateDomains,
total_service_keys: formValues.totalServiceKeys,
non_basic_services_allowed: formValues.nonBasicServicesAllowed,
total_reserved_route_ports: formValues.totalReservedRoutePorts,
app_instance_limit: formValues.appInstanceLimit
}));
this.store.dispatch(new CreateQuotaDefinition(this.cfGuid, formValues));

return this.store.select(
selectRequestInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,7 @@ export class CreateSpaceQuotaStepComponent {

submit: StepOnNextFunction = () => {
const formValues = this.form.formGroup.value;
const UNLIMITED = -1;

this.store.dispatch(new CreateSpaceQuotaDefinition(this.cfGuid, {
name: formValues.name,
organization_guid: this.orgGuid,
total_services: formValues.totalServices || UNLIMITED,
total_service_keys: formValues.totalServiceKeys,
total_routes: formValues.totalRoutes || UNLIMITED,
memory_limit: formValues.memoryLimit,
instance_memory_limit: formValues.instanceMemoryLimit,
non_basic_services_allowed: formValues.nonBasicServicesAllowed,
total_reserved_route_ports: formValues.totalReservedRoutePorts,
app_instance_limit: formValues.appInstanceLimit,
app_task_limit: formValues.appTasksLimit,
}));
this.store.dispatch(new CreateSpaceQuotaDefinition(this.cfGuid, this.orgGuid, formValues));

return this.store.select(selectRequestInfo(spaceQuotaEntityType, formValues.name)).pipe(
filter(requestInfo => !!requestInfo && !requestInfo.creating),
Expand Down
Loading

0 comments on commit cb71535

Please sign in to comment.