Skip to content

Commit

Permalink
Remove Tectonic branding
Browse files Browse the repository at this point in the history
  • Loading branch information
spadgett committed Jul 17, 2018
1 parent 4425f89 commit c0eba3e
Show file tree
Hide file tree
Showing 20 changed files with 55 additions and 379 deletions.
2 changes: 1 addition & 1 deletion cmd/bridge/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func main() {
fOpenshiftConsoleURL := fs.String("openshift-console-url", "", "URL for OpenShift console used in context switcher")

fDexAPIHost := fs.String("dex-api-host", "", "Target host and port of the Dex API service.")
fBranding := fs.String("branding", "origin", "Console branding for the masthead logo and title. One of origin, ocp, online, or tectonic. Defaults to origin.")
fBranding := fs.String("branding", "origin", "Console branding for the masthead logo and title. One of origin, ocp, or online. Defaults to origin.")
fDocumentationBaseURL := fs.String("documentation-base-url", "", "The base URL for documentation links.")
fGoogleTagManagerID := fs.String("google-tag-manager-id", "", "Google Tag Manager ID. External analytics are disabled if this is not set.")

Expand Down
1 change: 0 additions & 1 deletion contrib/environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ export BRIDGE_K8S_AUTH="bearer-token"
secretname=$(kubectl get serviceaccount default --namespace=kube-system -o jsonpath='{.secrets[0].name}')
BRIDGE_K8S_AUTH_BEARER_TOKEN=$(kubectl get secret "$secretname" --namespace=kube-system -o template --template='{{.data.token}}' | base64 --decode)
export BRIDGE_K8S_AUTH_BEARER_TOKEN
export BRIDGE_BRANDING="tectonic"

echo "Using $BRIDGE_K8S_MODE_OFF_CLUSTER_ENDPOINT"
1 change: 0 additions & 1 deletion contrib/oc-environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ export BRIDGE_K8S_AUTH="bearer-token"

BRIDGE_K8S_AUTH_BEARER_TOKEN=$(oc whoami --show-token)
export BRIDGE_K8S_AUTH_BEARER_TOKEN
export BRIDGE_BRANDING="origin"

echo "Using $BRIDGE_K8S_MODE_OFF_CLUSTER_ENDPOINT"
3 changes: 1 addition & 2 deletions examples/run-bridge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@
--user-auth=openshift \
--user-auth-oidc-client-id=console-oauth-client \
--user-auth-oidc-client-secret-file=examples/console-client-secret \
--user-auth-oidc-ca-file=examples/ca.crt \
--branding=origin
--user-auth-oidc-ca-file=examples/ca.crt
10 changes: 2 additions & 8 deletions frontend/public/components/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,25 +137,19 @@ class App extends React.PureComponent {

getProductName () {
switch (window.SERVER_FLAGS.branding) {
case 'origin':
return 'OpenShift Origin';
case 'ocp':
return 'OpenShift Container Platform';
case 'online':
return 'OpenShift Online';
case 'tectonic':
return 'Tectonic';
default:
return null;
return 'OpenShift Origin';
}
}

render () {
const productName = this.getProductName();
return <React.Fragment>
{productName
? <Helmet titleTemplate={`%s · ${productName}`} defaultTitle={productName} />
: <Helmet defaultTitle="Console" />}
<Helmet titleTemplate={`%s · ${productName}`} defaultTitle={productName} />
<Masthead />
<Nav />
<div id="content">
Expand Down
41 changes: 17 additions & 24 deletions frontend/public/components/cluster-overview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Helmet } from 'react-helmet';
import { Link } from 'react-router-dom';

import { coFetch, coFetchJSON } from '../co-fetch';
import { NavTitle, AsyncComponent, Firehose, StatusBox, tectonicHelpBase, OpenShiftDocumentationLinks, TectonicDocumentationLinks, OpenShiftAdditionalSupportLinks, TectonicAdditionalSupportLinks } from './utils';
import { NavTitle, AsyncComponent, Firehose, StatusBox, DocumentationLinks, AdditionalSupportLinks } from './utils';
import { k8sBasePath } from '../module/k8s';
import { SecurityScanningOverview } from './secscan/security-scan-overview';
import { StartGuide } from './start-guide';
Expand All @@ -32,10 +32,8 @@ const fetchConsoleHealth = () => coFetchJSON('health')


const DashboardLink = ({to, id}) => <Link id={id} className="co-external-link" target="_blank" to={to}>View Grafana Dashboard</Link>;
const getConsoleTitle = isOpenShift => isOpenShift ? 'OpenShift Console' : 'Tectonic Console';

const Graphs = requirePrometheus(({isOpenShift, namespace}) => {
const consoleTitle = getConsoleTitle(isOpenShift);
// TODO: Revert this change in OpenShift 4.0. In OpenShift 3.11, the scheduler and controller manager is a single component.
const controllerManagerJob = isOpenShift ? 'kube-controllers' : 'kube-controller-manager';
const schedulerJob = isOpenShift ? 'kube-controllers' : 'kube-scheduler';
Expand All @@ -51,7 +49,7 @@ const Graphs = requirePrometheus(({isOpenShift, namespace}) => {
<Status title="Kubernetes API" fetch={fetchHealth} />
</div>
<div className="col-md-3 col-sm-6">
<Status title={consoleTitle} fetch={fetchConsoleHealth} />
<Status title="OpenShift Console" fetch={fetchConsoleHealth} />
</div>
<div className="col-md-3 col-sm-6">
<Status
Expand Down Expand Up @@ -129,7 +127,6 @@ const LimitedGraphs = ({openshiftFlag}) => {
if (flagPending(openshiftFlag)) {
return null;
}
const consoleTitle = getConsoleTitle(openshiftFlag);
return <div className="group">
<div className="group__title">
<h2 className="h3">Health</h2>
Expand All @@ -140,7 +137,7 @@ const LimitedGraphs = ({openshiftFlag}) => {
<Status title="Kubernetes API" fetch={fetchHealth} />
</div>
<div className="col-lg-6 col-md-6">
<Status title={consoleTitle} fetch={fetchConsoleHealth} />
<Status title="OpenShift Console" fetch={fetchConsoleHealth} />
</div>
</div>
</div>
Expand All @@ -166,31 +163,27 @@ const GraphsPage = ({fake, limited, namespace, openshiftFlag}) => {
<div className="group">
<div className="group__title">
<h2 className="h3">Software Info</h2>
{!flagPending(openshiftFlag) && !openshiftFlag && <a href="https://coreos.com/tectonic/releases/" target="_blank" className="co-external-link" rel="noopener noreferrer">Release Notes</a>}
</div>
<div className="container-fluid group__body">
<SoftwareDetails />
</div>
</div>
{!flagPending(openshiftFlag) && <React.Fragment>
<div className="group">
<div className="group__title">
<h2 className="h3">Documentation</h2>
{!openshiftFlag && <a href={tectonicHelpBase} target="_blank" className="co-external-link" rel="noopener noreferrer">Full Documentation</a>}
</div>
<div className="container-fluid group__body group__documentation">
{openshiftFlag ? <OpenShiftDocumentationLinks /> : <TectonicDocumentationLinks />}
</div>
<div className="group">
<div className="group__title">
<h2 className="h3">Documentation</h2>
</div>
<div className="group">
<div className="group__title">
<h2 className="h3">Additional Support</h2>
</div>
<div className="container-fluid group__body group__additional-support">
{openshiftFlag ? <OpenShiftAdditionalSupportLinks /> : <TectonicAdditionalSupportLinks />}
</div>
<div className="container-fluid group__body group__documentation">
<DocumentationLinks />
</div>
</React.Fragment>}
</div>
<div className="group">
<div className="group__title">
<h2 className="h3">Additional Support</h2>
</div>
<div className="container-fluid group__body group__additional-support">
<AdditionalSupportLinks />
</div>
</div>
</div>
</div>;

Expand Down
5 changes: 0 additions & 5 deletions frontend/public/components/masthead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Link } from 'react-router-dom';
import * as originLogoImg from '../imgs/openshift-origin-logo.svg';
import * as ocpLogoImg from '../imgs/openshift-platform-logo.svg';
import * as onlineLogoImg from '../imgs/openshift-online-logo.svg';
import * as tectonicLogoImg from '../imgs/tectonic-logo.svg';
import { FLAGS, connectToFlags, flagPending } from '../features';
import { authSvc } from '../module/auth';
import { Dropdown, ActionsMenu } from './utils';
Expand Down Expand Up @@ -112,10 +111,6 @@ export const LogoImage = () => {
logoImg = onlineLogoImg;
logoAlt = 'OpenShift Online';
break;
case 'tectonic':
logoImg = tectonicLogoImg;
logoAlt = 'Tectonic';
break;
default:
logoImg = originLogoImg;
logoAlt = 'OpenShift Origin';
Expand Down
91 changes: 13 additions & 78 deletions frontend/public/components/software-details.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import * as _ from 'lodash-es';
import * as React from 'react';
import * as classNames from 'classnames';

import { k8sGet } from '../module/k8s';
import { ConfigMapModel, AppVersionModel } from '../models';
import { k8sVersion } from '../module/status';
import { coFetchJSON } from '../co-fetch';
import { SafetyFirst } from './safety-first';
import { LoadingInline, cloudProviderNames } from './utils';
import { LoadingInline } from './utils';
import { FLAGS, connectToFlags, flagPending } from '../features';
import { clusterAppVersionName } from './channel-operators/tectonic-channel';


const StatusIconRow = ({state, text}) => {
Expand Down Expand Up @@ -68,39 +64,30 @@ export const SoftwareDetails = connectToFlags(FLAGS.OPENSHIFT)(
super(props);
this.state = {
openshiftVersion: null,
tectonicVersion: null,
currentTectonicVersion: null,
kubernetesVersion: null,
cloudProviders: null,
openshiftVersionObj: null,
tectonicVersionObj: null,
};
}

componentDidMount() {
super.componentDidMount();
this._checkKubernetesVersion();
this._checkOpenShiftOrTectonicVersion();
this._checkOpenShiftVersion();
}

componentDidUpdate(prevProps) {
if (prevProps.flags[FLAGS.OPENSHIFT] !== this.props.flags[FLAGS.OPENSHIFT]) {
this._checkOpenShiftOrTectonicVersion();
this._checkOpenShiftVersion();
}
}

_checkOpenShiftOrTectonicVersion() {
_checkOpenShiftVersion() {
const openshiftFlag = this.props.flags[FLAGS.OPENSHIFT];
if (flagPending(openshiftFlag)) {
return;
}

if (openshiftFlag) {
this._checkOpenshiftVersion();
} else {
this._checkTectonicVersion();
this._checkAppVersions();
this._checkCloudProvider();
coFetchJSON('api/kubernetes/version/openshift')
.then((data) => {
this.setState({openshiftVersion: data.gitVersion, openshiftVersionObj: data});
}).catch(() => this.setState({openshiftVersion: 'unknown'}));
}
}

Expand All @@ -110,76 +97,24 @@ export const SoftwareDetails = connectToFlags(FLAGS.OPENSHIFT)(
.catch(() => this.setState({kubernetesVersion: 'unknown'}));
}

_checkTectonicVersion() {
coFetchJSON('api/tectonic/version')
.then((data) => {
this.setState({
tectonicVersion: data.version,
tectonicVersionObj: data
});
})
.catch(() => this.setState({tectonicVersion: 'unknown'}));
}

_checkAppVersions() {
k8sGet(AppVersionModel).then((appversions) => {
const tectonicTPR = _.find(appversions.items, (a) => a.metadata.name === clusterAppVersionName);
if (tectonicTPR) {
this.setState({currentTectonicVersion: tectonicTPR.status.currentVersion});
}
}).catch(() => this.setState({currentTectonicVersion: 'unknown'}));
}

_checkOpenshiftVersion() {
coFetchJSON('api/kubernetes/version/openshift')
.then((data) => {
this.setState({openshiftVersion: data.gitVersion, openshiftVersionObj: data});
}).catch(() => this.setState({openshiftVersion: 'unknown'}));
}

_checkCloudProvider() {
k8sGet(ConfigMapModel, 'tectonic-config', 'tectonic-system').then((configMap) => {
this.setState({cloudProviders: [_.get(configMap, 'data.installerPlatform', null)]});
}, () => this.setState({cloudProviders: ['UNKNOWN']}));
}

render() {
const {openshiftVersion, currentTectonicVersion, tectonicVersion, kubernetesVersion, cloudProviders} = this.state;
const {openshiftVersion, kubernetesVersion} = this.state;
const openshiftFlag = this.props.flags[FLAGS.OPENSHIFT];

if (flagPending(openshiftFlag)) {
return null;
}

return <div>
<SoftwareDetailRow
title="Kubernetes"
detail={kubernetesVersion}
text="Kubernetes version could not be determined."
/>
{openshiftFlag ? (
<SoftwareDetailRow
title="OpenShift"
detail={openshiftVersion}
text="OpenShift version could not be determined."
/>
) : (
<React.Fragment>
<SoftwareDetailRow
title="Tectonic"
detail={currentTectonicVersion || tectonicVersion}
text="Tectonic version could not be determined."
/>
{cloudProviders &&
<SoftwareDetailRow
title="Cloud Provider"
detail={cloudProviderNames(cloudProviders)}
text="Cloud Provider could not be determined."
/>
}
</React.Fragment>
)}
</div>;
return <React.Fragment>
<SoftwareDetailRow title="Kubernetes" detail={kubernetesVersion} text="Kubernetes version could not be determined." />
{openshiftFlag && <SoftwareDetailRow title="OpenShift" detail={openshiftVersion} text="OpenShift version could not be determined." />}
</React.Fragment>;
}

});
54 changes: 8 additions & 46 deletions frontend/public/components/start-guide.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ const seenGuide = 'seenGuide';
class StartGuide_ extends SafetyFirst {
constructor (props) {
super(props);

// TODO: The dismissable logic is not currently being used, but we'll
// probably want a general start guide for OpenShift separate from the no
// projects message. Leaving this for now.
this.dismiss = this.dismiss.bind(this);
let {dismissible, visible} = props;
try {
Expand All @@ -31,56 +35,14 @@ class StartGuide_ extends SafetyFirst {
}

render () {
const { style, flags } = this.props;
const { OPENSHIFT: openshiftFlag, PROJECTS_AVAILABLE: projectsFlag } = flags;
const { visible, dismissible } = this.state;
const { OPENSHIFT: openshiftFlag, PROJECTS_AVAILABLE: projectsFlag } = this.props.flags;
const { visible } = this.state;

if (!visible || flagPending(openshiftFlag) || flagPending(projectsFlag)) {
if (!visible || !openshiftFlag || projectsFlag || flagPending(projectsFlag)) {
return null;
}

if (openshiftFlag && !projectsFlag) {
return <OpenShiftGettingStarted />;
}

/* eslint-disable react/jsx-no-target-blank */
if (!openshiftFlag) {
return <div className="co-well" id="tectonic-start-guide" style={style}>
{dismissible && <button className="btn btn-link pull-right" onClick={this.dismiss}>Dismiss</button>}
<h1 style={{ marginTop: 0 }}>Tectonic Quick Start Guide</h1>

<h2>1. Set up kubectl</h2>
<p style={{marginBottom: 20}}>
&apos;kubectl&apos; is a command-line program for interacting with the Kubernetes API.
<br />
<a href="https://coreos.com/tectonic/docs/latest/tutorials/kubernetes/configure-kubectl.html" target="_blank" rel="noopener">
<button className="btn btn-info" style={{marginTop: 10}}>
Configure kubectl&nbsp;&nbsp;<i className="fa fa-external-link" />
</button>
</a>
</p>

<h2>2. Deploy an Application</h2>
<p>
You can choose to deploy your application with &apos;kubectl&apos; or with Tectonic Console.
<br />
<a href="https://coreos.com/tectonic/docs/latest/tutorials/sandbox/first-app.html#deploying-a-simple-application" target="_blank" rel="noopener">
<button className="btn btn-info" style={{marginTop: 10}}>
Deploy Application&nbsp;&nbsp;<i className="fa fa-external-link" />
</button>
</a>
</p>
<hr />
<h2>You may also be interested in</h2>
<ul>
<li>Grant and manage user access with Tectonic Identity. See <a href="https://coreos.com/tectonic/docs/latest/users/tectonic-identity-config.html" target="_blank" className="co-external-link" rel="noopener">User Management through Tectonic Identity</a></li>
<li>Troubleshoot your Tectonic clusters. See <a href="https://coreos.com/tectonic/docs/latest/troubleshooting/troubleshooting.html" className="co-external-link" target="_blank" rel="noopener">Troubleshooting Tectonic</a></li>
</ul>
</div>;
}
/* eslint-enable react/jsx-no-target-blank */

return null;
return <OpenShiftGettingStarted />;
}
}
export const StartGuide = connectToFlags(FLAGS.OPENSHIFT, FLAGS.PROJECTS_AVAILABLE)(StartGuide_);
Expand Down
Loading

0 comments on commit c0eba3e

Please sign in to comment.