From 1ce8cccfe34d0c483aa4443b5e6f131c1c4b78a7 Mon Sep 17 00:00:00 2001 From: Maude Date: Tue, 24 Aug 2021 10:18:47 -0400 Subject: [PATCH] delete orphaned code delete references to cluster service broker in yaml-template delete alert-manager and associated code delete chargeback.tsx and associated code delete cluster-service-class.tsx, instantiate-template.tsx, and associated code delete prometheus.jsx and associated code delete service-instance.tsx and associated code Bring back instantiate-template.tsx Revert "delete files for Service Brokers" This reverts commit 9f40bd78cb0fdaac10e8d6aadc188818c6633d23. bring back instantiate-template delete files for Service Brokers delete Service Brokers in yaml-templates Revert "delete Service Brokers in yaml-templates" This reverts commit 36bcbb7b31b6947aa4a5f84ce62cebb0286c89e9. remove broker management file delete references to cluster service broker model in resource pages and lazy routes for provisioned services find last remaining links and references to cluster service brokers, provisioned services, and broker mgt delete unused models delete custom styling and lazyroutes for alert manager delete alert manager tests and such delete more code relater to cluster service classes delete custom service instance styles update translations --- frontend/__mocks__/catalogItemsMocks.ts | 1093 ----------------- .../__tests__/module/k8s/k8s-models.spec.ts | 10 +- frontend/__tests__/reducers/features.spec.tsx | 2 - frontend/integration-tests/protractor.conf.ts | 11 - .../tests/alertmanager.scenario.ts | 519 -------- .../tests/monitoring.scenario.ts | 234 ---- .../integration-tests/views/catalog.view.ts | 7 +- .../console-shared/src/constants/common.ts | 2 - .../tests/crud/other-routes.spec.ts | 11 - .../operator-lifecycle-manager/mocks.ts | 76 -- frontend/public/actions/features.ts | 9 - .../components/_cluster-service-instance.scss | 20 - frontend/public/components/_resource.scss | 4 - frontend/public/components/alert-manager.tsx | 164 --- frontend/public/components/app-contents.tsx | 77 +- .../public/components/broker-management.tsx | 28 - .../components/catalog/catalog-item-icon.tsx | 37 - frontend/public/components/chargeback.tsx | 682 ---------- .../components/cluster-service-broker.tsx | 200 --- .../components/cluster-service-class-info.tsx | 59 - .../components/cluster-service-class.tsx | 179 --- .../components/cluster-service-plan.tsx | 34 +- .../components/factory/table-filters.ts | 16 - frontend/public/components/nav/admin-nav.tsx | 37 - frontend/public/components/nav/section.tsx | 1 - frontend/public/components/prometheus.jsx | 114 -- .../components/provisioned-services.tsx | 28 - frontend/public/components/resource-pages.ts | 78 -- .../public/components/service-binding.tsx | 242 ---- .../public/components/service-instance.tsx | 417 ------- .../components/utils/horizontal-nav.tsx | 6 - frontend/public/components/utils/link.tsx | 1 - frontend/public/locales/en/public.json | 16 - frontend/public/models/index.ts | 118 -- frontend/public/models/yaml-templates.ts | 26 - frontend/public/reducers/features.ts | 6 - frontend/public/style.scss | 1 - frontend/public/style/_text.scss | 1 - frontend/public/style/_vars.scss | 1 - 39 files changed, 5 insertions(+), 4562 deletions(-) delete mode 100644 frontend/integration-tests/tests/alertmanager.scenario.ts delete mode 100644 frontend/integration-tests/tests/monitoring.scenario.ts delete mode 100644 frontend/public/components/_cluster-service-instance.scss delete mode 100644 frontend/public/components/alert-manager.tsx delete mode 100644 frontend/public/components/broker-management.tsx delete mode 100644 frontend/public/components/chargeback.tsx delete mode 100644 frontend/public/components/cluster-service-broker.tsx delete mode 100644 frontend/public/components/cluster-service-class-info.tsx delete mode 100644 frontend/public/components/cluster-service-class.tsx delete mode 100644 frontend/public/components/prometheus.jsx delete mode 100644 frontend/public/components/provisioned-services.tsx delete mode 100644 frontend/public/components/service-binding.tsx delete mode 100644 frontend/public/components/service-instance.tsx diff --git a/frontend/__mocks__/catalogItemsMocks.ts b/frontend/__mocks__/catalogItemsMocks.ts index b9664164267..2dfb6178301 100644 --- a/frontend/__mocks__/catalogItemsMocks.ts +++ b/frontend/__mocks__/catalogItemsMocks.ts @@ -55,240 +55,6 @@ export const catalogListPageProps = { }, ], }, - clusterServiceClasses: { - data: [ - { - metadata: { - name: 'c02503f2-c641-11e8-be32-54e1ad486c15', - uid: 'cbe5f470-c641-11e8-8889-0242ac110004', - }, - spec: { - tags: ['database', 'mongodb'], - externalMetadata: { - 'console.openshift.io/iconClass': 'icon-mongodb', - displayName: 'MongoDB', - providerDisplayName: 'Red Hat, Inc.', - }, - description: - 'MongoDB database service, with persistent storage. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mongodb-container/blob/master/3.2/README.md.\n\nNOTE: Scaling to more than one replica is not supported. You must have persistent volumes available in your cluster to use this template.', - }, - status: { - removedFromBrokerCatalog: false, - }, - }, - { - metadata: { - name: 'c02180ca-c641-11e8-be32-54e1ad486c15', - uid: 'cbe6d3b1-c641-11e8-8889-0242ac110004', - }, - spec: { - tags: ['instant-app', 'jenkins'], - externalMetadata: { - 'console.openshift.io/iconClass': 'icon-jenkins', - displayName: 'Jenkins', - providerDisplayName: 'Red Hat, Inc.', - }, - description: - 'Jenkins service, with persistent storage.\n\nNOTE: You must have persistent volumes available in your cluster to use this template.', - }, - status: { - removedFromBrokerCatalog: false, - }, - }, - { - metadata: { - name: 'c02a3a94-c641-11e8-be32-54e1ad486c15', - uid: 'cbe665be-c641-11e8-8889-0242ac110004', - }, - spec: { - tags: ['quickstart', 'php', 'cakephp'], - externalMetadata: { - 'console.openshift.io/iconClass': 'icon-php', - displayName: 'CakePHP + MySQL', - providerDisplayName: 'Red Hat, Inc.', - }, - description: - 'An example CakePHP application with a MySQL database. For more information about using this template, including OpenShift considerations, see https://github.com/openshift/cakephp-ex/blob/master/README.md.', - }, - status: { - removedFromBrokerCatalog: false, - }, - }, - { - metadata: { - name: 'c01f3bb7-c641-11e8-be32-54e1ad486c15', - uid: 'cbe7e8da-c641-11e8-8889-0242ac110004', - }, - spec: { - tags: ['quickstart', 'ruby', 'rails'], - externalMetadata: { - 'console.openshift.io/iconClass': 'icon-ruby', - displayName: 'Rails + PostgreSQL', - providerDisplayName: 'Red Hat, Inc.', - }, - description: - 'An example Rails application with a PostgreSQL database. For more information about using this template, including OpenShift considerations, see https://github.com/openshift/rails-ex/blob/master/README.md.', - }, - status: { - removedFromBrokerCatalog: false, - }, - }, - { - metadata: { - name: 'c01a67e0-c641-11e8-be32-54e1ad486c15', - uid: 'cbe46c67-c641-11e8-8889-0242ac110004', - }, - spec: { - tags: ['quickstart', 'python', 'django'], - externalMetadata: { - 'console.openshift.io/iconClass': 'icon-python', - displayName: 'Django + PostgreSQL', - providerDisplayName: 'Red Hat, Inc.', - }, - description: - 'An example Django application with a PostgreSQL database. For more information about using this template, including OpenShift considerations, see https://github.com/openshift/django-ex/blob/master/README.md.', - }, - status: { - removedFromBrokerCatalog: false, - }, - }, - { - metadata: { - name: 'c017c1f2-c641-11e8-be32-54e1ad486c15', - uid: 'cbe73a61-c641-11e8-8889-0242ac110004', - }, - spec: { - tags: ['database', 'postgresql'], - externalMetadata: { - 'console.openshift.io/iconClass': 'icon-postgresql', - displayName: 'PostgreSQL', - providerDisplayName: 'Red Hat, Inc.', - }, - description: - 'PostgreSQL database service, with persistent storage. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/postgresql-container/.\n\nNOTE: Scaling to more than one replica is not supported. You must have persistent volumes available in your cluster to use this template.', - }, - status: { - removedFromBrokerCatalog: false, - }, - }, - { - metadata: { - name: 'c0265596-c641-11e8-be32-54e1ad486c15', - uid: 'cc17770c-c641-11e8-8889-0242ac110004', - }, - spec: { - tags: ['database', 'mariadb'], - externalMetadata: { - 'console.openshift.io/iconClass': 'icon-mariadb', - displayName: 'MariaDB', - providerDisplayName: 'Red Hat, Inc.', - }, - description: - 'MariaDB database service, with persistent storage. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/blob/master/10.2/root/usr/share/container-scripts/mysql/README.md.\n\nNOTE: Scaling to more than one replica is not supported. You must have persistent volumes available in your cluster to use this template.', - }, - status: { - removedFromBrokerCatalog: false, - }, - }, - { - metadata: { - name: 'c0280380-c641-11e8-be32-54e1ad486c15', - uid: 'cbe3d07d-c641-11e8-8889-0242ac110004', - }, - spec: { - tags: ['database', 'mysql'], - externalMetadata: { - 'console.openshift.io/iconClass': 'icon-mysql-database', - displayName: 'MySQL', - providerDisplayName: 'Red Hat, Inc.', - }, - description: - 'MySQL database service, with persistent storage. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mysql-container/blob/master/5.7/root/usr/share/container-scripts/mysql/README.md.\n\nNOTE: Scaling to more than one replica is not supported. You must have persistent volumes available in your cluster to use this template.', - }, - status: { - removedFromBrokerCatalog: false, - }, - }, - { - metadata: { - name: 'c023a1d8-c641-11e8-be32-54e1ad486c15', - uid: 'cbe554a0-c641-11e8-8889-0242ac110004', - }, - spec: { - tags: ['instant-app', 'jenkins'], - externalMetadata: { - 'console.openshift.io/iconClass': 'icon-jenkins', - displayName: 'Pipeline Build Example', - }, - description: - 'This example showcases the new Jenkins Pipeline integration in OpenShift,\nwhich performs continuous integration and deployment right on the platform.\nThe template contains a Jenkinsfile - a definition of a multi-stage CI/CD process - that\nleverages the underlying OpenShift platform for dynamic and scalable\nbuilds. OpenShift integrates the status of your pipeline builds into the web\nconsole allowing you to see your entire application lifecycle in a single view.', - }, - status: { - removedFromBrokerCatalog: false, - }, - }, - { - metadata: { - name: 'c02bc18e-c641-11e8-be32-54e1ad486c15', - uid: 'cbf8eaeb-c641-11e8-8889-0242ac110004', - }, - spec: { - tags: ['quickstart', 'perl', 'dancer'], - externalMetadata: { - 'console.openshift.io/iconClass': 'icon-perl', - displayName: 'Dancer + MySQL', - providerDisplayName: 'Red Hat, Inc.', - }, - description: - 'An example Dancer application with a MySQL database. For more information about using this template, including OpenShift considerations, see https://github.com/openshift/dancer-ex/blob/master/README.md.', - }, - status: { - removedFromBrokerCatalog: false, - }, - }, - { - metadata: { - name: 'c01d0061-c641-11e8-be32-54e1ad486c15', - uid: 'cbe4e0fa-c641-11e8-8889-0242ac110004', - }, - spec: { - tags: ['quickstart', 'nodejs'], - externalMetadata: { - 'console.openshift.io/iconClass': 'icon-nodejs', - displayName: 'Node.js + MongoDB', - providerDisplayName: 'Red Hat, Inc.', - }, - description: - 'An example Node.js application with a MongoDB database. For more information about using this template, including OpenShift considerations, see https://github.com/openshift/nodejs-ex/blob/master/README.md.', - }, - status: { - removedFromBrokerCatalog: false, - }, - }, - { - metadata: { - name: 'c01f3bb8-c641-11e8-be32-54e1ad486c15', - uid: 'cbe7e8db-c641-11e8-8889-0242ac110004', - }, - spec: { - tags: ['quickstart', 'fa-icon'], - externalMetadata: { - 'console.openshift.io/iconClass': 'fa fa-fill-drip', - displayName: 'FA icon example', - providerDisplayName: 'Red Hat, Inc.', - }, - description: 'Example to validate icon', - }, - status: { - removedFromBrokerCatalog: false, - }, - }, - ], - filters: {}, - loadError: '', - loaded: true, - selected: null, - }, templateMetadata: [ { apiVersion: 'meta.k8s.io/v1beta1', @@ -1098,865 +864,6 @@ export const catalogListPageProps = { certsRotateAt: '2021-01-07T11:47:52Z', }, }, - { - apiVersion: 'operators.coreos.com/v1alpha1', - kind: 'ClusterServiceVersion', - metadata: { - annotations: { - 'olm.operatorGroup': 'olm-operators', - 'olm.operatorNamespace': 'openshift-operator-lifecycle-manager', - 'olm.targetNamespaces': 'openshift-operator-lifecycle-manager', - }, - resourceVersion: '121331', - name: 'svcat.v0.1.34', - uid: 'ae8afaee-1407-11e9-8620-027d9941c4da', - creationTimestamp: '2019-01-09T12:11:23Z', - generation: 1, - namespace: 'openshift-operator-lifecycle-manager', - labels: { - 'alm-catalog': 'rh-operators', - }, - }, - spec: { - customresourcedefinitions: {}, - apiservicedefinitions: { - owned: [ - { - containerPort: 5443, - deploymentName: 'apiserver', - description: 'A service catalog resource', - displayName: 'ClusterServiceClass', - group: 'servicecatalog.k8s.io', - kind: 'ClusterServiceClass', - name: 'clusterserviceclasses', - version: 'v1beta1', - }, - { - containerPort: 5443, - deploymentName: 'apiserver', - description: 'A service catalog resource', - displayName: 'ClusterServicePlan', - group: 'servicecatalog.k8s.io', - kind: 'ClusterServicePlan', - name: 'clusterserviceplans', - version: 'v1beta1', - }, - { - containerPort: 5443, - deploymentName: 'apiserver', - description: 'A service catalog resource', - displayName: 'ClusterServiceBroker', - group: 'servicecatalog.k8s.io', - kind: 'ClusterServiceBroker', - name: 'clusterservicebrokers', - version: 'v1beta1', - }, - { - containerPort: 5443, - deploymentName: 'apiserver', - description: 'A service catalog resource', - displayName: 'ServiceInstance', - group: 'servicecatalog.k8s.io', - kind: 'ServiceInstance', - name: 'serviceinstances', - version: 'v1beta1', - }, - { - ': [containerPort': 5443, - deploymentName: 'apiserver', - description: 'A service catalog resource', - displayName: 'ServiceBinding', - group: 'servicecatalog.k8s.io', - kind: 'ServiceBinding', - name: 'servicebindings', - version: 'v1beta1', - }, - { - ': [containerPort': 5443, - deploymentName: 'apiserver', - description: 'A service catalog resource', - displayName: 'ServiceClass', - group: 'servicecatalog.k8s.io', - kind: 'ServiceClass', - name: 'serviceclasses', - version: 'v1beta1', - }, - { - ': [containerPort': 5443, - deploymentName: 'apiserver', - description: 'A service catalog resource', - displayName: 'ServicePlan', - group: 'servicecatalog.k8s.io', - kind: 'ServicePlan', - name: 'serviceplans', - version: 'v1beta1', - }, - { - ': [containerPort': 5443, - deploymentName: 'apiserver', - description: 'A service catalog resource', - displayName: 'ServiceBroker', - group: 'servicecatalog.k8s.io', - kind: 'ServiceBroker', - name: 'servicebrokers', - version: 'v1beta1', - }, - ], - }, - keywords: ['catalog', 'service', 'svcat', 'osb', 'broker'], - displayName: 'Service Catalog', - provider: { - name: 'Red Hat', - }, - maturity: 'alpha', - installModes: [ - { - supported: true, - type: 'OwnNamespace', - }, - { - supported: true, - type: 'SingleNamespace', - }, - { - supported: false, - type: 'MultiNamespace', - }, - { - supported: true, - type: 'AllNamespaces', - }, - ], - version: '0.1.34', - links: [ - { - name: 'Documentation', - url: 'https://svc-cat.io/docs', - }, - { - name: 'Service Catalog', - url: 'https://github.com/kubernetes-incubator/service-catalog', - }, - ], - install: { - spec: { - clusterPermissions: [ - { - rules: [ - { - apiGroups: [''], - resources: ['events'], - verbs: ['create', 'patch', 'update'], - }, - { - apiGroups: [''], - resources: ['secrets'], - verbs: ['get', 'create', 'update', 'delete', 'list', 'watch', 'patch'], - }, - { - apiGroups: [''], - resources: ['pods'], - verbs: ['get', 'list', 'update', 'patch', 'watch', 'delete', 'initialize'], - }, - { - apiGroups: [''], - resources: ['namespaces'], - verbs: ['get', 'list', 'watch'], - }, - { - apiGroups: ['servicecatalog.k8s.io'], - resources: ['clusterserviceclasses'], - verbs: ['get', 'list', 'watch', 'create', 'patch', 'update', 'delete'], - }, - { - apiGroups: ['servicecatalog.k8s.io'], - resources: ['clusterserviceplans'], - verbs: ['get', 'list', 'watch', 'create', 'patch', 'update', 'delete'], - }, - { - apiGroups: ['servicecatalog.k8s.io'], - resources: ['clusterservicebrokers'], - verbs: ['get', 'list', 'watch'], - }, - { - apiGroups: ['servicecatalog.k8s.io'], - resources: ['serviceinstances', 'servicebindings'], - verbs: ['get', 'list', 'watch', 'update'], - }, - { - apiGroups: ['servicecatalog.k8s.io'], - resources: [ - 'clusterservicebrokers/status', - 'clusterserviceclasses/status', - 'clusterserviceplans/status', - 'serviceinstances/status', - 'serviceinstances/reference', - 'servicebindings/status', - 'servicebindings/finalizers', - ], - verbs: ['update'], - }, - { - apiGroups: ['servicecatalog.k8s.io'], - resources: ['serviceclasses'], - verbs: ['get', 'list', 'watch', 'create', 'patch', 'update', 'delete'], - }, - { - apiGroups: ['servicecatalog.k8s.io'], - resources: ['serviceplans'], - verbs: ['get', 'list', 'watch', 'create', 'patch', 'update', 'delete'], - }, - { - apiGroups: ['servicecatalog.k8s.io'], - resources: ['servicebrokers'], - verbs: ['get', 'list', 'watch'], - }, - { - apiGroups: ['servicecatalog.k8s.io'], - resources: [ - 'servicebrokers/status', - 'serviceclasses/status', - 'serviceplans/status', - ], - verbs: ['update'], - }, - ], - serviceAccountName: 'service-catalog-controller', - }, - { - rules: [ - { - apiGroups: [''], - resourceNames: ['extension-apiserver-authentication'], - resources: ['configmaps'], - verbs: ['get'], - }, - { - apiGroups: [''], - resources: ['namespaces'], - verbs: ['get', 'list', 'watch'], - }, - { - apiGroups: ['admissionregistration.k8s.io'], - resources: ['validatingwebhookconfigurations'], - verbs: ['get', 'list', 'watch'], - }, - { - apiGroups: ['admissionregistration.k8s.io'], - resources: ['mutatingwebhookconfigurations'], - verbs: ['get', 'list', 'watch'], - }, - { - apiGroups: ['authentication.k8s.io'], - resources: ['tokenreviews'], - verbs: ['create'], - }, - { - apiGroups: ['authorization.k8s.io'], - resources: ['subjectaccessreviews'], - verbs: ['create'], - }, - ], - serviceAccountName: 'service-catalog-apiserver', - }, - ], - deployments: [ - { - name: 'apiserver', - spec: { - replicas: 1, - selector: { - matchLabels: { - app: 'apiserver', - }, - }, - strategy: { - type: 'RollingUpdate', - }, - template: { - metadata: { - labels: { - app: 'apiserver', - }, - }, - spec: { - containers: [ - { - resources: { - limits: { - cpu: '100m', - memory: '140Mi', - }, - requests: { - cpu: '100m', - memory: '40Mi', - }, - }, - readinessProbe: { - failureThreshold: 1, - httpGet: { - path: '/healthz', - port: 5443, - scheme: 'HTTPS', - }, - initialDelaySeconds: 30, - periodSeconds: 5, - successThreshold: 1, - timeoutSeconds: 5, - }, - name: 'apiserver', - command: ['/usr/bin/service-catalog'], - livenessProbe: { - failureThreshold: 3, - httpGet: { - path: '/healthz', - port: 5443, - scheme: 'HTTPS', - }, - initialDelaySeconds: 30, - periodSeconds: 10, - successThreshold: 1, - timeoutSeconds: 5, - }, - ports: [ - { - containerPort: 5443, - }, - ], - imagePullPolicy: 'IfNotPresent', - volumeMounts: [ - { - mountPath: '/var/run/kubernetes-service-catalog', - name: 'apiservice-cert', - }, - ], - image: 'quay.io/openshift/origin-service-catalog:v4.0.0', - args: [ - 'apiserver', - '--enable-admission-plugins', - 'NamespaceLifecycle,DefaultServicePlan,ServiceBindingsLifecycle,ServicePlanChangeValidator,BrokerAuthSarCheck', - '--secure-port', - '5443', - '--etcd-servers', - 'http://localhost:2379', - '-v', - '3', - '--feature-gates', - 'OriginatingIdentity=true', - '--feature-gates', - 'NamespacedServiceBroker=true', - ], - }, - { - resources: { - limits: { - cpu: '100m', - memory: '150Mi', - }, - requests: { - cpu: '100m', - memory: '50Mi', - }, - }, - readinessProbe: { - failureThreshold: 1, - httpGet: { - path: '/health', - port: 2379, - }, - initialDelaySeconds: 30, - periodSeconds: 5, - successThreshold: 1, - timeoutSeconds: 5, - }, - name: 'etcd', - command: [ - '/usr/local/bin/etcd', - '--listen-client-urls', - 'http://0.0.0.0:2379', - '--advertise-client-urls', - 'http://localhost:2379', - ], - livenessProbe: { - failureThreshold: 3, - httpGet: { - path: '/health', - port: 2379, - }, - initialDelaySeconds: 30, - periodSeconds: 10, - successThreshold: 1, - timeoutSeconds: 5, - }, - env: [ - { - name: 'ETCD_DATA_DIR', - value: '/etcd-data-dir', - }, - ], - ports: [ - { - containerPort: 2379, - }, - ], - imagePullPolicy: 'Always', - volumeMounts: [ - { - mountPath: '/etcd-data-dir', - name: 'etcd-data-dir', - }, - ], - image: 'quay.io/coreos/etcd:latest', - }, - ], - serviceAccountName: 'service-catalog-apiserver', - volumes: [ - { - emptyDir: {}, - name: 'etcd-data-dir', - }, - ], - }, - }, - }, - }, - { - name: 'controller-manager', - spec: { - replicas: 1, - selector: { - matchLabels: { - app: 'controller-manager', - }, - }, - strategy: { - type: 'RollingUpdate', - }, - template: { - metadata: { - labels: { - app: 'controller-manager', - }, - }, - spec: { - containers: [ - { - resources: { - limits: { - cpu: '100m', - memory: '150Mi', - }, - requests: { - cpu: '100m', - memory: '100Mi', - }, - }, - readinessProbe: { - failureThreshold: 1, - httpGet: { - path: '/healthz', - port: 8444, - scheme: 'HTTPS', - }, - initialDelaySeconds: 20, - periodSeconds: 10, - successThreshold: 1, - timeoutSeconds: 2, - }, - name: 'controller-manager', - command: ['/usr/bin/service-catalog'], - livenessProbe: { - failureThreshold: 3, - httpGet: { - path: '/healthz', - port: 8444, - scheme: 'HTTPS', - }, - initialDelaySeconds: 20, - periodSeconds: 10, - successThreshold: 1, - timeoutSeconds: 2, - }, - env: [ - { - name: 'K8S_NAMESPACE', - valueFrom: { - fieldRef: { - fieldPath: 'metadata.namespace', - }, - }, - }, - ], - ports: [ - { - containerPort: 8444, - }, - ], - imagePullPolicy: 'IfNotPresent', - volumeMounts: [ - { - mountPath: '/var/run/kubernetes-service-catalog', - name: 'apiservice-cert', - }, - ], - image: 'quay.io/openshift/origin-service-catalog:v4.0.0', - args: [ - 'controller-manager', - '--secure-port', - '8444', - '-v', - '3', - '--leader-election-namespace', - 'kube-service-catalog', - '--leader-elect-resource-lock', - 'configmaps', - '--cluster-id-configmap-namespace=kube-service-catalog', - '--broker-relist-interval', - '5m', - '--feature-gates', - 'OriginatingIdentity=true', - '--feature-gates', - 'AsyncBindingOperations=true', - '--feature-gates', - 'NamespacedServiceBroker=true', - ], - }, - ], - serviceAccountName: 'service-catalog-controller', - volumes: [ - { - name: 'apiservice-cert', - secret: { - defaultMode: 420, - items: [ - { - key: 'tls.crt', - path: 'apiserver.crt', - }, - { - key: 'tls.key', - path: 'apiserver.key', - }, - ], - secretName: 'v1beta1.servicecatalog.k8s.io-cert', - }, - }, - ], - }, - }, - }, - }, - ], - permissions: [ - { - rules: [ - { - apiGroups: [''], - resourceNames: ['cluster-info'], - resources: ['configmaps'], - verbs: ['get', 'create', 'list', 'watch', 'update'], - }, - { - apiGroups: [''], - resources: ['configmaps'], - verbs: ['create', 'list', 'watch', 'get', 'update'], - }, - { - apiGroups: [''], - resourceNames: ['service-catalog-controller-manager'], - resources: ['configmaps'], - verbs: ['get', 'update'], - }, - ], - serviceAccountName: 'service-catalog-controller', - }, - ], - }, - strategy: 'deployment', - }, - maintainers: [ - { - email: 'openshift-operators@redhat.com', - name: 'Red Hat', - }, - ], - description: - 'Service Catalog lets you provision cloud services directly from the comfort of native Kubernetes tooling. This project is in incubation to bring integration with service brokers to the Kubernetes ecosystem via the Open Service Broker API.', - }, - status: { - reason: 'RequirementsNotMet', - message: "one or more requirements couldn't be found", - lastUpdateTime: '2019-01-09T14:36:26Z', - requirementStatus: [ - { - group: 'apiregistration.k8s.io', - kind: 'APIService', - message: '', - name: 'v1beta1.servicecatalog.k8s.io', - status: 'DeploymentFound', - version: 'v1', - }, - { - dependents: [ - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "namespaced rule:{'verbs': ['get','create','list','watch','update'],'apiGroups': [''],'resources': ['configmaps'],'resourceNames': ['cluster-info']}", - status: 'Satisfied', - version: 'v1beta1', - }, - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "namespaced rule:{'verbs': ['create','list','watch','get','update'],'apiGroups': [''],'resources': ['configmaps']}", - status: 'Satisfied', - version: 'v1beta1', - }, - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "namespaced rule:{'verbs': ['get','update'],'apiGroups': [''],'resources': ['configmaps'],'resourceNames': ['service-catalog-controller-manager']}", - status: 'Satisfied', - version: 'v1beta1', - }, - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "cluster rule:{'verbs': ['create','patch','update'],'apiGroups': [''],'resources': ['events']}", - status: 'NotSatisfied', - version: 'v1beta1', - }, - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "cluster rule:{'verbs': ['get','create','update','delete','list','watch','patch'],'apiGroups': [''],'resources': ['secrets']}", - status: 'NotSatisfied', - version: 'v1beta1', - }, - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "cluster rule:{'verbs': ['get','list','update','patch','watch','delete','initialize'],'apiGroups': [''],'resources': ['pods']}", - status: 'NotSatisfied', - version: 'v1beta1', - }, - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "cluster rule:{'verbs': ['get','list','watch'],'apiGroups': [''],'resources': ['namespaces']}", - status: 'NotSatisfied', - version: 'v1beta1', - }, - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "cluster rule:{'verbs': ['get','list','watch','create','patch','update','delete'],'apiGroups': ['servicecatalog.k8s.io'],'resources': ['clusterserviceclasses']}", - status: 'NotSatisfied', - version: 'v1beta1', - }, - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "cluster rule:{'verbs': ['get','list','watch','create','patch','update','delete'],'apiGroups': ['servicecatalog.k8s.io'],'resources': ['clusterserviceplans']}", - status: 'NotSatisfied', - version: 'v1beta1', - }, - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "cluster rule:{'verbs': ['get','list','watch'],'apiGroups': ['servicecatalog.k8s.io'],'resources': ['clusterservicebrokers']}", - status: 'NotSatisfied', - version: 'v1beta1', - }, - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "cluster rule:{'verbs': ['get','list','watch','update'],'apiGroups': ['servicecatalog.k8s.io'],'resources': ['serviceinstances','servicebindings']}", - status: 'NotSatisfied', - version: 'v1beta1', - }, - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "cluster rule:{'verbs': ['update'],'apiGroups': ['servicecatalog.k8s.io'],'resources': ['clusterservicebrokers/status','clusterserviceclasses/status','clusterserviceplans/status','serviceinstances/status','serviceinstances/reference','servicebindings/status','servicebindings/finalizers']}", - status: 'NotSatisfied', - version: 'v1beta1', - }, - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "cluster rule:{'verbs': ['get','list','watch','create','patch','update','delete'],'apiGroups': ['servicecatalog.k8s.io'],'resources': ['serviceclasses']}", - status: 'NotSatisfied', - version: 'v1beta1', - }, - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "cluster rule:{'verbs': ['get','list','watch','create','patch','update','delete'],'apiGroups': ['servicecatalog.k8s.io'],'resources': ['serviceplans']}", - status: 'NotSatisfied', - version: 'v1beta1', - }, - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "cluster rule:{'verbs': ['get','list','watch'],'apiGroups': ['servicecatalog.k8s.io'],'resources': ['servicebrokers']}", - status: 'NotSatisfied', - version: 'v1beta1', - }, - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "cluster rule:{'verbs': ['update'],'apiGroups': ['servicecatalog.k8s.io'],'resources': ['servicebrokers/status','serviceclasses/status','serviceplans/status']}", - status: 'NotSatisfied', - version: 'v1beta1', - }, - ], - group: '', - kind: 'ServiceAccount', - message: 'Policy rule not satisfied for service account', - name: 'service-catalog-controller', - status: 'PresentNotSatisfied', - version: 'v1', - }, - { - dependents: [ - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "cluster rule:{'verbs': ['get'],'apiGroups': [''],'resources': ['configmaps'],'resourceNames': ['extension-apiserver-authentication']}", - status: 'NotSatisfied', - version: 'v1beta1', - }, - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "cluster rule:{'verbs': ['get','list','watch'],'apiGroups': [''],'resources': ['namespaces']}", - status: 'NotSatisfied', - version: 'v1beta1', - }, - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "cluster rule:{'verbs': ['get','list','watch'],'apiGroups': ['admissionregistration.k8s.io'],'resources': ['validatingwebhookconfigurations']}", - status: 'NotSatisfied', - version: 'v1beta1', - }, - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "cluster rule:{'verbs': ['get','list','watch'],'apiGroups': ['admissionregistration.k8s.io'],'resources': ['mutatingwebhookconfigurations']}", - status: 'NotSatisfied', - version: 'v1beta1', - }, - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "cluster rule:{'verbs': ['create'],'apiGroups': ['authentication.k8s.io'],'resources': ['tokenreviews']}", - status: 'Satisfied', - version: 'v1beta1', - }, - { - group: 'rbac.authorization.k8s.io', - kind: 'PolicyRule', - message: - "cluster rule:{'verbs': ['create'],'apiGroups': ['authorization.k8s.io'],'resources': ['subjectaccessreviews']}", - status: 'Satisfied', - version: 'v1beta1', - }, - ], - group: '', - kind: 'ServiceAccount', - message: 'Policy rule not satisfied for service account', - name: 'service-catalog-apiserver', - status: 'PresentNotSatisfied', - version: 'v1', - }, - ], - certsLastUpdated: '2019-01-09T12:11:43Z', - lastTransitionTime: '2019-01-09T14:36:12Z', - conditions: [ - { - lastTransitionTime: '2019-01-09T12:11:23Z', - lastUpdateTime: '2019-01-09T12:11:23Z', - message: 'requirements not yet checked', - phase: 'Pending', - reason: 'RequirementsUnknown', - }, - { - lastTransitionTime: '2019-01-09T12:11:28Z', - lastUpdateTime: '2019-01-09T12:11:28Z', - message: 'all requirements found, attempting install', - phase: 'InstallReady', - reason: 'AllRequirementsMet', - }, - { - lastTransitionTime: '2019-01-09T12:11:42Z', - lastUpdateTime: '2019-01-09T12:11:42Z', - message: 'waiting for install components to report healthy', - phase: 'Installing', - reason: 'InstallSucceeded', - }, - { - lastTransitionTime: '2019-01-09T12:11:42Z', - lastUpdateTime: '2019-01-09T12:11:57Z', - message: 'APIServices not installed', - phase: 'Installing', - reason: 'InstallWaiting', - }, - { - lastTransitionTime: '2019-01-09T12:12:44Z', - lastUpdateTime: '2019-01-09T12:12:44Z', - message: 'install strategy completed with no errors', - phase: 'Succeeded', - reason: 'InstallSucceeded', - }, - { - lastTransitionTime: '2019-01-09T14:35:58Z', - lastUpdateTime: '2019-01-09T14:35:58Z', - message: 'requirements no longer met', - phase: 'Failed', - reason: 'RequirementsNotMet', - }, - { - lastTransitionTime: '2019-01-09T14:36:12Z', - lastUpdateTime: '2019-01-09T14:36:12Z', - message: 'install strategy completed with no errors', - phase: 'Succeeded', - reason: 'InstallSucceeded', - }, - { - lastTransitionTime: '2019-01-09T14:36:12Z', - lastUpdateTime: '2019-01-09T14:36:12Z', - message: 'requirements not met', - phase: 'Pending', - reason: 'RequirementsNotMet', - }, - ], - phase: 'Pending', - certsRotateAt: '2021-01-07T12:11:42Z', - }, - }, ], filters: {}, loadError: '', diff --git a/frontend/__tests__/module/k8s/k8s-models.spec.ts b/frontend/__tests__/module/k8s/k8s-models.spec.ts index c248e35d974..06f60160f14 100644 --- a/frontend/__tests__/module/k8s/k8s-models.spec.ts +++ b/frontend/__tests__/module/k8s/k8s-models.spec.ts @@ -24,12 +24,7 @@ import { testForUnservedVersionsCRD, } from '../../../__mocks__/crds'; import { testNamespace, testOwnedResourceInstance } from '../../../__mocks__/k8sResourcesMocks'; -import { - PodModel, - DeploymentModel, - ClusterResourceQuotaModel, - PrometheusModel, -} from '../../../public/models'; +import { PodModel, DeploymentModel, ClusterResourceQuotaModel } from '../../../public/models'; describe('referenceFor', () => { it('returns a reference for objects without an API group', () => { @@ -93,9 +88,8 @@ describe('modelsToMap', () => { }); it('returns a map with keys based on referenceForModel for models with crd:true', () => { - expect(modelsToMap([ClusterResourceQuotaModel, PrometheusModel]).toObject()).toEqual({ + expect(modelsToMap([ClusterResourceQuotaModel]).toObject()).toEqual({ [referenceForModel(ClusterResourceQuotaModel)]: ClusterResourceQuotaModel, - [referenceForModel(PrometheusModel)]: PrometheusModel, }); }); }); diff --git a/frontend/__tests__/reducers/features.spec.tsx b/frontend/__tests__/reducers/features.spec.tsx index 81faaedeef7..f22480b7648 100644 --- a/frontend/__tests__/reducers/features.spec.tsx +++ b/frontend/__tests__/reducers/features.spec.tsx @@ -55,8 +55,6 @@ describe('featureReducer', () => { expect(newState).toEqual( initialState.merge({ [FLAGS.PROMETHEUS]: false, - [FLAGS.CHARGEBACK]: false, - [FLAGS.SERVICE_CATALOG]: false, [FLAGS.CLUSTER_API]: false, [FLAGS.MACHINE_CONFIG]: false, [FLAGS.MACHINE_AUTOSCALER]: false, diff --git a/frontend/integration-tests/protractor.conf.ts b/frontend/integration-tests/protractor.conf.ts index 1daf9483f9a..1a98df10ee6 100644 --- a/frontend/integration-tests/protractor.conf.ts +++ b/frontend/integration-tests/protractor.conf.ts @@ -63,7 +63,6 @@ const testSuites = { 'tests/environment.scenario.ts', 'tests/deploy-image.scenario.ts', 'tests/monitoring.scenario.ts', - 'tests/alertmanager.scenario.ts', 'tests/crd-extensions.scenario.ts', 'tests/oauth.scenario.ts', 'tests/dashboards/cluster-dashboard.scenario.ts', @@ -85,7 +84,6 @@ const testSuites = { 'tests/secrets.scenario.ts', 'tests/deploy-image.scenario.ts', 'tests/monitoring.scenario.ts', - 'tests/alertmanager.scenario.ts', 'tests/crd-extensions.scenario.ts', 'tests/oauth.scenario.ts', 'tests/dashboards/cluster-dashboard.scenario.ts', @@ -94,7 +92,6 @@ const testSuites = { 'tests/cluster-settings.scenario.ts', ]), clusterSettings: suite(['tests/cluster-settings.scenario.ts']), - alertmanager: suite(['tests/alertmanager.scenario.ts']), login: ['tests/login.scenario.ts'], dashboards: suite([ 'tests/dashboards/cluster-dashboard.scenario.ts', @@ -192,14 +189,6 @@ export const config = { testSuites, reducePluginTestSuites(resolvePluginPackages(), __dirname, suite), ), - params: { - // Set to 'true' to enable OpenShift resources in the crud scenario. - // Use a string rather than boolean so it can be specified on the command line: - // $ yarn test-protractor --params.openshift true - openshift: 'false', - // Set to 'true' to enable Service Catalog resources in the crud scenario. - servicecatalog: 'false', - }, }; export const checkLogs = async () => { diff --git a/frontend/integration-tests/tests/alertmanager.scenario.ts b/frontend/integration-tests/tests/alertmanager.scenario.ts deleted file mode 100644 index d401b540e26..00000000000 --- a/frontend/integration-tests/tests/alertmanager.scenario.ts +++ /dev/null @@ -1,519 +0,0 @@ -import { browser, ExpectedConditions as until } from 'protractor'; -import * as _ from 'lodash'; -import { safeLoad } from 'js-yaml'; - -import { checkLogs, checkErrors, firstElementByTestID, appHost } from '../protractor.conf'; -import { fillInput } from '@console/shared/src/test-utils/utils'; -import { dropdownMenuForTestID } from '../views/form.view'; -import { - AlertmanagerConfig, - AlertmanagerReceiver, -} from '@console/internal/components/monitoring/alert-manager-config'; -import * as crudView from '../views/crud.view'; -import * as yamlView from '../views/yaml.view'; -import * as monitoringView from '../views/monitoring.view'; -import * as horizontalnavView from '../views/horizontal-nav.view'; -import { execSync } from 'child_process'; - -const getGlobalsAndReceiverConfig = (configName: string, yamlStr: string) => { - const config: AlertmanagerConfig = safeLoad(yamlStr); - const receiverConfig: AlertmanagerReceiver = _.find(config.receivers, { name: 'MyReceiver' }); - return { - globals: config.global, - receiverConfig: receiverConfig[configName][0], - }; -}; - -describe('Alertmanager: PagerDuty Receiver Form', () => { - afterAll(() => { - execSync( - `kubectl patch secret 'alertmanager-main' -n 'openshift-monitoring' --type='json' -p='[{ op: 'replace', path: '/data/alertmanager.yaml', value: ${monitoringView.defaultAlertmanagerYaml}}]'`, - ); - }); - - afterEach(() => { - checkLogs(); - checkErrors(); - }); - - it('creates PagerDuty Receiver correctly', async () => { - await browser.get(`${appHost}/monitoring/alertmanagerconfig`); - await crudView.isLoaded(); - await firstElementByTestID('create-receiver').click(); - await crudView.isLoaded(); - await firstElementByTestID('receiver-name').sendKeys('MyReceiver'); - await firstElementByTestID('dropdown-button').click(); - await crudView.isLoaded(); - await dropdownMenuForTestID('pagerduty_configs').click(); - await crudView.isLoaded(); - await firstElementByTestID('integration-key').sendKeys(''); - await firstElementByTestID('label-name-0').sendKeys('severity'); - await firstElementByTestID('label-value-0').sendKeys('warning'); - - expect(firstElementByTestID('pagerduty-url').getAttribute('value')).toEqual( - 'https://events.pagerduty.com/v2/enqueue', - ); - - // adv config options - await monitoringView.showAdvancedConfiguration.click(); - expect(firstElementByTestID('send-resolved-alerts').getAttribute('checked')).toBeTruthy(); - expect(firstElementByTestID('pagerduty-client').getAttribute('value')).toEqual( - '{{ template "pagerduty.default.client" . }}', - ); - expect(firstElementByTestID('pagerduty-client-url').getAttribute('value')).toEqual( - '{{ template "pagerduty.default.clientURL" . }}', - ); - expect(firstElementByTestID('pagerduty-description').getAttribute('value')).toEqual( - '{{ template "pagerduty.default.description" .}}', - ); - expect(firstElementByTestID('pagerduty-severity').getAttribute('value')).toEqual('error'); - await monitoringView.saveButton.click(); - await crudView.isLoaded(); - await monitoringView.wait(until.elementToBeClickable(crudView.nameFilter)); - await crudView.nameFilter.clear(); - await crudView.nameFilter.sendKeys('MyReceiver'); - monitoringView.getFirstRowAsText().then((text) => { - expect(text).toEqual('MyReceiver pagerduty severity = warning'); - }); - }); - - it('saves globals correctly', async () => { - await browser.get(`${appHost}/monitoring/alertmanagerconfig/receivers/MyReceiver/edit`); - await browser.wait(until.presenceOf(firstElementByTestID('cancel'))); - - // monitoringView.saveAsDefault checkbox disabled when url equals global url - expect(monitoringView.saveAsDefault.isEnabled()).toBeFalsy(); - - // changing url, enables monitoringView.saveAsDefault unchecked, should save pagerduty_url with Receiver - await fillInput( - firstElementByTestID('pagerduty-url'), - 'http://pagerduty-url-specific-to-receiver', - ); - expect(monitoringView.saveAsDefault.isEnabled()).toBeTruthy(); - expect(monitoringView.saveAsDefault.getAttribute('checked')).toBeFalsy(); - await monitoringView.saveButton.click(); - await crudView.isLoaded(); - - //pagerduty_url should be saved with Receiver and not global - await horizontalnavView.clickHorizontalTab('YAML'); - await yamlView.isLoaded(); - let yamlStr = await yamlView.getEditorContent(); - let configs = getGlobalsAndReceiverConfig('pagerduty_configs', yamlStr); - expect(_.has(configs.globals, 'pagerduty_url')).toBeFalsy(); - expect(configs.receiverConfig.url).toBe('http://pagerduty-url-specific-to-receiver'); - - // save pagerduty_url as default/global - await browser.get(`${appHost}/monitoring/alertmanagerconfig/receivers/MyReceiver/edit`); - await browser.wait(until.presenceOf(firstElementByTestID('cancel'))); - await fillInput(firstElementByTestID('pagerduty-url'), 'http://global-pagerduty-url'); - await crudView.isLoaded(); - expect(monitoringView.saveAsDefault.isEnabled()).toBeTruthy(); - monitoringView.saveAsDefault.click(); - expect(monitoringView.saveAsDefault.getAttribute('checked')).toBeTruthy(); - await monitoringView.saveButton.click(); - await crudView.isLoaded(); - - // pagerduty_url should be saved as global, not with Receiver - await horizontalnavView.clickHorizontalTab('YAML'); - await yamlView.isLoaded(); - yamlStr = await yamlView.getEditorContent(); - configs = getGlobalsAndReceiverConfig('pagerduty_configs', yamlStr); - expect(configs.globals.pagerduty_url).toBe('http://global-pagerduty-url'); - expect(_.has(configs.receiverConfig, 'url')).toBeFalsy(); - - // save pagerduty url to receiver with an existing global - await browser.get(`${appHost}/monitoring/alertmanagerconfig/receivers/MyReceiver/edit`); - await browser.wait(until.presenceOf(firstElementByTestID('cancel'))); - await fillInput( - firstElementByTestID('pagerduty-url'), - 'http://pagerduty-url-specific-to-receiver', - ); - expect(monitoringView.saveAsDefault.isEnabled()).toBeTruthy(); - expect(monitoringView.saveAsDefault.getAttribute('checked')).toBeFalsy(); - await monitoringView.saveButton.click(); - await crudView.isLoaded(); - - // pagerduty_url should be saved with Receiver, as well as having a global pagerduty_url prop - await horizontalnavView.clickHorizontalTab('YAML'); - await yamlView.isLoaded(); - yamlStr = await yamlView.getEditorContent(); - configs = getGlobalsAndReceiverConfig('pagerduty_configs', yamlStr); - expect(configs.globals.pagerduty_url).toBe('http://global-pagerduty-url'); - expect(configs.receiverConfig.url).toBe('http://pagerduty-url-specific-to-receiver'); - }); - - it('saves advanced configuration fields correctly', async () => { - await browser.get(`${appHost}/monitoring/alertmanagerconfig/receivers/MyReceiver/edit`); - await browser.wait(until.presenceOf(firstElementByTestID('cancel'))); - - await monitoringView.showAdvancedConfiguration.click(); - - // change first 3 props so that they are diff from global values, thus saved to Receiver config - expect(monitoringView.sendResolvedAlerts.getAttribute('checked')).toBeTruthy(); - await monitoringView.sendResolvedAlerts.click(); - expect(monitoringView.sendResolvedAlerts.getAttribute('checked')).toBeFalsy(); - await fillInput(firstElementByTestID('pagerduty-client'), 'updated-client'); - await fillInput(firstElementByTestID('pagerduty-client-url'), 'http://updated-client-url'); - - await monitoringView.saveButton.click(); - await crudView.isLoaded(); - - // 3 changed fields should be saved with Receiver. description and severity should not be - // saved with Receiver since they equal global values - await horizontalnavView.clickHorizontalTab('YAML'); - await yamlView.isLoaded(); - let yamlStr = await yamlView.getEditorContent(); - let configs = getGlobalsAndReceiverConfig('pagerduty_configs', yamlStr); - expect(configs.receiverConfig.send_resolved).toBeFalsy(); - expect(configs.receiverConfig.client).toBe('updated-client'); - expect(configs.receiverConfig.client_url).toBe('http://updated-client-url'); - expect(configs.receiverConfig.description).toBe(undefined); - expect(configs.receiverConfig.severity).toBe(undefined); - - // restore default values for the 3, change desc and severity -which should then be saved - // with Receiver while initial 3 are removed from Receiver config - await browser.get(`${appHost}/monitoring/alertmanagerconfig/receivers/MyReceiver/edit`); - await browser.wait(until.presenceOf(firstElementByTestID('cancel'))); - await monitoringView.showAdvancedConfiguration.click(); - expect(monitoringView.sendResolvedAlerts.getAttribute('checked')).toBeFalsy(); - await monitoringView.sendResolvedAlerts.click(); - expect(monitoringView.sendResolvedAlerts.getAttribute('checked')).toBeTruthy(); - await fillInput( - firstElementByTestID('pagerduty-client'), - '{{ template "pagerduty.default.client" . }}', - ); - await fillInput( - firstElementByTestID('pagerduty-client-url'), - '{{ template "pagerduty.default.clientURL" . }}', - ); - await fillInput(firstElementByTestID('pagerduty-description'), 'new description'); - await fillInput(firstElementByTestID('pagerduty-severity'), 'warning'); - await monitoringView.saveButton.click(); - await crudView.isLoaded(); - - await horizontalnavView.clickHorizontalTab('YAML'); - await yamlView.isLoaded(); - yamlStr = await yamlView.getEditorContent(); - configs = getGlobalsAndReceiverConfig('pagerduty_configs', yamlStr); - expect(configs.receiverConfig.send_resolved).toBe(undefined); - expect(configs.receiverConfig.client).toBe(undefined); - expect(configs.receiverConfig.client_url).toBe(undefined); - expect(configs.receiverConfig.description).toBe('new description'); - expect(configs.receiverConfig.severity).toBe('warning'); - }); -}); - -describe('Alertmanager: Email Receiver Form', () => { - afterAll(() => { - execSync( - `kubectl patch secret 'alertmanager-main' -n 'openshift-monitoring' --type='json' -p='[{ op: 'replace', path: '/data/alertmanager.yaml', value: ${monitoringView.defaultAlertmanagerYaml}}]'`, - ); - }); - - afterEach(() => { - checkLogs(); - checkErrors(); - }); - - it('creates Email Receiver correctly', async () => { - await browser.get(`${appHost}/monitoring/alertmanagerconfig`); - await crudView.isLoaded(); - await firstElementByTestID('create-receiver').click(); - await crudView.isLoaded(); - await fillInput(firstElementByTestID('receiver-name'), 'MyReceiver'); - await firstElementByTestID('dropdown-button').click(); - await crudView.isLoaded(); - await dropdownMenuForTestID('email_configs').click(); - await crudView.isLoaded(); - - // check defaults - expect(monitoringView.saveAsDefault.isEnabled()).toBeFalsy(); // prior to smtp change, monitoringView.saveAsDefault disabled - expect(firstElementByTestID('email-hello').getAttribute('value')).toEqual('localhost'); - expect(firstElementByTestID('email-require-tls').getAttribute('checked')).toBeTruthy(); - // adv fields - await monitoringView.showAdvancedConfiguration.click(); - expect(monitoringView.sendResolvedAlerts.getAttribute('checked')).toBeFalsy(); - expect(firstElementByTestID('email-html').getAttribute('value')).toEqual( - '{{ template "email.default.html" . }}', - ); - - // change required fields - await fillInput(firstElementByTestID('email-to'), 'you@there.com'); - await fillInput(firstElementByTestID('email-from'), 'me@here.com'); - expect(monitoringView.saveAsDefault.isEnabled()).toBeTruthy(); // monitoringView.saveAsDefault enabled - await fillInput(firstElementByTestID('email-smarthost'), 'smarthost:8080'); - await fillInput(firstElementByTestID('label-name-0'), 'severity'); - await fillInput(firstElementByTestID('label-value-0'), 'warning'); - await monitoringView.saveButton.click(); - await crudView.isLoaded(); - - // all required fields should be saved with Receiver and not globally - await horizontalnavView.clickHorizontalTab('YAML'); - await yamlView.isLoaded(); - const yamlStr = await yamlView.getEditorContent(); - const configs = getGlobalsAndReceiverConfig('email_configs', yamlStr); - expect(_.has(configs.globals, 'email_to')).toBeFalsy(); - expect(_.has(configs.globals, 'smtp_from')).toBeFalsy(); - expect(_.has(configs.globals, 'smtp_smarthost')).toBeFalsy(); - expect(_.has(configs.globals, 'smtp_require_tls')).toBeFalsy(); - expect(configs.receiverConfig.to).toBe('you@there.com'); - expect(configs.receiverConfig.from).toBe('me@here.com'); - expect(configs.receiverConfig.smarthost).toBe('smarthost:8080'); - expect(_.has(configs.receiverConfig, 'require_tls')).toBeFalsy(); // unchanged from global value - }); - - it('saves globals and advanced fields correctly', async () => { - await browser.get(`${appHost}/monitoring/alertmanagerconfig/receivers/MyReceiver/edit`); - await browser.wait(until.presenceOf(firstElementByTestID('cancel'))); - - // Check updated form fields - expect(firstElementByTestID('email-to').getAttribute('value')).toEqual('you@there.com'); - expect(monitoringView.saveAsDefault.isEnabled()).toBeTruthy(); // smtp_from different from global - expect(monitoringView.saveAsDefault.getAttribute('checked')).toBeFalsy(); - expect(firstElementByTestID('email-from').getAttribute('value')).toEqual('me@here.com'); - expect(firstElementByTestID('email-hello').getAttribute('value')).toEqual('localhost'); - - // Change smtp global fields - await fillInput(firstElementByTestID('email-auth-username'), 'username'); - await fillInput(firstElementByTestID('email-auth-password'), 'password'); - await fillInput(firstElementByTestID('email-auth-identity'), 'identity'); - await fillInput(firstElementByTestID('email-auth-secret'), 'secret'); - await firstElementByTestID('email-require-tls').click(); - - // Change advanced fields - await monitoringView.showAdvancedConfiguration.click(); - await monitoringView.sendResolvedAlerts.click(); - await fillInput(firstElementByTestID('email-html'), 'myhtml'); - await monitoringView.saveButton.click(); // monitoringView.saveAsDefault not checked, so all should be saved with Reciever - await crudView.isLoaded(); - - // all fields saved to receiver since save as default not checked - await horizontalnavView.clickHorizontalTab('YAML'); - await yamlView.isLoaded(); - - let yamlStr = await yamlView.getEditorContent(); - let configs = getGlobalsAndReceiverConfig('email_configs', yamlStr); - expect(_.has(configs.globals, 'smtp_auth_username')).toBeFalsy(); - expect(configs.receiverConfig.auth_username).toBe('username'); - expect(configs.receiverConfig.auth_password).toBe('password'); - expect(configs.receiverConfig.auth_identity).toBe('identity'); - expect(configs.receiverConfig.auth_secret).toBe('secret'); - expect(configs.receiverConfig.require_tls).toBeFalsy(); - // adv fields - expect(configs.receiverConfig.send_resolved).toBeTruthy(); - expect(configs.receiverConfig.html).toBe('myhtml'); - - // Save As Default - await browser.get(`${appHost}/monitoring/alertmanagerconfig/receivers/MyReceiver/edit`); - await browser.wait(until.presenceOf(firstElementByTestID('cancel'))); - monitoringView.saveAsDefault.click(); - await monitoringView.saveButton.click(); - await crudView.isLoaded(); - // global fields saved in config.global - await horizontalnavView.clickHorizontalTab('YAML'); - await yamlView.isLoaded(); - yamlStr = await yamlView.getEditorContent(); - configs = getGlobalsAndReceiverConfig('email_configs', yamlStr); - expect(configs.globals.smtp_from).toBe('me@here.com'); - expect(configs.globals.smtp_hello).toBe('localhost'); - expect(configs.globals.smtp_smarthost).toBe('smarthost:8080'); - expect(configs.globals.smtp_auth_username).toBe('username'); - expect(configs.globals.smtp_auth_password).toBe('password'); - expect(configs.globals.smtp_auth_identity).toBe('identity'); - expect(configs.globals.smtp_auth_secret).toBe('secret'); - expect(configs.globals.smtp_require_tls).toBeFalsy(); - // non-global fields should still be saved with Receiver - expect(configs.receiverConfig.to).toBe('you@there.com'); - }); -}); - -describe('Alertmanager: Slack Receiver Form', () => { - afterAll(() => { - execSync( - `kubectl patch secret 'alertmanager-main' -n 'openshift-monitoring' --type='json' -p='[{ op: 'replace', path: '/data/alertmanager.yaml', value: ${monitoringView.defaultAlertmanagerYaml}}]'`, - ); - }); - - afterEach(() => { - checkLogs(); - checkErrors(); - }); - - it('creates Slack Receiver correctly', async () => { - await browser.get(`${appHost}/monitoring/alertmanagerconfig`); - await crudView.isLoaded(); - await firstElementByTestID('create-receiver').click(); - await crudView.isLoaded(); - await fillInput(firstElementByTestID('receiver-name'), 'MyReceiver'); - await firstElementByTestID('dropdown-button').click(); - await crudView.isLoaded(); - await dropdownMenuForTestID('slack_configs').click(); - await crudView.isLoaded(); - - // check defaults - expect(monitoringView.saveAsDefault.isEnabled()).toBeFalsy(); - // adv fields - await monitoringView.showAdvancedConfiguration.click(); - expect(monitoringView.sendResolvedAlerts.getAttribute('checked')).toBeFalsy(); - expect(firstElementByTestID('slack-icon-url').getAttribute('value')).toEqual( - '{{ template "slack.default.iconurl" .}}', - ); - expect(firstElementByTestID('slack-icon-emoji').isPresent()).toBe(false); - await firstElementByTestID('slack-icon-type-emoji').click(); - expect(firstElementByTestID('slack-icon-url').isPresent()).toBe(false); - expect(firstElementByTestID('slack-icon-emoji').getAttribute('value')).toEqual( - '{{ template "slack.default.iconemoji" .}}', - ); - expect(firstElementByTestID('slack-username').getAttribute('value')).toEqual( - '{{ template "slack.default.username" . }}', - ); - expect(firstElementByTestID('slack-link-names').getAttribute('checked')).toBeFalsy(); - - // change required fields - await fillInput(firstElementByTestID('slack-api-url'), 'http://myslackapi'); - expect(monitoringView.saveAsDefault.isEnabled()).toBeTruthy(); // monitoringView.saveAsDefault enabled - await fillInput(firstElementByTestID('slack-channel'), 'myslackchannel'); - await fillInput(firstElementByTestID('label-name-0'), 'severity'); - await fillInput(firstElementByTestID('label-value-0'), 'warning'); - await monitoringView.saveButton.click(); - await crudView.isLoaded(); - - // all required fields should be saved with Receiver and not globally - await horizontalnavView.clickHorizontalTab('YAML'); - await yamlView.isLoaded(); - const yamlStr = await yamlView.getEditorContent(); - const configs = getGlobalsAndReceiverConfig('slack_configs', yamlStr); - expect(_.has(configs.globals, 'slack_api_url')).toBeFalsy(); - expect(configs.receiverConfig.channel).toBe('myslackchannel'); - expect(configs.receiverConfig.api_url).toBe('http://myslackapi'); - // make sure adv fields are not saved since they equal their global values - expect(_.has(configs.receiverConfig, 'send_resolved')).toBeFalsy(); - expect(_.has(configs.receiverConfig, 'username')).toBeFalsy(); - }); - - it('saves globals and advanced fields correctly', async () => { - await browser.get(`${appHost}/monitoring/alertmanagerconfig/receivers/MyReceiver/edit`); - await browser.wait(until.presenceOf(firstElementByTestID('cancel'))); - - // Check updated form fields - expect(firstElementByTestID('slack-channel').getAttribute('value')).toEqual('myslackchannel'); - expect(monitoringView.saveAsDefault.isEnabled()).toBeTruthy(); // different from global - expect(firstElementByTestID('slack-api-url').getAttribute('value')).toEqual( - 'http://myslackapi', - ); - - // Change advanced fields - await monitoringView.showAdvancedConfiguration.click(); - await monitoringView.sendResolvedAlerts.click(); - await fillInput(firstElementByTestID('slack-icon-url'), 'http://myslackicon'); - await fillInput(firstElementByTestID('slack-username'), 'slackuser'); - await firstElementByTestID('slack-link-names').click(); - - monitoringView.saveAsDefault.click(); - await monitoringView.saveButton.click(); - await crudView.isLoaded(); - await browser.get(`${appHost}/monitoring/alertmanagerconfig/receivers/MyReceiver/edit`); - await crudView.isLoaded(); - // check updated advanced form fields - await monitoringView.showAdvancedConfiguration.click(); - expect(monitoringView.sendResolvedAlerts.getAttribute('checked')).toBeTruthy(); - expect(firstElementByTestID('slack-icon-url').getAttribute('value')).toEqual( - 'http://myslackicon', - ); - expect(firstElementByTestID('slack-icon-emoji').isPresent()).toBe(false); - expect(firstElementByTestID('slack-username').getAttribute('value')).toEqual('slackuser'); - expect(firstElementByTestID('slack-link-names').getAttribute('checked')).toBeTruthy(); - - // check saved to slack receiver config yaml - await browser.get(`${appHost}/monitoring/alertmanageryaml`); - await yamlView.isLoaded(); - const yamlStr = await yamlView.getEditorContent(); - const configs = getGlobalsAndReceiverConfig('slack_configs', yamlStr); - expect(configs.globals.slack_api_url).toBe('http://myslackapi'); - expect(_.has(configs.receiverConfig, 'api_url')).toBeFalsy(); - expect(configs.receiverConfig.channel).toBe('myslackchannel'); - // advanced fields - expect(configs.receiverConfig.send_resolved).toBeTruthy(); - expect(configs.receiverConfig.icon_url).toBe('http://myslackicon'); - expect(configs.receiverConfig.username).toBe('slackuser'); - expect(configs.receiverConfig.link_names).toBeTruthy(); - }); -}); - -describe('Alertmanager: Webhook Receiver Form', () => { - afterAll(() => { - execSync( - `kubectl patch secret 'alertmanager-main' -n 'openshift-monitoring' --type='json' -p='[{ op: 'replace', path: '/data/alertmanager.yaml', value: ${monitoringView.defaultAlertmanagerYaml}}]'`, - ); - }); - - afterEach(() => { - checkLogs(); - checkErrors(); - }); - - it('creates Webhook Receiver correctly', async () => { - await browser.get(`${appHost}/monitoring/alertmanagerconfig`); - await crudView.isLoaded(); - await firstElementByTestID('create-receiver').click(); - await crudView.isLoaded(); - await fillInput(firstElementByTestID('receiver-name'), 'MyReceiver'); - await firstElementByTestID('dropdown-button').click(); - await crudView.isLoaded(); - await dropdownMenuForTestID('webhook_configs').click(); - await crudView.isLoaded(); - - // check adv field default value - await monitoringView.showAdvancedConfiguration.click(); - expect(monitoringView.sendResolvedAlerts.getAttribute('checked')).toBeTruthy(); - - // change required fields - await fillInput(firstElementByTestID('webhook-url'), 'http://mywebhookurl'); - await fillInput(firstElementByTestID('label-name-0'), 'severity'); - await fillInput(firstElementByTestID('label-value-0'), 'warning'); - await monitoringView.saveButton.click(); - await crudView.isLoaded(); - - // all required fields should be saved with Receiver - await horizontalnavView.clickHorizontalTab('YAML'); - await yamlView.isLoaded(); - const yamlStr = await yamlView.getEditorContent(); - const configs = getGlobalsAndReceiverConfig('webhook_configs', yamlStr); - expect(configs.receiverConfig.url).toBe('http://mywebhookurl'); - expect(_.has(configs.receiverConfig, 'send_resolved')).toBeFalsy(); - }); - - it('edits Webhook Receiver and saves advanced fields correctly', async () => { - await browser.get(`${appHost}/monitoring/alertmanagerconfig/receivers/MyReceiver/edit`); - await browser.wait(until.presenceOf(firstElementByTestID('cancel'))); - - // Check updated form fields - expect(firstElementByTestID('webhook-url').getAttribute('value')).toEqual( - 'http://mywebhookurl', - ); - - await fillInput(firstElementByTestID('webhook-url'), 'http://myupdatedwebhookurl'); - // Change advanced fields - await monitoringView.showAdvancedConfiguration.click(); - await monitoringView.sendResolvedAlerts.click(); - - await monitoringView.saveButton.click(); - await crudView.isLoaded(); - await browser.get(`${appHost}/monitoring/alertmanagerconfig/receivers/MyReceiver/edit`); - await crudView.isLoaded(); - // check updated advanced form fields - await monitoringView.showAdvancedConfiguration.click(); - expect(monitoringView.sendResolvedAlerts.getAttribute('checked')).toBeFalsy(); - - // check saved to slack receiver config yaml - await browser.get(`${appHost}/monitoring/alertmanageryaml`); - await yamlView.isLoaded(); - await horizontalnavView.clickHorizontalTab('YAML'); - await yamlView.isLoaded(); - const yamlStr = await yamlView.getEditorContent(); - const configs = getGlobalsAndReceiverConfig('webhook_configs', yamlStr); - expect(configs.receiverConfig.url).toBe('http://myupdatedwebhookurl'); - // advanced field - expect(configs.receiverConfig.send_resolved).toBeFalsy(); - }); -}); diff --git a/frontend/integration-tests/tests/monitoring.scenario.ts b/frontend/integration-tests/tests/monitoring.scenario.ts deleted file mode 100644 index da6121d0b24..00000000000 --- a/frontend/integration-tests/tests/monitoring.scenario.ts +++ /dev/null @@ -1,234 +0,0 @@ -import { browser, ExpectedConditions as until } from 'protractor'; - -import { checkLogs, checkErrors, firstElementByTestID, appHost } from '../protractor.conf'; -import { dropdownMenuForTestID } from '../views/form.view'; -import * as crudView from '../views/crud.view'; -import * as yamlView from '../views/yaml.view'; -import * as monitoringView from '../views/monitoring.view'; -import * as sidenavView from '../views/sidenav.view'; -import * as horizontalnavView from '../views/horizontal-nav.view'; -import { execSync } from 'child_process'; - -describe('Alertmanager: YAML', () => { - afterEach(() => { - checkLogs(); - checkErrors(); - }); - - it('displays the Alertmanager YAML page', async () => { - await sidenavView.clickNavLink(['Administration', 'Cluster Settings']); - await crudView.isLoaded(); - await horizontalnavView.clickHorizontalTab('Configuration'); - await crudView.isLoaded(); - await monitoringView.wait(until.elementToBeClickable(firstElementByTestID('Alertmanager'))); - expect(firstElementByTestID('Alertmanager').getText()).toContain('Alertmanager'); - await firstElementByTestID('Alertmanager').click(); - await crudView.isLoaded(); - await horizontalnavView.clickHorizontalTab('YAML'); - await yamlView.isLoaded(); - expect(yamlView.yamlEditor.isPresent()).toBe(true); - }); - - it('saves Alertmanager YAML', async () => { - expect(monitoringView.successAlert.isPresent()).toBe(false); - await yamlView.saveButton.click(); - await yamlView.isLoaded(); - expect(monitoringView.successAlert.isPresent()).toBe(true); - }); -}); - -describe('Alertmanager: Configuration', () => { - afterAll(() => { - execSync( - `kubectl patch secret 'alertmanager-main' -n 'openshift-monitoring' --type='json' -p='[{ op: 'replace', path: '/data/alertmanager.yaml', value: ${monitoringView.defaultAlertmanagerYaml}}]'`, - ); - }); - - afterEach(() => { - checkLogs(); - checkErrors(); - }); - - it('displays the Alertmanager Configuration Details page', async () => { - await browser.get(`${appHost}/monitoring/alertmanagerconfig`); - await crudView.isLoaded(); - expect(monitoringView.alertRoutingHeader.getText()).toContain('Alert routing'); - }); - - it('launches Alert Routing modal, edits and saves correctly', async () => { - await crudView.isLoaded(); - expect(monitoringView.alertRoutingEditButton.isPresent()).toBe(true); - await monitoringView.alertRoutingEditButton.click(); - await crudView.isLoaded(); - - await browser.wait(until.elementToBeClickable(firstElementByTestID('input-group-by'))); - await firstElementByTestID('input-group-by').sendKeys(', cluster'); - await firstElementByTestID('input-group-wait').clear(); - await firstElementByTestID('input-group-wait').sendKeys('60s'); - await firstElementByTestID('input-group-interval').clear(); - await firstElementByTestID('input-group-interval').sendKeys('10m'); - await firstElementByTestID('input-repeat-interval').clear(); - await firstElementByTestID('input-repeat-interval').sendKeys('24h'); - - await monitoringView.saveButton.click(); - await crudView.isLoaded(); - expect(firstElementByTestID('group_by_value').getText()).toContain(', cluster'); - expect(firstElementByTestID('group_wait_value').getText()).toEqual('60s'); - expect(firstElementByTestID('group_interval_value').getText()).toEqual('10m'); - expect(firstElementByTestID('repeat_interval_value').getText()).toEqual('24h'); - }); - - it('creates a receiver correctly', async () => { - await crudView.isLoaded(); - await firstElementByTestID('create-receiver').click(); - await crudView.isLoaded(); - - // these are hidden and disabled until receiverType selected - expect(firstElementByTestID('pagerduty-receiver-form').isPresent()).toBe(false); - expect(firstElementByTestID('receiver-routing-labels-editor').isPresent()).toBe(false); - expect(monitoringView.saveButton.isEnabled()).toBe(false); - - await firstElementByTestID('receiver-name').sendKeys('MyReceiver'); - await firstElementByTestID('dropdown-button').click(); - await crudView.isLoaded(); - - await dropdownMenuForTestID('pagerduty_configs').click(); - await crudView.isLoaded(); - - // these should be shown after receiverType selected - expect(firstElementByTestID('pagerduty-receiver-form').isPresent()).toBe(true); - expect(firstElementByTestID('receiver-routing-labels-editor').isPresent()).toBe(true); - - expect(firstElementByTestID('pagerduty-key-label').getText()).toEqual('Routing key'); - await firstElementByTestID('integration-type-prometheus').click(); - expect(firstElementByTestID('pagerduty-key-label').getText()).toEqual('Service key'); - - // pagerduty subform should still be invalid at this point, thus save button should be disabled - expect(monitoringView.saveButton.isEnabled()).toBe(false); - await firstElementByTestID('integration-key').sendKeys(''); - - // labels - expect(firstElementByTestID('invalid-label-name-error').isPresent()).toBe(false); - await firstElementByTestID('label-name-0').sendKeys('9abcgo'); // invalid, cannot start with digit - expect(firstElementByTestID('invalid-label-name-error').isPresent()).toBe(true); - await firstElementByTestID('label-name-0').clear(); - await firstElementByTestID('label-name-0').sendKeys('_abcd'); // valid, can start with and contain '_' - expect(firstElementByTestID('invalid-label-name-error').isPresent()).toBe(false); - await firstElementByTestID('label-name-0').clear(); - await firstElementByTestID('label-name-0').sendKeys('abcd@#$R@T%'); // invalid chars - expect(firstElementByTestID('invalid-label-name-error').isPresent()).toBe(true); - await firstElementByTestID('label-name-0').clear(); - expect(firstElementByTestID('duplicate-label-name-error').isPresent()).toBe(false); - await firstElementByTestID('label-name-0').sendKeys('severity'); - expect(firstElementByTestID('invalid-label-name-error').isPresent()).toBe(false); - await firstElementByTestID('label-value-0').sendKeys('warning'); - await firstElementByTestID('add-routing-label').click(); - await firstElementByTestID('label-name-1').sendKeys('severity'); - await firstElementByTestID('label-value-1').sendKeys('warning'); - expect(firstElementByTestID('duplicate-label-name-error').isPresent()).toBe(true); - await firstElementByTestID('remove-routing-label').click(); - expect(firstElementByTestID('duplicate-label-name-error').isPresent()).toBe(false); - - expect(monitoringView.saveButton.isEnabled()).toBe(true); // subform valid & labels provided, save should be enabled at this point - await monitoringView.saveButton.click(); - await crudView.isLoaded(); - await monitoringView.wait(until.elementToBeClickable(crudView.nameFilter)); - await crudView.nameFilter.clear(); - await crudView.nameFilter.sendKeys('MyReceiver'); - monitoringView.getFirstRowAsText().then((text) => { - expect(text).toEqual('MyReceiver pagerduty severity = warning'); - }); - }); - - it('edits a receiver correctly', async () => { - await crudView.isLoaded(); - await monitoringView.wait(until.elementToBeClickable(crudView.nameFilter)); - await crudView.nameFilter.clear(); - await crudView.nameFilter.sendKeys('MyReceiver'); - expect(crudView.resourceRows.count()).toBe(1); - await monitoringView.clickFirstRowKebabAction('Edit Receiver'); - await browser.wait(until.presenceOf(firstElementByTestID('cancel'))); - expect(firstElementByTestID('receiver-name').getAttribute('value')).toEqual('MyReceiver'); - expect(firstElementByTestID('dropdown-button').getText()).toEqual('PagerDuty'); - expect(firstElementByTestID('pagerduty-key-label').getText()).toEqual('Service key'); - expect(firstElementByTestID('integration-key').getAttribute('value')).toEqual( - '', - ); - expect(firstElementByTestID('label-name-0').getAttribute('value')).toEqual('severity'); - expect(firstElementByTestID('label-value-0').getAttribute('value')).toEqual('warning'); - - // Edit Values - - await firstElementByTestID('receiver-name').clear(); - await firstElementByTestID('receiver-name').sendKeys('MyEditedReceiver'); - await firstElementByTestID('label-name-0').clear(); - await firstElementByTestID('label-name-0').sendKeys('cluster'); - await firstElementByTestID('label-value-0').clear(); - await firstElementByTestID('label-value-0').sendKeys('MyCluster'); - - await monitoringView.saveButton.click(); - await crudView.isLoaded(); - await monitoringView.wait(until.elementToBeClickable(crudView.nameFilter)); - await crudView.nameFilter.clear(); - await crudView.nameFilter.sendKeys('MyEditedReceiver'); - monitoringView.getFirstRowAsText().then((text) => { - expect(text).toEqual('MyEditedReceiver pagerduty cluster = MyCluster'); - }); - }); - - it('deletes a receiver correctly', async () => { - await horizontalnavView.clickHorizontalTab('Details'); - await crudView.isLoaded(); - await monitoringView.wait(until.elementToBeClickable(crudView.nameFilter)); - await crudView.nameFilter.clear(); - await crudView.nameFilter.sendKeys('MyEditedReceiver'); - expect(crudView.resourceRows.count()).toBe(1); - - await monitoringView.clickFirstRowKebabAction('Delete Receiver'); - await browser.wait(until.presenceOf(monitoringView.saveButton)); - await monitoringView.saveButton.click(); - - await crudView.isLoaded(); - await monitoringView.wait(until.elementToBeClickable(crudView.nameFilter)); - await crudView.nameFilter.clear(); - await crudView.nameFilter.sendKeys('MyEditedReceiver'); - expect(crudView.resourceRows.count()).toBe(0); - }); - - it('prevents deletion of default receiver', async () => { - await crudView.isLoaded(); - await monitoringView.wait(until.elementToBeClickable(crudView.nameFilter)); - await crudView.nameFilter.clear(); - await crudView.nameFilter.sendKeys('Default'); - await monitoringView.openFirstRowKebabMenu(); - expect(monitoringView.disabledDeleteReceiverMenuItem.isPresent()).toBe(true); - }); - - it('prevents deletion and form edit of a receiver with sub-route', async () => { - // add receiver with sub-route - const yaml = `route: - routes: - - match: - service: database - receiver: team-DB-pager - routes: - - match: - owner: team-X - receiver: team-X-pager -receivers: -- name: 'team-X-pager' -- name: 'team-DB-pager'`; - await crudView.isLoaded(); - await horizontalnavView.clickHorizontalTab('YAML'); - await yamlView.isLoaded(); - await yamlView.setEditorContent(yaml); - await yamlView.saveButton.click(); - await yamlView.isLoaded(); - expect(monitoringView.successAlert.isPresent()).toBe(true); - - await horizontalnavView.clickHorizontalTab('Details'); - await monitoringView.openFirstRowKebabMenu(); - expect(monitoringView.disabledDeleteReceiverMenuItem.isPresent()).toBe(true); - expect(crudView.actionForLabel('Edit Receiver').isPresent()).toBe(true); - }); -}); diff --git a/frontend/integration-tests/views/catalog.view.ts b/frontend/integration-tests/views/catalog.view.ts index 404613f1a83..2de453a6608 100644 --- a/frontend/integration-tests/views/catalog.view.ts +++ b/frontend/integration-tests/views/catalog.view.ts @@ -1,4 +1,4 @@ -import { $, $$, browser, by, ExpectedConditions as until } from 'protractor'; +import { $, $$, browser, ExpectedConditions as until } from 'protractor'; export const categoryTabs = $$('.vertical-tabs-pf-tab > a'); export const categoryTabsPresent = () => browser.wait(until.presenceOf($('.vertical-tabs-pf-tab'))); @@ -10,8 +10,3 @@ export const pageHeadingNumberOfItems = () => .then((text) => parseInt(text.substring(0, text.indexOf(' items')), 10)); export const catalogDetailsLoaded = () => browser.wait(until.presenceOf($('.modal-content')), 10000).then(() => browser.sleep(1000)); -export const createServiceInstanceButton = $('.co-catalog-page__overlay-action'); -export const createServiceInstanceForm = $('.co-create-service-instance'); -export const createServiceBindingButton = $('.co-hint-block').element( - by.buttonText('Create Service Binding'), -); diff --git a/frontend/packages/console-shared/src/constants/common.ts b/frontend/packages/console-shared/src/constants/common.ts index 89241c7786a..c1cfa3e3b98 100644 --- a/frontend/packages/console-shared/src/constants/common.ts +++ b/frontend/packages/console-shared/src/constants/common.ts @@ -57,7 +57,6 @@ export const OPERATOR_HUB_LABEL = 'openshift-marketplace'; export enum FLAGS { AUTH_ENABLED = 'AUTH_ENABLED', PROMETHEUS = 'PROMETHEUS', - CHARGEBACK = 'CHARGEBACK', OPENSHIFT = 'OPENSHIFT', CAN_GET_NS = 'CAN_GET_NS', CAN_LIST_NS = 'CAN_LIST_NS', @@ -73,7 +72,6 @@ export enum FLAGS { CAN_LIST_VSC = 'CAN_LIST_VSC', CLUSTER_AUTOSCALER = 'CLUSTER_AUTOSCALER', SHOW_OPENSHIFT_START_GUIDE = 'SHOW_OPENSHIFT_START_GUIDE', - SERVICE_CATALOG = 'SERVICE_CATALOG', CLUSTER_API = 'CLUSTER_API', CLUSTER_VERSION = 'CLUSTER_VERSION', MACHINE_CONFIG = 'MACHINE_CONFIG', diff --git a/frontend/packages/integration-tests-cypress/tests/crud/other-routes.spec.ts b/frontend/packages/integration-tests-cypress/tests/crud/other-routes.spec.ts index 5ac7c9f290e..3a4bdf4be3d 100644 --- a/frontend/packages/integration-tests-cypress/tests/crud/other-routes.spec.ts +++ b/frontend/packages/integration-tests-cypress/tests/crud/other-routes.spec.ts @@ -91,17 +91,6 @@ describe('Visiting other routes', () => { path: '/k8s/cluster/machineconfiguration.openshift.io~v1~MachineConfigPool', waitFor: () => listPage.rows.shouldBeLoaded(), }, - { - path: '/k8s/all-namespaces/monitoring.coreos.com~v1~Alertmanager', - waitFor: () => listPage.rows.shouldBeLoaded(), - }, - { - path: '/k8s/ns/openshift-monitoring/monitoring.coreos.com~v1~Alertmanager/main', - waitFor: () => { - detailsPage.isLoaded(); - cy.byTestID('label-list').should('be.visible'); - }, - }, { path: '/settings/cluster', waitFor: () => cy.byLegacyTestID('cluster-version').should('exist'), diff --git a/frontend/packages/operator-lifecycle-manager/mocks.ts b/frontend/packages/operator-lifecycle-manager/mocks.ts index 9b4316c6d89..540075abed8 100644 --- a/frontend/packages/operator-lifecycle-manager/mocks.ts +++ b/frontend/packages/operator-lifecycle-manager/mocks.ts @@ -666,54 +666,6 @@ const prometheusPackageManifest = { }, }; -const svcatPackageManifest = { - apiVersion: 'packages.operators.coreos.com/v1' as PackageManifestKind['apiVersion'], - kind: 'PackageManifest' as PackageManifestKind['kind'], - metadata: { - name: 'svcat', - namespace: 'openshift-operator-lifecycle-manager', - creationTimestamp: '2018-10-23T12:50:22Z', - labels: { - catalog: 'rh-operators', - 'catalog-namespace': 'openshift-operator-lifecycle-manager', - provider: 'Red Hat', - 'provider-url': '', - }, - }, - spec: {}, - status: { - catalogSource: 'rh-operators', - catalogSourceDisplayName: 'Red Hat Operators', - catalogSourcePublisher: 'Red Hat', - catalogSourceNamespace: 'openshift-operator-lifecycle-manager', - provider: { - name: 'Red Hat', - }, - packageName: 'svcat', - channels: [ - { - name: 'alpha', - currentCSV: 'svcat.v0.1.34', - currentCSVDesc: { - icon: [], - displayName: 'Service Catalog', - version: '0.1.34', - provider: { - name: 'Red Hat', - }, - installModes: [], - annotations: { - description: - 'Service Catalog lets you provision cloud services directly from the comfort of native Kubernetes tooling.', - categories: 'catalog', - }, - }, - }, - ], - defaultChannel: '', - }, -}; - export const dummyPackageManifest = { apiVersion: 'packages.operators.coreos.com/v1' as PackageManifestKind['apiVersion'], kind: 'PackageManifest' as PackageManifestKind['kind'], @@ -773,7 +725,6 @@ export const operatorHubListPageProps = { etcdPackageManifest, federationv2PackageManifest, prometheusPackageManifest, - svcatPackageManifest, ] as PackageManifestKind[], }, clusterServiceVersions: null, @@ -889,33 +840,6 @@ export const operatorHubTileViewPageProps = { validSubscription: undefined, infraFeatures: undefined, }, - { - obj: svcatPackageManifest, - installState: 'Not Installed', - installed: false, - kind: 'PackageManifest', - name: 'svcat', - uid: 'svcat/openshift-operator-lifecycle-manager', - imgUrl: - '/api/kubernetes/apis/packages.operators.coreos.com/v1/packagemanifests/svcat/icon?resourceVersion=svcat.alpha.svcat.v0.1.34', - iconClass: null, - description: undefined, - provider: 'Red Hat', - tags: undefined, - version: '0.1.34', - certifiedLevel: undefined, - healthIndex: undefined, - repository: undefined, - containerImage: undefined, - createdAt: undefined, - support: undefined, - longDescription: undefined, - categories: ['catalog'], - catalogSource: 'testing', - catalogSourceNamespace: 'openshift-marketplace', - validSubscription: undefined, - infraFeatures: undefined, - }, ] as OperatorHubItem[], openOverlay: null, }; diff --git a/frontend/public/actions/features.ts b/frontend/public/actions/features.ts index 62eb4441dad..96fe7d09bbc 100644 --- a/frontend/public/actions/features.ts +++ b/frontend/public/actions/features.ts @@ -140,15 +140,6 @@ const ssarChecks = [ verb: 'list', }, }, - { - flag: FLAGS.CAN_LIST_CHARGEBACK_REPORTS, - resourceAttributes: { - group: 'metering.openshift.io', - resource: 'reports', - namespace: 'openshift-metering', - verb: 'list', - }, - }, // TODO: Move into Core Plugin { flag: FLAGS.CAN_LIST_VSC, diff --git a/frontend/public/components/_cluster-service-instance.scss b/frontend/public/components/_cluster-service-instance.scss deleted file mode 100644 index 83578893b24..00000000000 --- a/frontend/public/components/_cluster-service-instance.scss +++ /dev/null @@ -1,20 +0,0 @@ -.co-catalog-item-info { - margin-bottom: 20px; -} - -.co-create-service-instance__namespace .pf-c-dropdown { - width: 100%; -} - -.co-create-service-instance__plan { - margin-top: 0; -} - -.co-service-catalog-parameters label[for="root"] { - // Hide the empty root label from service catalog parameter forms to avoid unwanted top margin. - display: none; -} - -.co-service-instance-delete-bindings-warning { - margin: 30px; -} diff --git a/frontend/public/components/_resource.scss b/frontend/public/components/_resource.scss index 525db596ad1..704ab18283c 100644 --- a/frontend/public/components/_resource.scss +++ b/frontend/public/components/_resource.scss @@ -87,10 +87,6 @@ background-color: $color-secret-dark; } -.co-m-resource-alertmanager { - background-color: $color-alertmanager-dark; -} - .co-m-resource-service { background-color: $color-service-dark; } diff --git a/frontend/public/components/alert-manager.tsx b/frontend/public/components/alert-manager.tsx deleted file mode 100644 index 334533a3e1a..00000000000 --- a/frontend/public/components/alert-manager.tsx +++ /dev/null @@ -1,164 +0,0 @@ -import * as React from 'react'; -import { sortable } from '@patternfly/react-table'; -import { Button } from '@patternfly/react-core'; -import { PencilAltIcon } from '@patternfly/react-icons'; - -import { referenceForModel, K8sResourceKind } from '../module/k8s'; -import { ListPage, DetailsPage, Table, TableRow, TableData, RowFunction } from './factory'; -import { SectionHeading, LabelList, navFactory, ResourceLink, Selector, pluralize } from './utils'; -import { configureReplicaCountModal } from './modals'; -import { AlertmanagerModel } from '../models'; - -const Details: React.SFC = (props) => { - const alertManager = props.obj; - const { metadata, spec } = alertManager; - - const openReplicaCountModal = (event) => { - event.preventDefault(); - event.target.blur(); - configureReplicaCountModal({ resourceKind: AlertmanagerModel, resource: alertManager }); - }; - - return ( -
-
- -
-
-
-
Name
-
{metadata.name}
-
Labels
-
- -
- {spec.nodeSelector &&
Alert Manager Node Selector
} - {spec.nodeSelector && ( -
- -
- )} -
-
-
-
-
Version
-
{spec.version}
-
Replicas
-
- -
-
-
-
-
-
- ); -}; - -const { details, editYaml } = navFactory; - -export const AlertManagersDetailsPage = (props) => ( - -); - -const tableColumnClasses = [ - '', - '', - 'pf-m-hidden pf-m-visible-on-md pf-u-w-25-on-md', - 'pf-m-hidden pf-m-visible-on-lg', - 'pf-m-hidden pf-m-visible-on-lg pf-u-w-25-on-lg', -]; - -const AlertManagerTableRow: RowFunction = ({ - obj: alertManager, - index, - key, - style, -}) => { - const { metadata, spec } = alertManager; - return ( - - - - - - - - - - - {spec.version} - - - - - ); -}; - -const AlertManagerTableHeader = () => { - return [ - { - title: 'Name', - sortField: 'metadata.name', - transforms: [sortable], - props: { className: tableColumnClasses[0] }, - }, - { - title: 'Namespace', - sortField: 'metadata.namespace', - transforms: [sortable], - props: { className: tableColumnClasses[1] }, - }, - { - title: 'Labels', - sortField: 'metadata.labels', - transforms: [sortable], - props: { className: tableColumnClasses[2] }, - }, - { - title: 'Version', - sortField: 'spec.version', - transforms: [sortable], - props: { className: tableColumnClasses[3] }, - }, - { - title: 'Node Selector', - sortField: 'spec.nodeSelector', - transforms: [sortable], - props: { className: tableColumnClasses[4] }, - }, - ]; -}; -AlertManagerTableHeader.displayName = 'AlertManagerTableHeader'; - -const AlertManagersList = (props) => ( - -); - -export const AlertManagersPage = (props) => ( - -); - -type DetailsProps = { - obj: K8sResourceKind; -}; diff --git a/frontend/public/components/app-contents.tsx b/frontend/public/components/app-contents.tsx index a0c94f2948e..7acbdb71bf3 100644 --- a/frontend/public/components/app-contents.tsx +++ b/frontend/public/components/app-contents.tsx @@ -16,8 +16,7 @@ import { SearchPage } from './search'; import { ResourceDetailsPage, ResourceListPage } from './resource-list'; import { AsyncComponent, LoadingBox } from './utils'; import { namespacedPrefixes } from './utils/link'; -import { AlertmanagerModel, VolumeSnapshotModel } from '../models'; -import { referenceForModel } from '../module/k8s'; +import { VolumeSnapshotModel } from '../models'; import { NamespaceRedirect } from './utils/namespace-redirect'; //PF4 Imports @@ -243,32 +242,6 @@ const AppContents: React.FC<{}> = () => { /> - - import( - './provisioned-services' /* webpackChunkName: "provisionedservices" */ - ).then((m) => m.ProvisionedServicesPage) - } - /> - - import( - './provisioned-services' /* webpackChunkName: "provisionedservices" */ - ).then((m) => m.ProvisionedServicesPage) - } - /> - - - - import('./broker-management' /* webpackChunkName: "brokermanagment" */).then( - (m) => m.BrokerManagementPage, - ) - } - /> = () => { } /> - ( - - )} - /> - = () => { ) } /> - - import('./monitoring/alerting' /* webpackChunkName: "alerting" */).then( - (m) => m.MonitoringUI, - ) - } - /> - - import('./monitoring/alerting' /* webpackChunkName: "alerting" */).then( - (m) => m.MonitoringUI, - ) - } - /> - - import( - './monitoring/receiver-forms/alert-manager-receiver-forms' /* webpackChunkName: "receiver-forms" */ - ).then((m) => m.CreateReceiver) - } - /> - - import( - './monitoring/receiver-forms/alert-manager-receiver-forms' /* webpackChunkName: "receiver-forms" */ - ).then((m) => m.EditReceiver) - } - /> diff --git a/frontend/public/components/broker-management.tsx b/frontend/public/components/broker-management.tsx deleted file mode 100644 index 3d518e48066..00000000000 --- a/frontend/public/components/broker-management.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import * as React from 'react'; -import { HorizontalNav, PageHeading } from './utils'; -import { ClusterServiceBrokerPage } from './cluster-service-broker'; -import { ClusterServiceClassPage } from './cluster-service-class'; - -const pages = [ - { - href: '', - name: 'Service Brokers', - component: ClusterServiceBrokerPage, - }, - { - href: 'serviceclasses', - name: 'Service Classes', - component: ClusterServiceClassPage, - }, -]; - -export const BrokerManagementPage: React.SFC = ({ match }) => ( - <> - - - -); - -export type BrokerManagementPageProps = { - match: any; -}; diff --git a/frontend/public/components/catalog/catalog-item-icon.tsx b/frontend/public/components/catalog/catalog-item-icon.tsx index b7134e1da1c..e2329860070 100644 --- a/frontend/public/components/catalog/catalog-item-icon.tsx +++ b/frontend/public/components/catalog/catalog-item-icon.tsx @@ -245,43 +245,6 @@ export const getTemplateIcon = (template: TemplateKind | PartialObjectMetadata): return _.get(template, 'metadata.annotations.iconClass'); }; -export const ClusterServiceClassIcon: React.FC = ({ - serviceClass, - iconSize, -}) => { - const { t } = useTranslation(); - const iconClass = getServiceClassIcon(serviceClass); - const imageUrl = getServiceClassImage(serviceClass); - return ( - - {imageUrl ? ( - {t('public~Icon')} - ) : ( - - )} - - ); -}; -ClusterServiceClassIcon.displayName = 'ClusterServiceClassIcon'; - -export type ClusterServiceClassIconProps = { - serviceClass: K8sResourceKind; - iconSize?: string; -}; - export const ImageStreamIcon: React.FC = ({ tag, iconSize }) => { const { t } = useTranslation(); const iconClass = getImageStreamIcon(tag); diff --git a/frontend/public/components/chargeback.tsx b/frontend/public/components/chargeback.tsx deleted file mode 100644 index 20f2006959d..00000000000 --- a/frontend/public/components/chargeback.tsx +++ /dev/null @@ -1,682 +0,0 @@ -import * as React from 'react'; -import * as _ from 'lodash-es'; -import { sortable } from '@patternfly/react-table'; -import { match as RMatch } from 'react-router-dom'; - -import { connectToFlags } from '../reducers/connectToFlags'; -import { FLAGS } from '@console/shared'; -import { Conditions } from './conditions'; -import { DetailsPage, ListPage, Table, TableRow, TableData, RowFunction } from './factory'; -import { coFetchJSON } from '../co-fetch'; -import { ChargebackReportModel, ReportQueryModel } from '../models'; -import { LoadError, LoadingInline, MsgBox } from './utils/status-box'; -import { GroupVersionKind, K8sResourceKind, modelFor, referenceForModel } from '../module/k8s'; -import { - Kebab, - DownloadButton, - LabelList, - NavBar, - navFactory, - PageHeading, - ResourceKebab, - ResourceLink, - ResourceSummary, - SectionHeading, - Timestamp, -} from './utils'; - -export const ReportReference: GroupVersionKind = referenceForModel(ChargebackReportModel); -export const ScheduledReportReference: GroupVersionKind = 'metering.openshift.io~ScheduledReport'; -export const ReportGenerationQueryReference: GroupVersionKind = referenceForModel(ReportQueryModel); - -const reportPages = [ - { name: 'All Reports', href: ReportReference }, - { name: 'Report Queries', href: ReportGenerationQueryReference }, -]; - -const { common } = Kebab.factory; -const menuActions = [...Kebab.getExtensionsActionsForKind(ChargebackReportModel), ...common]; - -const dataURL = (obj: K8sResourceKind, format = 'json') => { - return `${window.SERVER_FLAGS.meteringBaseURL}/api/v2/reports/${obj.metadata.namespace}/${obj.metadata.name}/table?format=${format}`; -}; - -const removeLastPathElement = (path: string) => - path - .split('/') - .slice(0, -1) - .join('/'); - -const ChargebackNavBar: React.SFC<{ match: { url: string; path: string } }> = (props) => ( -
- - -
-); - -const tableColumnClasses = [ - 'pf-u-w-25-on-xl', - '', - 'pf-m-hidden pf-m-visible-on-xl pf-u-w-25-on-xl', - 'pf-m-hidden pf-m-visible-on-lg', - 'pf-m-hidden pf-m-visible-on-lg', - Kebab.columnClass, -]; - -const ReportsTableHeader = () => { - return [ - { - title: 'Name', - sortField: 'metadata.name', - transforms: [sortable], - props: { className: tableColumnClasses[0] }, - }, - { - title: 'Namespace', - sortField: 'metadata.namespace', - transforms: [sortable], - props: { className: tableColumnClasses[1] }, - }, - { - title: 'Report Query', - props: { className: tableColumnClasses[2] }, - }, - { - title: 'Reporting Start', - sortField: 'spec.reportingStart', - transforms: [sortable], - props: { className: tableColumnClasses[3] }, - }, - { - title: 'Reporting End', - sortField: 'spec.reportingEnd', - transforms: [sortable], - props: { className: tableColumnClasses[4] }, - }, - { - title: '', - props: { className: tableColumnClasses[5] }, - }, - ]; -}; -ReportsTableHeader.displayName = 'ReportsTableHeader'; - -const ReportsTableRow: RowFunction = ({ obj, index, key, style }) => { - return ( - - - - - - - - - - - - - - - - - - - - - ); -}; - -class ReportsDetails extends React.Component { - render() { - const { obj } = this.props; - return ( -
-
- -
-
- -
-
-
-
Reporting Start
-
- -
-
Reporting End
-
- -
-
Report Query
-
- -
-
Run Immediately?
-
{Boolean(_.get(obj, ['spec', 'runImmediately'])).toString()}
-
-
-
-
-
- - -
- -
- ); - } -} - -const numericUnits = new Set([ - 'bytes', - 'byte_seconds', - 'cpu_core_seconds', - 'cpu_cores', - 'memory_bytes', - 'memory_byte_seconds', - 'numeric', - 'seconds', -]); - -const DataCell = ({ name, value, unit }: DataTableCellProps) => { - if (numericUnits.has(unit)) { - return
{_.round(value, 2).toLocaleString()}
; - } - if (unit === 'date' || unit === 'time') { - return ; - } - name = _.startCase(name); - const model = modelFor(name); - if (model) { - return ; - } - return value; -}; - -const DataTable = ({ cols, rows, schema }: DataTableProps) => { - const getUnit = (col: string) => { - const colSchema = _.find(schema.values, { name: col }); - return _.get(colSchema, 'unit', _.isFinite(_.get(colSchema, 'value')) ? 'numeric' : null); - }; - - const DataTableHeader = () => - _.map(cols, (col) => { - return { - sortField: col, - title: {col.replace(/_/g, ' ')}, - transforms: [sortable], - }; - }); - - const DataTableRows = ({ componentProps: { data } }: DataTableRowsProps) => - _.map(data, (r) => - _.map(r, (v, c) => { - return { title: }; - }), - ); - - return ( -
- ); -}; - -class ReportData extends React.Component { - constructor(props) { - super(props); - this.state = { - inFlight: false, - error: null, - data: null, - sortBy: null, - orderBy: null, - cols: [], - rows: null, - }; - } - - fetchData() { - this.setState( - { - inFlight: true, - error: null, - // setState is async. Re-render with inFlight = true so that we don't show a "No data" msg while data is loading - }, - () => - coFetchJSON(dataURL(this.props.obj)) - .then((data) => this.makeTable(data)) - .catch((e) => this.setState({ error: e })) - .then(() => this.setState({ inFlight: false })), - ); - } - - componentDidMount() { - this.fetchData(); - } - - UNSAFE_componentWillReceiveProps(nextProps) { - // if request is still inFlight or props haven't changed then return - if (this.state.inFlight || _.isEqual(this.props, nextProps)) { - return; - } - - const conditions = _.get(nextProps.obj, 'status.conditions'); - const isReportFinished = _.some(conditions, { type: 'Running', status: 'False' }); - if (isReportFinished) { - this.fetchData(); - } - } - - makeTable(data = this.state.data) { - if (!data || _.isEmpty(data.results)) { - return; - } - const cols = this.getColumns(data); - const rows = this.getRows(data); - - this.setState({ - data, - cols, - rows, - }); - } - - getColumns(data: { results: any[] }) { - const firstRow = _.head(data.results); - return _.map(firstRow.values, (item) => item.name); - } - - getRows(data: { results: any[] }) { - /* Converts data to rows: - // data = { - // results: [ - // { - // values: [ - // { - // name: "period_start", - // value: "2019-01-01T00:00:00Z", - // unit: "date" - // }, - // { - // name: "pod_usage_cpu_core_seconds", - // value: 235.73856000000004, - // unit: "core_seconds" - // }, - // ... - // ] - // }, - // { - // values: [ - // { - // name: "period_start", - // value: "2019-01-01T00:00:00Z", - // unit: "date" - // }, - // { - // name: "pod_usage_cpu_core_seconds", - // value: 21.864000000000004, - // unit: "core_seconds" - // - // ... to ... - // - // rows = [ - // { - // "period_start": "2019-01-01T00:00:00Z", - // "pod_usage_cpu_core_seconds": 235.73856000000004 - // ... - // }, - // { - // "period_start": "2019-01-01T00:00:00Z", - // "pod_usage_cpu_core_seconds": 21.864000000000004 - // ... - // }, - // ... - */ - const rows = _.map(data.results, ({ values }) => { - return _.reduce( - values, - (acc, { name, value }) => { - acc[name] = value; - return acc; - }, - {}, - ); - }); - - return rows; - } - - render() { - const { obj } = this.props; - const { data, cols, rows, inFlight, error } = this.state; - - let dataElem = ; - if (inFlight) { - dataElem = ( -
-
- -
-
- ); - } else if (error) { - dataElem = ; - } else if (data) { - if (data.error) { - dataElem = ; - } else { - dataElem = ; - } - } - const format = 'csv'; - const downloadURL = dataURL(obj, format); - - return ( -
- - - {dataElem} -
- ); - } -} - -const reportsPages = [navFactory.details(ReportsDetails), navFactory.editYaml()]; - -const EmptyMsg = () => ( - -); - -export const ReportsList: React.SFC = (props) => ( -
-); - -const ReportsPage_: React.SFC = (props) => { - return ( -
- - -
- ); -}; - -export const ReportsPage = connectToFlags(FLAGS.CHARGEBACK)(ReportsPage_); - -export const ReportsDetailsPage: React.SFC = (props) => { - return ( - - ); -}; - -const reportsGenerationColumnClasses = [ - '', - '', - 'pf-m-hidden pf-visible-on-lg', - '', - Kebab.columnClass, -]; - -const ReportGenerationQueriesTableHeader = () => { - return [ - { - title: 'Name', - sortField: 'metadata.name', - transforms: [sortable], - props: { className: reportsGenerationColumnClasses[0] }, - }, - { - title: 'Namespace', - sortField: 'metadata.namespace', - transforms: [sortable], - props: { className: reportsGenerationColumnClasses[1] }, - }, - { - title: 'Labels', - props: { className: reportsGenerationColumnClasses[2] }, - }, - { - title: 'Created', - sortField: 'metadata.creationTimestamp', - transforms: [sortable], - props: { className: reportsGenerationColumnClasses[3] }, - }, - { - title: '', - props: { className: reportsGenerationColumnClasses[4] }, - }, - ]; -}; -ReportGenerationQueriesTableHeader.displayName = 'ReportGenerationQueriesTableHeader'; - -const ReportGenerationQueriesTableRow: RowFunction = ({ - obj, - index, - key, - style, -}) => { - return ( - - - - - - - - - - - - - - - - - - ); -}; - -const ReportGenerationQueriesDetails: React.SFC = ({ - obj, -}) => { - const columns = _.get(obj, ['spec', 'columns'], []).map((column, i) => ( -
- - - - )); - - return ( -
-
- - -
Query
-
-
-              {_.get(obj, ['spec', 'query'])}
-            
-
-
-
-

Columns

-
-
{column.name}{column.type}
- - - - - - - {columns} -
ColumnType
- - - - - - - ); -}; - -export const ReportGenerationQueriesList: React.SFC = (props) => ( - -); - -export const ReportGenerationQueriesPage: React.SFC = (props) => ( -
- - -
-); - -const reportGenerationQueryPages = [ - navFactory.details(ReportGenerationQueriesDetails), - navFactory.editYaml(), -]; -export const ReportGenerationQueriesDetailsPage: React.SFC = ( - props, -) => { - return ( - - ); -}; - -export type ReportsDetailsProps = { - obj: any; -}; - -export type ReportDataProps = { - obj: any; -}; -export type ReportDataState = { - error: any; - data: any; - inFlight: boolean; - sortBy: string; - orderBy: string; - cols: string[]; - rows: any[]; -}; - -export type DataTableProps = { - rows: any[]; - cols: string[]; - schema: any; -}; - -export type DataTableCellProps = { - name: string; - value: any; - unit: string; -}; - -export type DataTableRowsProps = { - componentProps: { data: any[] }; -}; - -export type ReportsPageProps = { - filterLabel: string; - flags: { [_: string]: boolean }; - match: RMatch<{ - url: string; - path: string; - }>; -}; - -export type ReportsDetailsPageProps = { - match: any; -}; - -export type ReportGenerationQueriesRowProps = { - obj: any; -}; - -export type ReportGenerationQueriesDetailsProps = { - obj: any; -}; - -export type ReportGenerationQueriesPageProps = { - filterLabel: string; - match: RMatch<{ - url: string; - path: string; - }>; -}; - -export type ReportGenerationQueriesDetailsPageProps = { - match: any; -}; - -ReportsList.displayName = 'ReportsList'; -ReportsPage.displayName = 'ReportsPage'; -ReportsDetailsPage.displayName = 'ReportsDetailsPage'; - -ReportGenerationQueriesDetails.displayName = 'ReportGenerationQueriesDetails'; -ReportGenerationQueriesList.displayName = 'ReportGenerationQueriesList'; -ReportGenerationQueriesPage.displayName = 'ReportGenerationQueriesPage'; -ReportGenerationQueriesDetailsPage.displayName = 'ReportGenerationQueriesDetailsPage'; diff --git a/frontend/public/components/cluster-service-broker.tsx b/frontend/public/components/cluster-service-broker.tsx deleted file mode 100644 index 39ed080febe..00000000000 --- a/frontend/public/components/cluster-service-broker.tsx +++ /dev/null @@ -1,200 +0,0 @@ -import * as React from 'react'; -import * as classNames from 'classnames'; -import { sortable } from '@patternfly/react-table'; -import { DetailsPage, ListPage, Table, TableRow, TableData, RowFunction } from './factory'; -import { - Kebab, - SectionHeading, - detailsPage, - navFactory, - ResourceLink, - ResourceKebab, - ResourceSummary, - StatusWithIcon, - Timestamp, - ExternalLink, -} from './utils'; -import { K8sResourceKind, referenceForModel } from '../module/k8s'; -import { ClusterServiceBrokerModel } from '../models'; -import { Conditions } from './conditions'; -import { ClusterServiceClassPage } from './cluster-service-class'; - -const menuActions = [ - ...Kebab.getExtensionsActionsForKind(ClusterServiceBrokerModel), - ...Kebab.factory.common, -]; - -const tableColumnClasses = [ - '', - '', - 'pf-m-hidden pf-m-visible-on-md', - 'pf-m-hidden pf-m-visible-on-md', - Kebab.columnClass, -]; - -const ClusterServiceBrokerTableHeader = () => { - return [ - { - title: 'Name', - sortField: 'metadata.name', - transforms: [sortable], - props: { className: tableColumnClasses[0] }, - }, - { - title: 'Status', - sortFunc: 'serviceCatalogStatus', - transforms: [sortable], - props: { className: tableColumnClasses[1] }, - }, - { - title: 'Relist Behavior', - sortField: 'spec.relistBehavior', - transforms: [sortable], - props: { className: tableColumnClasses[2] }, - }, - { - title: 'Last Retrieved', - sortField: 'status.lastCatalogRetrievalTime', - transforms: [sortable], - props: { className: tableColumnClasses[3] }, - }, - { - title: '', - props: { className: tableColumnClasses[4] }, - }, - ]; -}; -ClusterServiceBrokerTableHeader.displayName = 'ClusterServiceBrokerTableHeader'; - -const ClusterServiceBrokerTableRow: RowFunction = ({ - obj: serviceBroker, - index, - key, - style, -}) => { - return ( - - - - - - - - {serviceBroker.spec.relistBehavior} - - - - - - - - ); -}; - -const ClusterServiceBrokerDetails: React.SFC = ({ - obj: serviceBroker, -}) => { - return ( - <> -
- -
-
- -
Last Catalog Retrieval Time
-
- -
- {serviceBroker.spec.insecureSkipTLSVerify &&
Insecure Skip TLS Verify
} - {serviceBroker.spec.insecureSkipTLSVerify && ( -
{serviceBroker.spec.insecureSkipTLSVerify}
- )} -
-
-
-
Status
-
- -
-
Broker URL
-
- -
-
Relist Behavior
-
{serviceBroker.spec.relistBehavior}
- {serviceBroker.spec.relistBehavior === 'Duration' && ( - <> -
Relist Duration
-
{serviceBroker.spec.relistDuration || '-'}
- - )} -
-
-
-
-
- - -
- - ); -}; - -const ServiceClassTabPage = ({ obj }) => ( - -); -export const ClusterServiceBrokerDetailsPage: React.SFC = ( - props, -) => ( - -); -export const ClusterServiceBrokerList: React.SFC = (props) => ( -
-); - -export const ClusterServiceBrokerPage: React.SFC = (props) => ( - -); - -export type ClusterServiceBrokerPageProps = { - obj: K8sResourceKind; -}; - -export type ClusterServiceBrokerDetailsProps = { - obj: K8sResourceKind; -}; - -export type ClusterServiceBrokerDetailsPageProps = { - match: any; -}; diff --git a/frontend/public/components/cluster-service-class-info.tsx b/frontend/public/components/cluster-service-class-info.tsx deleted file mode 100644 index 7c30ac95aac..00000000000 --- a/frontend/public/components/cluster-service-class-info.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import * as React from 'react'; -import * as _ from 'lodash-es'; - -import { K8sResourceKind, serviceClassDisplayName } from '../module/k8s'; -import { ClusterServiceClassIcon } from './catalog/catalog-item-icon'; -import { ExternalLink } from './utils'; - -export const ClusterServiceClassInfo: React.FC = ({ - obj: serviceClass, -}) => { - const displayName = serviceClassDisplayName(serviceClass); - const description = _.get(serviceClass, 'spec.description'); - const longDescription = _.get(serviceClass, 'spec.externalMetadata.longDescription'); - const documentationURL = _.get(serviceClass, 'spec.externalMetadata.documentationUrl'); - const supportURL = _.get(serviceClass, 'spec.externalMetadata.supportUrl'); - const provider = _.get(serviceClass, 'spec.externalMetadata.providerDisplayName'); - const tags = _.get(serviceClass, 'spec.tags'); - - return ( -
-
- -
-

{displayName}

- {provider &&

Provided by {provider}

} - {tags && ( -

- {_.map(tags, (tag, i) => ( - - {tag} - - ))} -

- )} - {(documentationURL || supportURL) && ( -
    - {documentationURL && ( -
  • - -
  • - )} - {supportURL && ( -
  • - -
  • - )} -
- )} -
-
- {description &&

{description}

} - {longDescription &&

{longDescription}

} -
- ); -}; - -export type ClusterServiceClassInfoProps = { - obj: K8sResourceKind; -}; diff --git a/frontend/public/components/cluster-service-class.tsx b/frontend/public/components/cluster-service-class.tsx deleted file mode 100644 index 226afc7c412..00000000000 --- a/frontend/public/components/cluster-service-class.tsx +++ /dev/null @@ -1,179 +0,0 @@ -import * as React from 'react'; -import { Link } from 'react-router-dom'; -import * as _ from 'lodash-es'; -import * as classNames from 'classnames'; -import { sortable } from '@patternfly/react-table'; -import { DetailsPage, ListPage, Table, TableRow, TableData, RowFunction } from './factory'; -import { - history, - SectionHeading, - detailsPage, - navFactory, - ResourceSummary, - resourcePathFromModel, - ResourceLink, -} from './utils'; -import { viewYamlComponent } from './utils/horizontal-nav'; -import { ClusterServiceClassModel, ClusterServiceBrokerModel } from '../models'; -import { K8sResourceKind, referenceForModel, serviceClassDisplayName } from '../module/k8s'; -import { ClusterServiceClassIcon } from './catalog/catalog-item-icon'; -import { ClusterServicePlanPage } from './cluster-service-plan'; -import { ClusterServiceClassInfo } from './cluster-service-class-info'; - -const createInstance = (kindObj, serviceClass) => { - if (!_.get(serviceClass, 'status.removedFromBrokerCatalog')) { - return { - btnClass: 'pf-c-button pf-m-primary', - callback: () => { - history.push( - `/catalog/create-service-instance?cluster-service-class=${serviceClass.metadata.name}`, - ); - }, - label: 'Create Instance', - }; - } -}; - -const actionButtons = [createInstance]; - -const tableColumnClasses = [ - 'pf-u-w-50-on-md', - 'pf-m-hidden pf-m-visible-on-md', - 'pf-m-hidden pf-m-visible-on-md', -]; - -const ClusterServiceClassTableHeader = () => { - return [ - { - title: 'Display Name', - sortFunc: 'serviceClassDisplayName', - transforms: [sortable], - props: { className: tableColumnClasses[0] }, - }, - { - title: 'External Name', - sortField: 'spec.externalName', - transforms: [sortable], - props: { className: tableColumnClasses[1] }, - }, - { - title: 'Broker', - sortField: 'spec.clusterServiceBrokerName', - transforms: [sortable], - props: { className: tableColumnClasses[2] }, - }, - ]; -}; -ClusterServiceClassTableHeader.displayName = 'ClusterServiceClassTableHeader'; - -const ClusterServiceClassTableRow: RowFunction = ({ - obj: serviceClass, - index, - key, - style, -}) => { - const path = resourcePathFromModel(ClusterServiceClassModel, serviceClass.metadata.name); - return ( - - - - - {serviceClassDisplayName(serviceClass)} - - - {serviceClass.spec.externalName} - - - - - ); -}; - -const ClusterServiceClassDetails: React.FC = ({ - obj: serviceClass, -}) => ( -
-
-
- -
-
- - -
External Name
-
{serviceClass.spec.externalName || '-'}
-
- {serviceClass.status.removedFromBrokerCatalog && ( - <> -
Removed From Catalog
-
{serviceClass.status.removedFromBrokerCatalog}
- - )} -
-
-
-); - -const ClusterServicePlanTab: React.FC<{ obj: K8sResourceKind }> = ({ obj }) => { - return ( - - ); -}; - -export const ClusterServiceClassDetailsPage: React.FC = ( - props, -) => ( - -); - -export const ClusterServiceClassList: React.FC = (props) => ( -
-); - -export const ClusterServiceClassPage: React.FC = (props) => ( - -); - -export type ClusterServiceClassPageProps = { - showTitle?: boolean; - fieldSelector?: string; -}; - -export type ClusterServiceClassDetailsProps = { - obj: K8sResourceKind; -}; - -export type ClusterServiceClassDetailsPageProps = { - match: any; - name: string; -}; diff --git a/frontend/public/components/cluster-service-plan.tsx b/frontend/public/components/cluster-service-plan.tsx index 13dc9f52174..a522c542952 100644 --- a/frontend/public/components/cluster-service-plan.tsx +++ b/frontend/public/components/cluster-service-plan.tsx @@ -1,14 +1,9 @@ import * as React from 'react'; -import * as classNames from 'classnames'; import { sortable } from '@patternfly/react-table'; import { DetailsPage, ListPage, Table, TableRow, TableData, RowFunction } from './factory'; import { SectionHeading, detailsPage, navFactory, ResourceLink, ResourceSummary } from './utils'; import { K8sResourceKind, referenceForModel, servicePlanDisplayName } from '../module/k8s'; -import { - ClusterServicePlanModel, - ClusterServiceBrokerModel, - ClusterServiceClassModel, -} from '../models'; +import { ClusterServicePlanModel } from '../models'; import { viewYamlComponent } from './utils/horizontal-nav'; const tableColumnClasses = ['', '', 'pf-m-hidden pf-m-visible-on-md']; @@ -27,12 +22,6 @@ const ClusterServicePlanTableHeader = () => { transforms: [sortable], props: { className: tableColumnClasses[1] }, }, - { - title: 'Broker', - sortField: 'spec.clusterServiceBrokerName', - transforms: [sortable], - props: { className: tableColumnClasses[2] }, - }, ]; }; ClusterServicePlanTableHeader.displayName = 'ClusterServicePlanTableHeader'; @@ -53,13 +42,6 @@ const ClusterServicePlanTableRow: RowFunction = ({ /> {servicePlan.spec.externalName} - - - ); }; @@ -78,20 +60,6 @@ const ClusterServicePlanDetails: React.SFC = ({
Description
{servicePlan.spec.description}
-
Broker
-
- -
-
Service Class
-
- -
{servicePlan.status.removedFromBrokerCatalog && ( <>
Removed From Catalog
diff --git a/frontend/public/components/factory/table-filters.ts b/frontend/public/components/factory/table-filters.ts index 75fdbac4ad9..f9b21b798a2 100644 --- a/frontend/public/components/factory/table-filters.ts +++ b/frontend/public/components/factory/table-filters.ts @@ -29,9 +29,6 @@ import { Alert, Rule, Silence } from '../monitoring/types'; export const fuzzyCaseInsensitive = (a: string, b: string): boolean => fuzzy(_.toLower(a), _.toLower(b)); -const clusterServiceVersionDisplayName = (csv: K8sResourceKind): string => - csv?.spec?.displayName || csv?.metadata?.name; - // TODO: Table filters are undocumented, stringly-typed, and non-obvious. We can change that. export const tableFilters: TableFilterMap = { name: (filter, obj) => fuzzyCaseInsensitive(filter, obj.metadata.name), @@ -146,13 +143,6 @@ export const tableFilters: TableFilterMap = { return roles.selected.has(role); }, - 'clusterserviceversion-resource-kind': (filters, resource) => { - if (!filters || !filters.selected || !filters.selected.size) { - return true; - } - return filters.selected.has(resource.kind); - }, - 'packagemanifest-name': (filter, pkg) => fuzzyCaseInsensitive( filter, @@ -270,12 +260,6 @@ export const tableFilters: TableFilterMap = { 'image-name': (str, imageManifestVuln) => fuzzyCaseInsensitive(str, imageManifestVuln.spec.image), vulnerability: (str, imageVulnerability) => fuzzyCaseInsensitive(str, imageVulnerability.vulnerability.name), - - // Filter cluster service version by displayName or name text match - 'cluster-service-version': (str, csv) => { - const value = clusterServiceVersionDisplayName(csv); - return fuzzyCaseInsensitive(str, value); - }, }; export interface TableFilterGroups { diff --git a/frontend/public/components/nav/admin-nav.tsx b/frontend/public/components/nav/admin-nav.tsx index 1e728ecf15d..00b9c9aa627 100644 --- a/frontend/public/components/nav/admin-nav.tsx +++ b/frontend/public/components/nav/admin-nav.tsx @@ -9,7 +9,6 @@ import { featureReducerName } from '../../reducers/features'; import { ALL_NAMESPACES_KEY } from '@console/shared/src/constants/common'; import { - ChargebackReportModel, GroupModel, MachineAutoscalerModel, MachineConfigModel, @@ -38,8 +37,6 @@ const Separator: React.FC = ({ name, id }) => ( ); const searchStartsWith = ['search']; -const provisionedServicesStartsWith = ['serviceinstances', 'servicebindings']; -const brokerManagementStartsWith = ['clusterservicebrokers', 'clusterserviceclasses']; const rolesStartsWith = ['roles', 'clusterroles']; const rolebindingsStartsWith = ['rolebindings', 'clusterrolebindings']; const quotaStartsWith = ['resourcequotas', 'clusterresourcequotas']; @@ -56,7 +53,6 @@ const clusterSettingsStartsWith = [ 'monitoring/alertmanagerconfig', 'monitoring/alertmanageryaml', ]; -const meteringStartsWith = ['metering.openshift.io']; const apiExplorerStartsWith = ['api-explorer', 'api-resource']; const monitoringNavSectionStateToProps = (state) => ({ @@ -248,29 +244,6 @@ const AdminNav = () => { data-quickstart-id="qs-nav-pipelines" /> - - - - - { startsWith={quotaStartsWith} /> - { - const { metadata, spec } = instance; - return ( - - - - - - - - - - - {spec.version} - - - - - - - - ); -}; - -const PrometheusTableHeader = () => { - return [ - { - title: 'Name', - sortField: 'metadata.name', - transforms: [sortable], - props: { className: tableColumnClasses[0] }, - }, - { - title: 'Namespace', - sortField: 'metadata.namespace', - transforms: [sortable], - props: { className: tableColumnClasses[1] }, - }, - { - title: 'Labels', - sortField: 'metadata.labels', - transforms: [sortable], - props: { className: tableColumnClasses[2] }, - }, - { - title: 'Version', - sortField: 'spec.version', - transforms: [sortable], - props: { className: tableColumnClasses[3] }, - }, - { - title: 'Service Monitor Selector', - sortField: 'spec.serviceMonitorSelector', - transforms: [sortable], - props: { className: tableColumnClasses[4] }, - }, - { - title: '', - props: { className: tableColumnClasses[5] }, - }, - ]; -}; -PrometheusTableHeader.displayName = 'PrometheusTableHeader'; - -const PrometheusInstancesList = (props) => ( -
-); - -export const PrometheusInstancesPage = (props) => ( - -); diff --git a/frontend/public/components/provisioned-services.tsx b/frontend/public/components/provisioned-services.tsx deleted file mode 100644 index 9b99bfbe18c..00000000000 --- a/frontend/public/components/provisioned-services.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import * as React from 'react'; -import { HorizontalNav, PageHeading } from './utils'; -import { ServiceInstancesPage } from './service-instance'; -import { ServiceBindingsPage } from './service-binding'; - -const pages = [ - { - href: '', - name: 'Service Instances', - component: ServiceInstancesPage, - }, - { - href: 'servicebindings', - name: 'Service Bindings', - component: ServiceBindingsPage, - }, -]; - -export const ProvisionedServicesPage: React.SFC = ({ match }) => ( - <> - - - -); - -export type ProvisionedServicesPageProps = { - match: any; -}; diff --git a/frontend/public/components/resource-pages.ts b/frontend/public/components/resource-pages.ts index 4ef351504b7..4fb5514f46c 100644 --- a/frontend/public/components/resource-pages.ts +++ b/frontend/public/components/resource-pages.ts @@ -4,16 +4,12 @@ import { ResourceDetailsPage as DynamicResourceDetailsPage, ResourceListPage as DynamicResourceListPage, } from '@console/dynamic-plugin-sdk'; -import { ReportReference, ReportGenerationQueryReference } from './chargeback'; import { referenceForModel, GroupVersionKind, referenceForExtensionModel } from '../module/k8s'; import { - AlertmanagerModel, BuildConfigModel, BuildModel, ClusterOperatorModel, ClusterRoleModel, - ClusterServiceBrokerModel, - ClusterServiceClassModel, ClusterServicePlanModel, ClusterVersionModel, ConfigMapModel, @@ -45,7 +41,6 @@ import { PersistentVolumeModel, PodModel, ProjectModel, - PrometheusModel, ReplicaSetModel, ReplicationControllerModel, ResourceQuotaModel, @@ -54,8 +49,6 @@ import { RouteModel, SecretModel, ServiceAccountModel, - ServiceBindingModel, - ServiceInstanceModel, ServiceModel, ServiceMonitorModel, StatefulSetModel, @@ -94,16 +87,6 @@ type ResourceMapValue = () => Promise>; type DynamicResourcePage = DynamicResourceListPage | DynamicResourceDetailsPage; export const baseDetailsPages = ImmutableMap() - .set(referenceForModel(ClusterServiceClassModel), () => - import('./cluster-service-class' /* webpackChunkName: "cluster-service-class" */).then( - (m) => m.ClusterServiceClassDetailsPage, - ), - ) - .set(referenceForModel(ClusterServiceBrokerModel), () => - import('./cluster-service-broker' /* webpackChunkName: "cluster-service-broker" */).then( - (m) => m.ClusterServiceBrokerDetailsPage, - ), - ) .set(referenceForModel(ClusterServicePlanModel), () => import('./cluster-service-plan' /* webpackChunkName: "cluster-service-plan" */).then( (m) => m.ClusterServicePlanDetailsPage, @@ -219,16 +202,6 @@ export const baseDetailsPages = ImmutableMap() (m) => m.ServiceAccountsDetailsPage, ), ) - .set(referenceForModel(ServiceInstanceModel), () => - import('./service-instance' /* webpackChunkName: "service-instance" */).then( - (m) => m.ServiceInstanceDetailsPage, - ), - ) - .set(referenceForModel(ServiceBindingModel), () => - import('./service-binding' /* webpackChunkName: "service-binding" */).then( - (m) => m.ServiceBindingDetailsPage, - ), - ) .set(referenceForModel(ServiceModel), () => import('./service' /* webpackChunkName: "service" */).then((m) => m.ServicesDetailsPage), ) @@ -255,11 +228,6 @@ export const baseDetailsPages = ImmutableMap() .set(referenceForModel(GroupModel), () => import('./group' /* webpackChunkName: "group" */).then((m) => m.GroupDetailsPage), ) - .set(referenceForModel(AlertmanagerModel), () => - import('./alert-manager' /* webpackChunkName: "alert-manager" */).then( - (m) => m.AlertManagersDetailsPage, - ), - ) .set(referenceForModel(StatefulSetModel), () => import('./stateful-set' /* webpackChunkName: "stateful-set" */).then( (m) => m.StatefulSetsDetailsPage, @@ -295,14 +263,6 @@ export const baseDetailsPages = ImmutableMap() (m) => m.PersistentVolumeClaimsDetailsPage, ), ) - .set(ReportReference, () => - import('./chargeback' /* webpackChunkName: "chargeback" */).then((m) => m.ReportsDetailsPage), - ) - .set(ReportGenerationQueryReference, () => - import('./chargeback' /* webpackChunkName: "chargeback" */).then( - (m) => m.ReportGenerationQueriesDetailsPage, - ), - ) .set(referenceForModel(StorageClassModel), () => import('./storage-class' /* webpackChunkName: "storage-class" */).then( (m) => m.StorageClassDetailsPage, @@ -360,16 +320,6 @@ export const getResourceDetailsPages = ( }); export const baseListPages = ImmutableMap() - .set(referenceForModel(ClusterServiceClassModel), () => - import('./cluster-service-class' /* webpackChunkName: "cluster-service-class" */).then( - (m) => m.ClusterServiceClassPage, - ), - ) - .set(referenceForModel(ClusterServiceBrokerModel), () => - import('./cluster-service-broker' /* webpackChunkName: "cluster-service-broker" */).then( - (m) => m.ClusterServiceBrokerPage, - ), - ) .set(referenceForModel(ClusterServicePlanModel), () => import('./cluster-service-plan' /* webpackChunkName: "cluster-service-plan" */).then( (m) => m.ClusterServicePlanPage, @@ -465,16 +415,6 @@ export const baseListPages = ImmutableMap() (m) => m.ServiceAccountsPage, ), ) - .set(referenceForModel(ServiceInstanceModel), () => - import('./service-instance' /* webpackChunkName: "service-instance" */).then( - (m) => m.ServiceInstancesPage, - ), - ) - .set(referenceForModel(ServiceBindingModel), () => - import('./service-binding' /* webpackChunkName: "service-binding" */).then( - (m) => m.ServiceBindingsPage, - ), - ) .set(referenceForModel(ServiceModel), () => import('./service' /* webpackChunkName: "service" */).then((m) => m.ServicesPage), ) @@ -496,21 +436,11 @@ export const baseListPages = ImmutableMap() .set(referenceForModel(GroupModel), () => import('./group' /* webpackChunkName: "group" */).then((m) => m.GroupPage), ) - .set(referenceForModel(PrometheusModel), () => - import('./prometheus' /* webpackChunkName: "prometheus" */).then( - (m) => m.PrometheusInstancesPage, - ), - ) .set(referenceForModel(ServiceMonitorModel), () => import('./service-monitor' /* webpackChunkName: "service-monitor" */).then( (m) => m.ServiceMonitorsPage, ), ) - .set(referenceForModel(AlertmanagerModel), () => - import('./alert-manager' /* webpackChunkName: "alert-manager" */).then( - (m) => m.AlertManagersPage, - ), - ) .set(referenceForModel(StatefulSetModel), () => import('./stateful-set' /* webpackChunkName: "stateful-set" */).then((m) => m.StatefulSetsPage), ) @@ -535,14 +465,6 @@ export const baseListPages = ImmutableMap() (m) => m.PersistentVolumeClaimsPage, ), ) - .set(ReportReference, () => - import('./chargeback' /* webpackChunkName: "chargeback" */).then((m) => m.ReportsPage), - ) - .set(ReportGenerationQueryReference, () => - import('./chargeback' /* webpackChunkName: "chargeback" */).then( - (m) => m.ReportGenerationQueriesPage, - ), - ) .set(referenceForModel(StorageClassModel), () => import('./storage-class' /* webpackChunkName: "storage-class" */).then( (m) => m.StorageClassPage, diff --git a/frontend/public/components/service-binding.tsx b/frontend/public/components/service-binding.tsx deleted file mode 100644 index 6ca471e96ec..00000000000 --- a/frontend/public/components/service-binding.tsx +++ /dev/null @@ -1,242 +0,0 @@ -import * as React from 'react'; -import * as _ from 'lodash-es'; -import { match } from 'react-router-dom'; -import { sortable } from '@patternfly/react-table'; -import * as classNames from 'classnames'; -import { Alert } from '@patternfly/react-core'; - -import { serviceCatalogStatus, referenceForModel, K8sResourceKind } from '../module/k8s'; -import { DetailsPage, ListPage, Table, TableRow, TableData, RowFunction } from './factory'; -import { Kebab, ResourceKebab } from './utils/kebab'; -import { SectionHeading } from './utils/headings'; -import { navFactory } from './utils/horizontal-nav'; -import { ResourceLink } from './utils/resource-link'; -import { ResourceSummary } from './utils/details-page'; -import { StatusWithIcon } from './utils/service-catalog-status'; -import { ResourceEventStream } from './events'; -import { Conditions } from './conditions'; -import { - ServiceCatalogParameters, - ServiceCatalogParametersSecrets, -} from './service-catalog-parameters'; -import { ServiceBindingDescription } from './service-instance'; -import { addSecretToWorkload } from './secret'; -import { ServiceBindingModel, ServiceInstanceModel } from '../models'; - -const actionButtons = [addSecretToWorkload]; - -const { common } = Kebab.factory; -const menuActions = [...Kebab.getExtensionsActionsForKind(ServiceBindingModel), ...common]; - -const secretLink = (obj) => - serviceCatalogStatus(obj) === 'Ready' ? ( - - ) : ( - '-' - ); - -const ServiceBindingDetails: React.SFC = ({ obj: sb }) => { - const sbParameters = _.get(sb, 'status.externalProperties.parameters', {}); - const notReady = serviceCatalogStatus(sb) === 'Not Ready' ? true : false; - - return ( - <> -
- {notReady && ( - - Once it is ready, bind its secret to a workload. - - )} - - -
-
- -
-
-
-
Service Instance
-
- -
-
Secret
-
{secretLink(sb)}
-
Status
-
- -
-
-
-
-
-
- - -
- {!_.isEmpty(sb.spec.parametersFrom) && } - {!_.isEmpty(sbParameters) && } - - ); -}; - -const pages = [ - navFactory.details(ServiceBindingDetails), - navFactory.editYaml(), - navFactory.events(ResourceEventStream), -]; -export const ServiceBindingDetailsPage: React.SFC = (props) => ( - -); -ServiceBindingDetailsPage.displayName = 'ServiceBindingDetailsPage'; - -const tableColumnClasses = [ - '', - '', - classNames('pf-m-hidden', 'pf-m-visible-on-sm'), - classNames('pf-m-hidden', 'pf-m-visible-on-lg'), - classNames('pf-m-hidden', 'pf-m-visible-on-xl'), - Kebab.columnClass, -]; - -const ServiceBindingsTableHeader = () => { - return [ - { - title: 'Name', - sortField: 'metadata.name', - transforms: [sortable], - props: { className: tableColumnClasses[0] }, - }, - { - title: 'Namespace', - sortField: 'metadata.namespace', - transforms: [sortable], - props: { className: tableColumnClasses[1] }, - }, - { - title: 'Status', - sortFunc: 'serviceCatalogStatus', - transforms: [sortable], - props: { className: tableColumnClasses[2] }, - }, - { - title: 'Service Instance', - sortField: 'spec.instanceRef.name', - transforms: [sortable], - props: { className: tableColumnClasses[3] }, - }, - { - title: 'Secret', - sortField: 'spec.secretName', - transforms: [sortable], - props: { className: tableColumnClasses[4] }, - }, - { - title: '', - props: { className: tableColumnClasses[5] }, - }, - ]; -}; -ServiceBindingsTableHeader.displayName = 'ServiceBindingsTableHeader'; - -const ServiceBindingsTableRow: RowFunction = ({ obj, index, key, style }) => { - return ( - - - - - - - - - - - - - - - {secretLink(obj)} - - - - - - ); -}; - -const ServiceBindingsList: React.SFC = (props) => ( -
-); -ServiceBindingsList.displayName = 'ServiceBindingsList'; - -export const ServiceBindingsPage: React.SFC = (props) => ( - -); - -export type ServiceBindingDetailsProps = { - obj: K8sResourceKind; -}; - -export type ServiceBindingsPageProps = { - autoFocus?: boolean; - canCreate?: boolean; - createHandler?: any; - filters?: any; - namespace?: string; - match?: match<{ ns?: string }>; - selector?: any; - showTitle?: boolean; -}; - -export type ServiceBindingDetailsPageProps = { - match: any; -}; - -ServiceBindingsPage.displayName = 'ServiceBindingsListPage'; diff --git a/frontend/public/components/service-instance.tsx b/frontend/public/components/service-instance.tsx deleted file mode 100644 index bb874bd36ca..00000000000 --- a/frontend/public/components/service-instance.tsx +++ /dev/null @@ -1,417 +0,0 @@ -import * as React from 'react'; -import * as _ from 'lodash-es'; -import { Link, withRouter, RouteComponentProps, match } from 'react-router-dom'; -import { sortable } from '@patternfly/react-table'; -import * as classNames from 'classnames'; -import { Alert, Button } from '@patternfly/react-core'; - -import { - k8sList, - K8sResourceKind, - planExternalName, - serviceCatalogStatus, - referenceForModel, -} from '../module/k8s'; -import { DetailsPage, ListPage, Table, TableRow, TableData, RowFunction } from './factory'; -import { ExternalLink } from './utils/link'; -import { Kebab, ResourceKebab } from './utils/kebab'; -import { ResourceIcon } from './utils/resource-icon'; -import { ResourceLink } from './utils/resource-link'; -import { ResourceSummary } from './utils/details-page'; -import { SectionHeading } from './utils/headings'; -import { StatusWithIcon } from './utils/service-catalog-status'; -import { Timestamp } from './utils/timestamp'; -import { history } from './utils/router'; -import { navFactory } from './utils/horizontal-nav'; -import { HintBlock } from './utils/hint-block'; -import { ResourceEventStream } from './events'; -import { Conditions } from './conditions'; -import { - ServiceCatalogParameters, - ServiceCatalogParametersSecrets, -} from './service-catalog-parameters'; -import { ServiceBindingsPage } from './service-binding'; -import { ServiceBindingModel, ServiceInstanceModel, ClusterServiceClassModel } from '../models'; - -const goToCreateBindingPage = (serviceInstance: K8sResourceKind) => { - history.push( - `/k8s/ns/${serviceInstance.metadata.namespace}/serviceinstances/${serviceInstance.metadata.name}/create-binding`, - ); -}; - -const createBinding = (kindObj, serviceInstance) => { - return { - callback: () => goToCreateBindingPage(serviceInstance), - label: 'Create Service Binding', - accessReview: { - group: ServiceBindingModel.apiGroup, - resource: ServiceBindingModel.plural, - namespace: serviceInstance.metadata.namespace, - verb: 'create', - }, - }; -}; - -const { common } = Kebab.factory; - -const menuActions = [ - createBinding, - ...Kebab.getExtensionsActionsForKind(ServiceInstanceModel), - ...common, -]; - -export const ServiceBindingDescription: React.SFC = ({ - instanceName, - className, -}) => ( -

- Service bindings create a secret containing the necessary information for a workload to use{' '} - - {instanceName}. Once the binding is ready, add the secret to your workload's environment - variables or volumes. -

-); - -class ServiceInstanceMessage_ extends React.Component< - ServiceInstanceMessageProps & RouteComponentProps<{}>, - ServiceInstanceMessageState -> { - state = { - hasBindings: false, - loaded: false, - }; - - componentDidMount() { - const { obj } = this.props; - - // Get the bindings for this service instance to know what messages to display. - k8sList(ServiceBindingModel, { ns: obj.metadata.namespace }).then((serviceBindings) => { - const hasBindings = _.some(serviceBindings, { - spec: { instanceRef: { name: obj.metadata.name } }, - }); - this.setState({ loaded: true, hasBindings }); - }); - } - - createBinding = () => { - const { obj } = this.props; - goToCreateBindingPage(obj); - }; - - render() { - const { - obj, - match: { url }, - } = this.props; - const { deletionTimestamp } = obj.metadata; - const { loaded, hasBindings } = this.state; - - if (!loaded) { - return null; - } - - // Warn when the instance is deleted, but is still has bindings. - if (deletionTimestamp && hasBindings) { - const basePath = url.replace(/\/$/, ''); - return ( - - This service instance is marked for deletion, but still has bindings. You must delete the - bindings before the instance will be deleted.{' '} - View service bindings - - ); - } - - // Show help for creating a binding when there are none for this instance. - // TODO: Check if the plan is actually bindable. - if (!deletionTimestamp && !hasBindings) { - return ( -
- - - - -
- ); - } - - return null; - } -} -const ServiceInstanceMessage = withRouter(ServiceInstanceMessage_); - -const ServiceInstanceDetails: React.SFC = ({ obj: si }) => { - const plan = planExternalName(si); - const parameters = _.get(si, 'status.externalProperties.parameters', {}); - const classDisplayName = - si.spec.clusterServiceClassExternalName || si.spec.serviceClassExternalName; - const clusterServiceClassName = _.get(si, 'spec.clusterServiceClassRef.name'); - const dashboardURL = _.get(si, 'status.dashboardURL'); - - return ( - <> - -
- -
-
- -
-
-
-
Service Class
-
- {clusterServiceClassName ? ( - - ) : ( - classDisplayName - )} -
-
Status
-
- -
-
Plan
-
{plan || '-'}
- {dashboardURL && ( - <> -
Dashboard
-
- -
- - )} -
-
-
-
-
- - -
- {!_.isEmpty(si.spec.parametersFrom) && } - {!_.isEmpty(parameters) && } - - ); -}; - -const ServiceBindingsDetails: React.SFC = ({ obj: si }) => { - const bindingFilters = { - selector: { field: 'spec.instanceRef.name', values: new Set(_.map(si, 'name')) }, - }; - - return ( - goToCreateBindingPage(si)} - namespace={si.metadata.namespace} - filters={bindingFilters} - autoFocus={false} - showTitle={false} - /> - ); -}; - -const pages = [ - navFactory.details(ServiceInstanceDetails), - navFactory.editYaml(), - navFactory.events(ResourceEventStream), - navFactory.serviceBindings(ServiceBindingsDetails), -]; - -export const ServiceInstanceDetailsPage: React.SFC = (props) => ( - -); -ServiceInstanceDetailsPage.displayName = 'ServiceInstanceDetailsPage'; - -const tableColumnClasses = [ - '', - '', - classNames('pf-m-hidden', 'pf-m-visible-on-sm'), - classNames('pf-m-hidden', 'pf-m-visible-on-lg'), - classNames('pf-m-hidden', 'pf-m-visible-on-lg'), - classNames('pf-m-hidden', 'pf-m-visible-on-xl'), - Kebab.columnClass, -]; - -const ServiceInstancesTableHeader = () => { - return [ - { - title: 'Name', - sortField: 'metadata.name', - transforms: [sortable], - props: { className: tableColumnClasses[0] }, - }, - { - title: 'Namespace', - sortField: 'metadata.namespace', - transforms: [sortable], - props: { className: tableColumnClasses[1] }, - }, - { - title: 'Status', - sortFunc: 'serviceCatalogStatus', - transforms: [sortable], - props: { className: tableColumnClasses[2] }, - }, - { - title: 'Service Class', - sortField: 'spec.clusterServiceClassExternalName', - transforms: [sortable], - props: { className: tableColumnClasses[3] }, - }, - { - title: 'Plan', - sortFunc: 'planExternalName', - transforms: [sortable], - props: { className: tableColumnClasses[4] }, - }, - { - title: 'Created', - sortField: 'metadata.creationTimestamp', - transforms: [sortable], - props: { className: tableColumnClasses[5] }, - }, - { - title: '', - props: { className: tableColumnClasses[6] }, - }, - ]; -}; -ServiceInstancesTableHeader.displayName = 'ServiceInstancesTableHeader'; - -const ServiceInstancesTableRow: RowFunction = ({ obj, index, key, style }) => { - const clusterServiceClassRefName = _.get(obj, 'spec.clusterServiceClassRef.name'); - return ( - - - - - - - - - - - - {clusterServiceClassRefName ? ( - - ) : ( - obj.spec.clusterServiceClassExternalName - )} - - - {planExternalName(obj) || '-'} - - - - - - - - - ); -}; - -const ServiceInstancesList: React.SFC = (props) => ( -
-); -ServiceInstancesList.displayName = 'ServiceInstancesList'; - -const filters = [ - { - filterGroupName: 'Status', - type: 'catalog-status', - reducer: serviceCatalogStatus, - items: [ - { id: 'Ready', title: 'Ready' }, - { id: 'Not Ready', title: 'Not Ready' }, - { id: 'Failed', title: 'Failed' }, - ], - }, -]; - -export const ServiceInstancesPage: React.SFC = (props) => ( - -); -ServiceInstancesPage.displayName = 'ServiceInstancesListPage'; - -export type ServiceInstanceStatusProps = { - obj: K8sResourceKind; -}; - -export type ServiceInstanceDetailsProps = { - obj: K8sResourceKind; -}; - -export type ServiceBindingDescriptionProps = { - instanceName: string; - className?: string; -}; - -export type ServiceInstanceMessageProps = { - obj: K8sResourceKind; -}; - -export type ServiceInstanceMessageState = { - hasBindings: boolean; - loaded: boolean; -}; - -export type ServiceBindingsDetailsProps = { - obj: any; -}; - -export type ServiceInstancesPageProps = { - showTitle?: boolean; - namespace?: string; - match?: match<{ ns?: string }>; - selector?: any; -}; - -export type ServiceInstanceDetailsPageProps = { - match: any; -}; diff --git a/frontend/public/components/utils/horizontal-nav.tsx b/frontend/public/components/utils/horizontal-nav.tsx index 49b9ca8e597..a76cbd2105a 100644 --- a/frontend/public/components/utils/horizontal-nav.tsx +++ b/frontend/public/components/utils/horizontal-nav.tsx @@ -117,12 +117,6 @@ export const navFactory: NavFactory = { nameKey: 'public~Environment', component, }), - clusterServiceClasses: (component) => ({ - href: 'serviceclasses', - // t('public~ServiceClasses') - nameKey: 'public~ServiceClasses', - component, - }), clusterServicePlans: (component) => ({ href: 'serviceplans', // t('public~ServicePlans') diff --git a/frontend/public/components/utils/link.tsx b/frontend/public/components/utils/link.tsx index ed82e6bd2a5..79955c48398 100644 --- a/frontend/public/components/utils/link.tsx +++ b/frontend/public/components/utils/link.tsx @@ -26,7 +26,6 @@ export const namespacedPrefixes = [ '/operatormanagement', '/operators', '/details', - '/provisionedservices', '/search', '/status', ]; diff --git a/frontend/public/locales/en/public.json b/frontend/public/locales/en/public.json index 7038c592c26..bf2706b4117 100644 --- a/frontend/public/locales/en/public.json +++ b/frontend/public/locales/en/public.json @@ -1071,9 +1071,6 @@ "VolumeSnapshots": "VolumeSnapshots", "VolumeSnapshotClasses": "VolumeSnapshotClasses", "Pipelines": "Pipelines", - "Service Catalog": "Service Catalog", - "Provisioned Services": "Provisioned Services", - "Broker Management": "Broker Management", "Compute": "Compute", "Nodes": "Nodes", "MachineSets": "MachineSets", @@ -1085,7 +1082,6 @@ "RoleBindings": "RoleBindings", "Administration": "Administration", "LimitRanges": "LimitRanges", - "Chargeback": "Chargeback", "CustomResourceDefinitions": "CustomResourceDefinitions", "Remove from navigation?": "Remove from navigation?", "Are you sure you want to remove <1>{{label}} from navigation?": "Are you sure you want to remove <1>{{label}} from navigation?", @@ -1515,7 +1511,6 @@ "Deleting": "Deleting", "Logs": "Logs", "Environment": "Environment", - "ServiceClasses": "ServiceClasses", "ServicePlans": "ServicePlans", "ServiceBindings": "ServiceBindings", "Cluster Operators": "Cluster Operators", @@ -1602,12 +1597,8 @@ "SubPath": "SubPath", "Permissions": "Permissions", "Utilized by": "Utilized by", - "Prometheuses": "Prometheuses", "ServiceMonitor": "ServiceMonitor", "ServiceMonitors": "ServiceMonitors", - "Alertmanagers": "Alertmanagers", - "Report": "Report", - "Reports": "Reports", "ReportQuery": "ReportQuery", "ReportQueries": "ReportQueries", "DaemonSet": "DaemonSet", @@ -1654,15 +1645,8 @@ "NetworkPolicy": "NetworkPolicy", "CustomResourceDefinition": "CustomResourceDefinition", "CronJob": "CronJob", - "ClusterServiceBroker": "ClusterServiceBroker", - "ClusterServiceBrokers": "ClusterServiceBrokers", - "ClusterServiceClass": "ClusterServiceClass", - "ClusterServiceClasses": "ClusterServiceClasses", "ClusterServicePlan": "ClusterServicePlan", "ClusterServicePlans": "ClusterServicePlans", - "ServiceInstance": "ServiceInstance", - "ServiceInstances": "ServiceInstances", - "ServiceBinding": "ServiceBinding", "LimitRange": "LimitRange", "APIService": "APIService", "APIServices": "APIServices", diff --git a/frontend/public/models/index.ts b/frontend/public/models/index.ts index a0c085756f0..cb538a9f35f 100644 --- a/frontend/public/models/index.ts +++ b/frontend/public/models/index.ts @@ -1,22 +1,5 @@ import { K8sKind } from '../module/k8s'; -export const PrometheusModel: K8sKind = { - kind: 'Prometheus', - label: 'Prometheus', - // t('public~Prometheus') - labelKey: 'public~Prometheus', - labelPlural: 'Prometheuses', - // t('public~Prometheuses') - labelPluralKey: 'public~Prometheuses', - apiGroup: 'monitoring.coreos.com', - apiVersion: 'v1', - abbr: 'PI', - namespaced: true, - crd: true, - plural: 'prometheuses', - propagationPolicy: 'Foreground', -}; - export const ServiceMonitorModel: K8sKind = { kind: 'ServiceMonitor', label: 'ServiceMonitor', @@ -34,39 +17,6 @@ export const ServiceMonitorModel: K8sKind = { propagationPolicy: 'Foreground', }; -export const AlertmanagerModel: K8sKind = { - kind: 'Alertmanager', - label: 'Alertmanager', - // t('public~Alertmanager') - labelKey: 'public~Alertmanager', - labelPlural: 'Alertmanagers', - // t('public~Alertmanagers') - labelPluralKey: 'public~Alertmanagers', - apiGroup: 'monitoring.coreos.com', - apiVersion: 'v1', - abbr: 'AM', - namespaced: true, - crd: true, - plural: 'alertmanagers', - propagationPolicy: 'Foreground', -}; - -export const ChargebackReportModel: K8sKind = { - kind: 'Report', - label: 'Report', - // t('public~Report') - labelKey: 'public~Report', - labelPlural: 'Reports', - // t('public~Reports') - labelPluralKey: 'public~Reports', - apiGroup: 'metering.openshift.io', - apiVersion: 'v1', - crd: true, - plural: 'reports', - abbr: 'R', - namespaced: true, -}; - export const ReportQueryModel: K8sKind = { kind: 'ReportQuery', label: 'ReportQuery', @@ -789,40 +739,6 @@ export const StorageClassModel: K8sKind = { id: 'storageclass', }; -export const ClusterServiceBrokerModel: K8sKind = { - label: 'ClusterServiceBroker', - // t('public~ClusterServiceBroker') - labelKey: 'public~ClusterServiceBroker', - labelPlural: 'ClusterServiceBrokers', - // t('public~ClusterServiceBrokers') - labelPluralKey: 'public~ClusterServiceBrokers', - apiVersion: 'v1beta1', - apiGroup: 'servicecatalog.k8s.io', - plural: 'clusterservicebrokers', - abbr: 'CSB', - namespaced: false, - kind: 'ClusterServiceBroker', - id: 'clusterservicebroker', - crd: true, -}; - -export const ClusterServiceClassModel: K8sKind = { - label: 'ClusterServiceClass', - // t('public~ClusterServiceClass') - labelKey: 'public~ClusterServiceClass', - labelPlural: 'ClusterServiceClasses', - // t('public~ClusterServiceClasses') - labelPluralKey: 'public~ClusterServiceClasses', - apiVersion: 'v1beta1', - apiGroup: 'servicecatalog.k8s.io', - plural: 'clusterserviceclasses', - abbr: 'CSC', - namespaced: false, - kind: 'ClusterServiceClass', - id: 'clusterserviceclass', - crd: true, -}; - export const ClusterServicePlanModel: K8sKind = { label: 'ClusterServicePlan', // t('public~ClusterServicePlan') @@ -840,40 +756,6 @@ export const ClusterServicePlanModel: K8sKind = { crd: true, }; -export const ServiceInstanceModel: K8sKind = { - label: 'ServiceInstance', - // t('public~ServiceInstance') - labelKey: 'public~ServiceInstance', - labelPlural: 'ServiceInstances', - // t('public~ServiceInstances') - labelPluralKey: 'public~ServiceInstances', - apiVersion: 'v1beta1', - apiGroup: 'servicecatalog.k8s.io', - plural: 'serviceinstances', - abbr: 'SI', - namespaced: true, - kind: 'ServiceInstance', - id: 'serviceinstance', - crd: true, -}; - -export const ServiceBindingModel: K8sKind = { - label: 'ServiceBinding', - // t('public~ServiceBinding') - labelKey: 'public~ServiceBinding', - labelPlural: 'ServiceBindings', - // t('public~ServiceBindings') - labelPluralKey: 'public~ServiceBindings', - apiVersion: 'v1beta1', - apiGroup: 'servicecatalog.k8s.io', - plural: 'servicebindings', - abbr: 'SB', - namespaced: true, - kind: 'ServiceBinding', - id: 'servicebinding', - crd: true, -}; - export const LimitRangeModel: K8sKind = { label: 'LimitRange', // t('public~LimitRange') diff --git a/frontend/public/models/yaml-templates.ts b/frontend/public/models/yaml-templates.ts index 91ef627b294..8b453d9ed62 100644 --- a/frontend/public/models/yaml-templates.ts +++ b/frontend/public/models/yaml-templates.ts @@ -192,21 +192,6 @@ spec: - type: ImageChange imageChange: {} - type: ConfigChange -`, - ) - .setIn( - [referenceForModel(k8sModels.ChargebackReportModel), 'default'], - ` -apiVersion: metering.openshift.io/v1 -kind: Report -metadata: - name: namespace-memory-request - namespace: openshift-metering -spec: - query: namespace-memory-request - reportingStart: '${new Date().getFullYear()}-01-01T00:00:00Z' - reportingEnd: '${new Date().getFullYear()}-12-31T23:59:59Z' - runImmediately: true `, ) .setIn( @@ -887,17 +872,6 @@ metadata: users: - user1 - user2 -`, - ) - .setIn( - [referenceForModel(k8sModels.ClusterServiceBrokerModel), 'default'], - ` -apiVersion: servicecatalog.k8s.io/v1beta1 -kind: ClusterServiceBroker -metadata: - name: example-cluster-service-broker -spec: - url: https://example.com/broker/ `, ) .setIn( diff --git a/frontend/public/reducers/features.ts b/frontend/public/reducers/features.ts index 73c486d8c16..13c40830f3a 100644 --- a/frontend/public/reducers/features.ts +++ b/frontend/public/reducers/features.ts @@ -12,9 +12,7 @@ import { isModelFeatureFlag as isDynamicModelFeatureFlag, } from '@console/dynamic-plugin-sdk/src/extensions'; import { - ChargebackReportModel, ClusterAutoscalerModel, - ClusterServiceClassModel, ConsoleCLIDownloadModel, ConsoleExternalLogLinkModel, ConsoleLinkModel, @@ -24,7 +22,6 @@ import { MachineConfigModel, MachineHealthCheckModel, MachineModel, - PrometheusModel, } from '../models'; import { referenceForModel, referenceForGroupVersionKind } from '../module/k8s'; import { RootState } from '../redux'; @@ -37,9 +34,7 @@ export const defaults = _.mapValues(FLAGS, (flag) => ); export const baseCRDs = { - [referenceForModel(ChargebackReportModel)]: FLAGS.CHARGEBACK, [referenceForModel(ClusterAutoscalerModel)]: FLAGS.CLUSTER_AUTOSCALER, - [referenceForModel(ClusterServiceClassModel)]: FLAGS.SERVICE_CATALOG, [referenceForModel(ConsoleLinkModel)]: FLAGS.CONSOLE_LINK, [referenceForModel(ConsoleCLIDownloadModel)]: FLAGS.CONSOLE_CLI_DOWNLOAD, [referenceForModel(ConsoleExternalLogLinkModel)]: FLAGS.CONSOLE_EXTERNAL_LOG_LINK, @@ -49,7 +44,6 @@ export const baseCRDs = { [referenceForModel(MachineConfigModel)]: FLAGS.MACHINE_CONFIG, [referenceForModel(MachineHealthCheckModel)]: FLAGS.MACHINE_HEALTH_CHECK, [referenceForModel(MachineModel)]: FLAGS.CLUSTER_API, - [referenceForModel(PrometheusModel)]: FLAGS.PROMETHEUS, }; const CRDs = { ...baseCRDs }; diff --git a/frontend/public/style.scss b/frontend/public/style.scss index 37bde63a2d8..f033aeb72b8 100644 --- a/frontend/public/style.scss +++ b/frontend/public/style.scss @@ -83,7 +83,6 @@ @import 'components/utils/value-from-pair'; @import 'components/terminal'; @import 'components/catalog/catalog'; -@import 'components/cluster-service-instance'; @import 'components/overview/build-overview'; @import 'components/overview/job-overview'; @import 'components/overview/overview'; diff --git a/frontend/public/style/_text.scss b/frontend/public/style/_text.scss index 30c29477566..7e6e6d50162 100644 --- a/frontend/public/style/_text.scss +++ b/frontend/public/style/_text.scss @@ -24,7 +24,6 @@ $kinds: ( serviceaccount: $color-serviceaccount-dark, servicemonitor: $color-service-dark, silence: $color-alert-dark, - alertmanager: $color-alertmanager-dark, ); @each $kind, $color in $kinds { diff --git a/frontend/public/style/_vars.scss b/frontend/public/style/_vars.scss index ea7b46b65ab..5c5a7f53289 100644 --- a/frontend/public/style/_vars.scss +++ b/frontend/public/style/_vars.scss @@ -62,7 +62,6 @@ $co-m-catalog-tile-width: 260px; // == Colors -$color-alertmanager-dark: $pf-color-orange-600; $color-co-m-row-hover: #fafafa; $color-application-dark: $pf-color-green-500; $color-configmap-dark: $pf-color-purple-600;