Skip to content

Commit

Permalink
Merge pull request #518 from spadgett/3.11-olm-feature-detection
Browse files Browse the repository at this point in the history
[release-3.11] change OLM feature detection to look for 'operators.coreos.com' apigroup
  • Loading branch information
openshift-merge-robot authored Sep 11, 2018
2 parents 336423f + 7e31b51 commit 4fa7d64
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions frontend/__tests__/features.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('featureReducer', () => {
});

it('returns updated state with new flags if `SET_FLAG` action', () => {
const action = {type: 'SET_FLAG', flag: FLAGS.CLOUD_SERVICES, value: true};
const action = {type: 'SET_FLAG', flag: FLAGS.OPERATOR_LIFECYCLE_MANAGER, value: true};
const initialState = Immutable.Map(DEFAULTS_);
const newState = featureReducer(initialState, action);

Expand All @@ -31,7 +31,7 @@ describe('featureReducer', () => {
expect(newState).toEqual(initialState);
});

it('set flags when it gets CRDs', () => {
it('sets flags when it gets CRDs', () => {
const action = {type: types.resources, resources: {models: [ClusterServiceVersionModel]}};
const initialState = Immutable.Map(DEFAULTS_);
const newState = featureReducer(initialState, action);
Expand All @@ -41,6 +41,7 @@ describe('featureReducer', () => {
[FLAGS.PROMETHEUS]: false,
[FLAGS.MULTI_CLUSTER]: false,
[FLAGS.CHARGEBACK]: false,
[FLAGS.OPERATOR_LIFECYCLE_MANAGER]: true,
}));
});
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/components/nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ export class Nav extends React.Component {
<ResourceNSLink resource="events" name="Events" onClick={this.close} />
</NavSection>

<NavSection required={FLAGS.CLOUD_SERVICES} text="Operators" img={operatorImg} activeImg={operatorActiveImg} >
<NavSection required={FLAGS.OPERATOR_LIFECYCLE_MANAGER} text="Operators" img={operatorImg} activeImg={operatorActiveImg} >
<ResourceNSLink model={ClusterServiceVersionModel} resource={ClusterServiceVersionModel.plural} name="Cluster Service Versions" onClick={this.close} />
<Sep />
<ResourceNSLink model={CatalogSourceModel} resource={CatalogSourceModel.plural} name="Catalog Sources" onClick={this.close} />
Expand Down
6 changes: 3 additions & 3 deletions frontend/public/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { UIActions } from './ui/ui-actions';
CLUSTER_UPDATES: false,
PROMETHEUS: false,
MULTI_CLUSTER: false,
CLOUD_SERVICES: false,
OPERATOR_LIFECYCLE_MANAGER: false,
CALICO: false,
CHARGEBACK: false,
OPENSHIFT: false,
Expand All @@ -34,7 +34,7 @@ export enum FLAGS {
CLUSTER_UPDATES = 'CLUSTER_UPDATES',
PROMETHEUS = 'PROMETHEUS',
MULTI_CLUSTER = 'MULTI_CLUSTER',
CLOUD_SERVICES = 'CLOUD_SERVICES',
OPERATOR_LIFECYCLE_MANAGER = 'OPERATOR_LIFECYCLE_MANAGER',
CALICO = 'CALICO',
CHARGEBACK = 'CHARGEBACK',
OPENSHIFT = 'OPENSHIFT',
Expand All @@ -57,6 +57,7 @@ export const CRDs = {
[referenceForModel(PrometheusModel)]: FLAGS.PROMETHEUS,
[referenceForModel(ClusterModel)]: FLAGS.MULTI_CLUSTER,
[referenceForModel(ChargebackReportModel)]: FLAGS.CHARGEBACK,
[referenceForModel(ClusterServiceVersionModel)]: FLAGS.OPERATOR_LIFECYCLE_MANAGER,
};

const SET_FLAG = 'SET_FLAG';
Expand Down Expand Up @@ -131,7 +132,6 @@ export let featureActions = [
[FLAGS.CAN_LIST_PV, { resource: 'persistentvolumes', verb: 'list' }],
[FLAGS.CAN_LIST_STORE, { group: 'storage.k8s.io', resource: 'storageclasses', verb: 'list' }],
[FLAGS.CAN_LIST_CRD, { group: 'apiextensions.k8s.io', resource: 'customresourcedefinitions', verb: 'list' }],
[FLAGS.CLOUD_SERVICES, { group: ClusterServiceVersionModel.apiGroup, resource: ClusterServiceVersionModel.plural, verb: 'list' }],
].forEach(_.spread((FLAG, resourceAttributes) => {
const req = {
spec: { resourceAttributes }
Expand Down

0 comments on commit 4fa7d64

Please sign in to comment.