Skip to content

Commit

Permalink
Merge pull request #1240 from spadgett/rebase-master-next
Browse files Browse the repository at this point in the history
Merge master into master-next
  • Loading branch information
openshift-merge-robot authored Feb 28, 2019
2 parents e20bcc1 + 032dca8 commit 927c612
Show file tree
Hide file tree
Showing 29 changed files with 202 additions and 239 deletions.
3 changes: 0 additions & 3 deletions cmd/bridge/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ func main() {
// See https://github.com/openshift/service-serving-cert-signer
fServiceCAFile := fs.String("service-ca-file", "", "CA bundle for OpenShift services signed with the service signing certificates.")

fTectonicClusterName := fs.String("tectonic-cluster-name", "tectonic", "The Tectonic cluster name.")

fUserAuth := fs.String("user-auth", "disabled", "disabled | oidc | openshift")
fUserAuthOIDCIssuerURL := fs.String("user-auth-oidc-issuer-url", "", "The OIDC/OAuth2 issuer URL.")
fUserAuthOIDCCAFile := fs.String("user-auth-oidc-ca-file", "", "PEM file for the OIDC/OAuth2 issuer.")
Expand Down Expand Up @@ -159,7 +157,6 @@ func main() {
BaseURL: baseURL,
LogoutRedirect: logoutRedirect,
TectonicCACertFile: caCertFilePath,
ClusterName: *fTectonicClusterName,
Branding: branding,
DocumentationBaseURL: documentationBaseURL,
GoogleTagManagerID: *fGoogleTagManagerID,
Expand Down
22 changes: 10 additions & 12 deletions frontend/__tests__/module/k8s/autocomplete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,20 @@ describe('getCompletions', () => {
});

it('invokes callback with appropriate completions for properties', (done) => {
const swagger = {
definitions: {
'io.k8s.api.apps.v1.Deployment': {},
'io.k8s.api.apps.v1.DeploymentSpec': {
properties: {
minReadySeconds: {
description: 'Dummy property',
type: 'integer',
format: 'int32',
},
const definitions = {
'io.k8s.api.apps.v1.Deployment': {},
'io.k8s.api.apps.v1.DeploymentSpec': {
properties: {
minReadySeconds: {
description: 'Dummy property',
type: 'integer',
format: 'int32',
},
},
},
};
sessionMock.getLines = jasmine.createSpy('getLinesSpy').and.returnValue(['kind: Deployment', 'apiVersion: apps/v1']);
spyOn(window.localStorage, 'getItem').and.returnValue(JSON.stringify(swagger));
spyOn(window.sessionStorage, 'getItem').and.returnValue(JSON.stringify(definitions));

getCompletions(editorMock, sessionMock, position, '', (error, results) => {
expect(results.length).toEqual(1);
Expand All @@ -116,7 +114,7 @@ describe('getCompletions', () => {

it('does not provide completion for properties if k8s API spec cannot be retrieved', (done) => {
sessionMock.getLines = jasmine.createSpy('getLinesSpy').and.returnValue(['kind: Deployment', 'apiVersion: apps/v1']);
spyOn(window.localStorage, 'getItem').and.returnValue(null);
spyOn(window.sessionStorage, 'getItem').and.returnValue(null);

getCompletions(editorMock, sessionMock, position, '', (error, results) => {
fail('Should not have been called');
Expand Down
11 changes: 6 additions & 5 deletions frontend/integration-tests/tests/overview/overview.scenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,18 @@ describe('Visiting Overview page', () => {
it(`displays a ${kindModel.id} in the project overview list`, async() => {
await browser.wait(until.presenceOf(overviewView.projectOverview));
await overviewView.itemsAreVisible();
await expect(overviewView.getProjectOverviewListItem(kindModel, resourceName).isPresent()).toBeTruthy();
expect(overviewView.getProjectOverviewListItem(kindModel, resourceName).isPresent()).toBeTruthy();
});

it(`shows ${kindModel.id} details sidebar when item is clicked`, async() => {
// Disabling for now due to flake https://jira.coreos.com/browse/CONSOLE-1298
xit(`CONSOLE-1298 - shows ${kindModel.id} details sidebar when item is clicked`, async() => {
const overviewListItem = overviewView.getProjectOverviewListItem(kindModel, resourceName);
await expect(overviewView.detailsSidebar.isPresent()).toBeFalsy();
expect(overviewView.detailsSidebar.isPresent()).toBeFalsy();
await browser.wait(until.elementToBeClickable(overviewListItem));
await overviewListItem.click();
await overviewView.sidebarIsLoaded();
await expect(overviewView.detailsSidebar.isDisplayed()).toBeTruthy();
await expect(overviewView.detailsSidebarTitle.getText()).toContain(resourceName);
expect(overviewView.detailsSidebar.isDisplayed()).toBeTruthy();
expect(overviewView.detailsSidebarTitle.getText()).toContain(resourceName);
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/integration-tests/tests/performance.scenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('Performance test', () => {
};

it(`downloads new bundle for ${routeName}`, async() => {
await browser.get(`${appHost}/status/all-namespaces`);
await browser.get(`${appHost}/k8s/cluster/projects`);
await browser.executeScript(() => performance.setResourceTimingBufferSize(1000));
await browser.wait(until.presenceOf(crudView.resourceTitle));
// Avoid problems where the Catalog nav section appears where Workloads was at the moment the tests try to click.
Expand Down
3 changes: 2 additions & 1 deletion frontend/integration-tests/tests/source-to-image.scenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ describe('Source-to-Image', () => {
});
});

describe('Node.js app', () => {
// Disabling for now due to flake https://jira.coreos.com/browse/CONSOLE-1293
xdescribe('CONSOLE-1293 - Node.js app', () => {
const appName = 'test-nodejs';
const resources = {
'buildconfigs': {kind: 'BuildConfig'},
Expand Down
2 changes: 2 additions & 0 deletions frontend/public/branding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const getProductName = () => {
return 'OpenShift Container Platform';
case 'online':
return 'OpenShift Online';
case 'dedicated':
return 'OpenShift Dedicated';
default:
return 'OKD';
}
Expand Down
5 changes: 0 additions & 5 deletions frontend/public/components/_cluster-overview.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
}
}

.group__title--no-side-borders {
border-left: none;
border-right: none;
}

.group__body {
border: 1px solid $color-grey-background-border;
border-top: none;
Expand Down
38 changes: 4 additions & 34 deletions frontend/public/components/_quota.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.co-resource-quota-chart-row {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin-bottom: 20px;
justify-content: space-evenly;
}

.co-resource-quota-chart-row--compact {
margin-bottom: 2px;
.co-resource-quota-dashboard-scopes {
font-size: $font-size-h5;
font-weight: 300;
}

.co-resource-quota-empty {
Expand All @@ -26,36 +26,6 @@
font-weight: 300;
}

.co-resource-quota-scope__description--compact {
display: inline;
padding-left: 6px;
}

.co-resource-quota-scope__label {
font-weight: 500;
}

.co-resource-quota-scope__label--compact {
display: inline;
font-size: $font-size-small;
}


.quota-dashboard-column {
display: flex;
flex-direction: column;
}

.quota-dashboard-row {
display: flex;
}

.quota-dashboard-scopes {
padding-left: 24px;
padding-right: 24px;
}

.quota-dashboard-scopes--compact {
line-height: ($line-height-base - .2);
margin-bottom: 2px;
}
38 changes: 10 additions & 28 deletions frontend/public/components/_resource.scss
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
$height: 18px;

.co-m-resource-icon {
background-color: $color-container-dark;
border-radius: 10px;
border-radius: 20px;
color: #fff;
display: inline-block;
font-size: $font-size-base - 1;
font-weight: normal;
height: $height;
line-height: $height;
font-weight: 300;
line-height: 16px;
margin-right: 4px;
min-width: $height;
padding: 0 4px;
min-width: 18px;
padding: 2px 4px 1px;
text-align: center;

&--lg {
border-radius: 12px;
font-size: 16px;
height: 24px;
line-height: 24px;
margin-left: 0;
font-size: ($font-size-base + 1);
line-height: 21px;
margin-right: 7px;
min-width: 24px;
padding: 0 7px;
position: relative;
top: 2px;
padding-left: 7px;
padding-right: 7px;
}
}

Expand Down Expand Up @@ -106,18 +100,6 @@ $height: 18px;
background-color: $color-ingress-dark;
}

.co-m-resource-icon--all {
background-color: black;
}

.co-m-resource-icon--align-left {
margin-left: 0;
}

.co-m-resource-icon--flex-child {
margin-right: 7px;
}

.co-resource-link {
align-items: baseline;
display: flex;
Expand Down
6 changes: 3 additions & 3 deletions frontend/public/components/_sysevent-stream.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ $color-dark-border: #ddd;
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
.co-m-resource-icon {
margin-left: 0;
}
}

.co-sysevent--transition {
Expand Down Expand Up @@ -102,6 +99,9 @@ $color-dark-border: #ddd;
display: flex;
justify-content: space-between;
white-space: pre;
> *:not(:first-child) {
margin-left: 8px;
}
}

.co-sysevent__source {
Expand Down
1 change: 0 additions & 1 deletion frontend/public/components/about-modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class AboutModal_ extends React.Component {
super(props);
this.state = {
kubernetesVersion: null,
clusterName: null,
};
}

Expand Down
15 changes: 12 additions & 3 deletions frontend/public/components/edit-yaml.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { SafetyFirst } from './safety-first';
import { coFetchJSON } from '../co-fetch';
import { ResourceSidebar } from './sidebars/resource-sidebar';
import { yamlTemplates } from '../models/yaml-templates';
import { SWAGGER_SESSION_STORAGE_KEY } from '../const';

const { snippetManager } = ace.acequire('ace/snippets');
snippetManager.register([...snippets.values()], 'yaml');
Expand Down Expand Up @@ -72,9 +73,17 @@ export const EditYAML = connect(stateToProps)(
}

// Retrieve k8s API spec for autocompletion
if (!window.sessionStorage.getItem(`${window.SERVER_FLAGS.consoleVersion}--swagger.json`)) {
coFetchJSON('api/kubernetes/swagger.json')
.then(swagger => window.sessionStorage.setItem(`${window.SERVER_FLAGS.consoleVersion}--swagger.json`, JSON.stringify(swagger)));
if (!window.sessionStorage.getItem(SWAGGER_SESSION_STORAGE_KEY)) {
coFetchJSON('api/kubernetes/swagger.json').then(swagger => {
// Only store definitions to reduce the document size.
const json = JSON.stringify(swagger.definitions || {});
try {
window.sessionStorage.setItem(SWAGGER_SESSION_STORAGE_KEY, json);
} catch (e) {
// eslint-disable-next-line no-console
console.error('Could not store swagger.json', e);
}
});
}
}

Expand Down
6 changes: 0 additions & 6 deletions frontend/public/components/graphs/_graphs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
overflow: hidden;
}

.graph-wrapper--compact {
margin-top: 2px;
margin-bottom: 0px;
padding-top: 10px;
}

.graph-title {
margin: 0;
text-align: center;
Expand Down
11 changes: 9 additions & 2 deletions frontend/public/components/graphs/gauge.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,15 @@ class Gauge_ extends BaseGraph {
} else {
data = Math.round(data);
}
this.layout.annotations[0].text = `${data}%`;
this.layout.annotations[0].font.color = fontColor;

if (this.props.centerText){
this.layout.annotations[0].text = this.props.centerText;
this.layout.annotations[0].font.size = 16;
} else {
this.layout.annotations[0].text = `${data}%`;
this.layout.annotations[0].font.color = fontColor;
}

relayout(this.node, this.layout);
}
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/components/ingress.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const getTLSCert = (ingress) => {
const certs = _.map(ingress.spec.tls, 'secretName');

return <div>
<ResourceIcon kind="Secret" className="co-m-resource-icon--align-left" />
<ResourceIcon kind="Secret" />
<span>{certs.join(', ')}</span>
</div>;
};
Expand Down
11 changes: 5 additions & 6 deletions frontend/public/components/kube-admin-notifier.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as React from 'react';
// import { Link } from 'react-router-dom';
import { Link } from 'react-router-dom';
import { connect } from 'react-redux';
import * as _ from 'lodash-es';

// import { OAuthModel } from '../models';
import { OAuthModel } from '../models';
import { userStateToProps } from '../ui/ui-reducers';
import { KUBE_ADMIN_USERNAME } from '../const';
// import { resourcePathFromModel } from './utils/resource-link';
import { resourcePathFromModel } from './utils/resource-link';

// const oAuthResourcePath = resourcePathFromModel(OAuthModel, 'cluster');
const oAuthResourcePath = resourcePathFromModel(OAuthModel, 'cluster');

export const KubeAdminNotifier = connect(userStateToProps)(({user}) => {
const username = _.get(user, 'metadata.name');
Expand All @@ -17,8 +17,7 @@ export const KubeAdminNotifier = connect(userStateToProps)(({user}) => {
<div className="co-global-notification__content">
<p className="co-global-notification__text">
You are logged in as a temporary administrative user.
{/* Temporarily disable the link since it's not yet possible to add identity providers. */}
{/* Update the <Link to={oAuthResourcePath}>cluster OAuth configuration</Link> to allow others to log in. */}
Update the <Link to={oAuthResourcePath}>cluster OAuth configuration</Link> to allow others to log in.
</p>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions frontend/public/components/modals/_modals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
height: calc(100% - 20px); // subtract height margin-top 10px + margin-bottom 10px
outline: 0;

@media(min-width: $screen-sm-min) {
height: calc(100% - 60px); // subtract height margin-top 30px + margin-bottom 30px
@media(min-width: $screen-sm-min), (max-width: $screen-xs-max) and (orientation: landscape) {
height: calc(100% - 60px); // At desktop, subtract margin-top 30px + margin-bottom 30px OR in the case of mobile landscape orientation, subtract the height of ios url control bar, since its height is not taken into account when the viewport height is calculated on initial page load. This causes the modal to extend below the viewport and hide modal-footer buttons.
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class ConfigureNamespacePullSecret extends PromiseComponent {
<label>Namespace</label>
</div>
<div className="col-xs-9">
<ResourceIcon kind="Namespace" className="co-m-resource-icon--align-left" /> &nbsp;{namespace.metadata.name}
<ResourceIcon kind="Namespace" /> &nbsp;{namespace.metadata.name}
</div>
</div>

Expand All @@ -193,7 +193,7 @@ class ConfigureNamespacePullSecret extends PromiseComponent {
</div>
{ pullSecret ?
<div className="col-xs-9">
<ResourceIcon kind="Secret" className="co-m-resource-icon--align-left" />
<ResourceIcon kind="Secret" />
&nbsp;{_.get(pullSecret, 'metadata.name')}
</div> : <div className="col-xs-9">
<input type="text" className="form-control" id="namespace-pull-secret-name" aria-describedby="namespace-pull-secret-name-help" required />
Expand Down
Loading

0 comments on commit 927c612

Please sign in to comment.