diff --git a/Makefile b/Makefile index 8ddc0acc89b..eb69a3d4edb 100644 --- a/Makefile +++ b/Makefile @@ -52,27 +52,27 @@ $(CMDS): run-local: . ./scripts/build_local.sh mkdir -p build/resources - . ./scripts/package-release.sh 1.0.0-local build/resources Documentation/install/local-values.yaml + . ./scripts/package-release.sh 1.0.0 build/resources Documentation/install/local-values.yaml . ./scripts/install_local.sh local build/resources rm -rf build deploy-local: mkdir -p build/resources - . ./scripts/package-release.sh 1.0.0-local build/resources Documentation/install/local-values.yaml + . ./scripts/package-release.sh 1.0.0 build/resources Documentation/install/local-values.yaml . ./scripts/install_local.sh local build/resources rm -rf build run-local-shift: . ./scripts/build_local_shift.sh mkdir -p build/resources - . ./scripts/package-release.sh 1.0.0-local build/resources Documentation/install/local-values-shift.yaml + . ./scripts/package-release.sh 1.0.0 build/resources Documentation/install/local-values-shift.yaml . ./scripts/install_local.sh local build/resources rm -rf build # useful if running e2e directly with `go test -tags=bare` setup-bare: . ./scripts/build_bare.sh - . ./scripts/package-release.sh 1.0.0-e2e test/e2e/resources test/e2e/e2e-bare-values.yaml + . ./scripts/package-release.sh 1.0.0 test/e2e/resources test/e2e/e2e-bare-values.yaml . ./scripts/install_bare.sh $(shell cat ./e2e.namespace) test/e2e/resources e2e: diff --git a/cmd/catalog/main.go b/cmd/catalog/main.go index 4eaf8c9e772..bca9de0ab92 100644 --- a/cmd/catalog/main.go +++ b/cmd/catalog/main.go @@ -9,7 +9,7 @@ import ( "time" log "github.com/sirupsen/logrus" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" "github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/catalog" "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/signals" diff --git a/cmd/olm/main.go b/cmd/olm/main.go index 091e5f8ba96..0fe99f1ac90 100644 --- a/cmd/olm/main.go +++ b/cmd/olm/main.go @@ -10,7 +10,7 @@ import ( "github.com/prometheus/client_golang/prometheus" log "github.com/sirupsen/logrus" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" "github.com/operator-framework/operator-lifecycle-manager/pkg/api/client" "github.com/operator-framework/operator-lifecycle-manager/pkg/controller/install" diff --git a/deploy/chart/templates/0000_30_14-olm-operators.configmap.yaml b/deploy/chart/templates/0000_30_14-olm-operators.configmap.yaml index 5afaf25dd7f..ab124fd7f5d 100644 --- a/deploy/chart/templates/0000_30_14-olm-operators.configmap.yaml +++ b/deploy/chart/templates/0000_30_14-olm-operators.configmap.yaml @@ -16,7 +16,7 @@ data: {{- end }} {{- end }} clusterServiceVersions: |- -{{ include "packageserver.clusterserviceversion" . | nindent 4 }} +{{- include "packageserver.clusterserviceversion" . | nindent 4 }} {{- range $path, $bytes := .Files.Glob "catalog_resources/olm-operators/**.clusterserviceversion.yaml" }} {{- range $index, $line := $root.Files.Lines $path }} {{- if eq $index 0 }} @@ -27,7 +27,7 @@ data: {{- end }} {{- end }} packages: |- -{{ include "packageserver.package" . | nindent 4 }} +{{- include "packageserver.package" . | nindent 4 }} {{- range $path, $bytes := .Files.Glob "catalog_resources/olm-operators/**.package.yaml" }} {{- range $index, $line := $root.Files.Lines $path }} {{- if eq $index 0 }} diff --git a/deploy/chart/templates/0000_30_15-operatorgroup-default.yaml b/deploy/chart/templates/0000_30_16-operatorgroup-default.yaml similarity index 100% rename from deploy/chart/templates/0000_30_15-operatorgroup-default.yaml rename to deploy/chart/templates/0000_30_16-operatorgroup-default.yaml diff --git a/deploy/chart/templates/0000_30_16-packageserver.subscription.yaml b/deploy/chart/templates/0000_30_17-packageserver.subscription.yaml similarity index 100% rename from deploy/chart/templates/0000_30_16-packageserver.subscription.yaml rename to deploy/chart/templates/0000_30_17-packageserver.subscription.yaml diff --git a/deploy/chart/templates/_packageserver.clusterserviceversion.yaml b/deploy/chart/templates/_packageserver.clusterserviceversion.yaml index 1a6f6cfe9e2..7ea4bce5831 100644 --- a/deploy/chart/templates/_packageserver.clusterserviceversion.yaml +++ b/deploy/chart/templates/_packageserver.clusterserviceversion.yaml @@ -19,7 +19,7 @@ install: strategy: deployment spec: - permissions: + clusterPermissions: - serviceAccountName: packageserver rules: - apiGroups: @@ -49,7 +49,7 @@ - create - delete - patch - - update + - update deployments: - name: packageserver spec: diff --git a/deploy/ocp/manifests/0.8.0/0000_30_00-namespace.yaml b/deploy/ocp/manifests/0.8.0/0000_30_00-namespace.yaml index dc52dd4df73..f6a10f97923 100644 --- a/deploy/ocp/manifests/0.8.0/0000_30_00-namespace.yaml +++ b/deploy/ocp/manifests/0.8.0/0000_30_00-namespace.yaml @@ -6,3 +6,8 @@ metadata: name: openshift-operator-lifecycle-manager labels: openshift.io/run-level: "1" +--- +apiVersion: v1 +kind: Namespace +metadata: + name: openshift-operators diff --git a/deploy/ocp/manifests/0.8.0/0000_30_06-rh-operators.configmap.yaml b/deploy/ocp/manifests/0.8.0/0000_30_06-rh-operators.configmap.yaml index ab03e908269..e753b01c68a 100644 --- a/deploy/ocp/manifests/0.8.0/0000_30_06-rh-operators.configmap.yaml +++ b/deploy/ocp/manifests/0.8.0/0000_30_06-rh-operators.configmap.yaml @@ -4424,6 +4424,35 @@ data: - acls required: - authentication + - apiVersion: apiextensions.k8s.io/v1beta1 + kind: CustomResourceDefinition + metadata: + name: deschedulers.descheduler.io + spec: + group: descheduler.io + names: + kind: Descheduler + listKind: DeschedulerList + plural: deschedulers + singular: descheduler + scope: Namespaced + version: v1alpha1 + validation: + openAPIV3Schema: + properties: + spec: + strategies: + type: array + uniqueItems: true + minItems: 1 + maxItems: 4 + collectionFormat: pipes + items: + type: string + schedule: + type: string + pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$' + - apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: @@ -9550,6 +9579,142 @@ data: path: authorization.type x-descriptors: - 'urn:alm:descriptor:com.tectonic.ui:label' + - apiVersion: operators.coreos.com/v1alpha1 + kind: ClusterServiceVersion + metadata: + annotations: + categories: openshift optional + certifiedLevel: Primed + containerImage: registry.svc.ci.openshift.org/openshift/origin-v4.0:descheduler-operator + createdAt: 2019/11/15 + description: An operator to run the OpenShift descheduler + healthIndex: B + repository: https://github.com/openshift/descheduler-operator + support: Red Hat + name: descheduler.v0.0.1 + namespace: openshift-descheduler-operator + spec: + description: | + # Descheduler for Kubernetes + + ## Introduction + + Scheduling in Kubernetes is the process of binding pending pods to nodes, and is performed by + a component of Kubernetes called kube-scheduler. The scheduler's decisions, whether or where a + pod can or can not be scheduled, are guided by its configurable policy which comprises of set of + rules, called predicates and priorities. The scheduler's decisions are influenced by its view of + a Kubernetes cluster at that point of time when a new pod appears first time for scheduling. + As Kubernetes clusters are very dynamic and their state change over time, there may be desired + to move already running pods to some other nodes for various reasons + + * Some nodes are under or over utilized. + * The original scheduling decision does not hold true any more, as taints or labels are added to + or removed from nodes, pod/node affinity requirements are not satisfied any more. + * Some nodes failed and their pods moved to other nodes. + New nodes are added to clusters. + + Consequently, there might be several pods scheduled on less desired nodes in a cluster. + Descheduler, based on its policy, finds pods that can be moved and evicts them. Please + note, in current implementation, descheduler does not schedule replacement of evicted pods + but relies on the default scheduler for that. + + ## Note + + Any api could be changed any time with out any notice. That said, your feedback is + very important and appreciated to make this project more stable and useful. + + customresourcedefinitions: + owned: + - description: Represents an instance of a Descheduler application + displayName: Descheduler Operator + kind: Descheduler + name: deschedulers.descheduler.io + version: v1alpha1 + displayName: Descheduler + install: + spec: + clusterPermissions: + - rules: + - apiGroups: + - "" + resources: + - services + - pods + - configmaps + - secrets + - names + - nodes + - pods/eviction + verbs: + - '*' + - apiGroups: + - apps + resources: + - deployments + verbs: + - '*' + - apiGroups: + - batch + - extensions + resources: + - jobs + verbs: + - '*' + - apiGroups: + - descheduler.io + resources: + - '*' + verbs: + - '*' + serviceAccountName: openshift-descheduler + deployments: + - name: descheduler-operator + spec: + replicas: 1 + selector: + matchLabels: + app: descheduler-operator + template: + metadata: + labels: + app: descheduler-operator + spec: + containers: + - command: + - descheduler-operator + env: + - name: MY_POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: MY_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: WATCH_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: OPERATOR_NAME + value: descheduler-operator + image: registry.svc.ci.openshift.org/openshift/origin-v4.0:descheduler-operator + imagePullPolicy: Always + name: descheduler-operator + restartPolicy: Always + serviceAccount: openshift-descheduler + serviceAccountName: openshift-descheduler + terminationGracePeriodSeconds: 5 + strategy: deployment + labels: + olm-owner-enterprise-app: descheduler-operator + olm-status-descriptors: descheduler.v0.0.1 + maintainers: + - email: support@redhat.com + name: Red Hat + provider: + name: Red Hat + version: 0.0.1 + - #! validate-crd: ./deploy/chart/templates/03-clusterserviceversion.crd.yaml #! parse-kind: ClusterServiceVersion apiVersion: operators.coreos.com/v1alpha1 @@ -11713,6 +11878,11 @@ data: - name: preview currentCSV: amqstreams.v1.0.0.beta + - packageName: descheduler + channels: + - name: alpha + currentCSV: descheduler.v0.0.1 + - #! package-manifest: ./deploy/chart/catalog_resources/rh-operators/etcdoperator.v0.9.2.clusterserviceversion.yaml packageName: etcd channels: diff --git a/deploy/ocp/manifests/0.8.0/0000_30_13-operatorgroup.crd.yaml b/deploy/ocp/manifests/0.8.0/0000_30_13-operatorgroup.crd.yaml new file mode 100644 index 00000000000..0ac06fad75d --- /dev/null +++ b/deploy/ocp/manifests/0.8.0/0000_30_13-operatorgroup.crd.yaml @@ -0,0 +1,79 @@ +--- +# Source: olm/templates/0000_30_13-operatorgroup.crd.yaml +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: operatorgroups.operators.coreos.com +spec: + group: operators.coreos.com + version: v1alpha2 + versions: + - name: v1alpha2 + served: true + storage: true + names: + plural: operatorgroups + singular: operatorgroup + kind: OperatorGroup + listKind: OperatorGroupList + scope: Namespaced + subresources: + # status enables the status subresource. + status: {} + validation: + openAPIV3Schema: + properties: + spec: + properties: + selector: + type: object + description: Label selector to find resources associated with or managed by the operator + properties: + matchLabels: + type: object + description: Label key:value pairs to match directly + matchExpressions: + type: array + description: A set of expressions to match against the resource. + items: + allOf: + - type: object + required: + - key + - operator + - values + properties: + key: + type: string + description: the key to match + operator: + type: string + description: the operator for the expression + enum: + - In + - NotIn + - Exists + - DoesNotExist + values: + type: array + description: set of values for the expression + serviceAccountName: + type: string + required: + - selector + type: object + status: + properties: + lastUpdated: + format: date-time + type: string + namespaces: + items: + type: string + type: array + required: + - namespaces + - lastUpdated + type: object + required: + - metadata \ No newline at end of file diff --git a/deploy/ocp/manifests/0.8.0/0000_30_14-olm-operators.configmap.yaml b/deploy/ocp/manifests/0.8.0/0000_30_14-olm-operators.configmap.yaml new file mode 100644 index 00000000000..d3a4da6f61e --- /dev/null +++ b/deploy/ocp/manifests/0.8.0/0000_30_14-olm-operators.configmap.yaml @@ -0,0 +1,119 @@ +--- +# Source: olm/templates/0000_30_14-olm-operators.configmap.yaml +kind: ConfigMap +apiVersion: v1 +metadata: + name: olm-operators + namespace: openshift-operator-lifecycle-manager + +data: + customResourceDefinitions: |- + clusterServiceVersions: |- + + - apiVersion: operators.coreos.com/v1alpha1 + kind: ClusterServiceVersion + metadata: + name: packageserver.v0.8.0 + namespace: openshift-operator-lifecycle-manager + spec: + displayName: Package Server + description: Represents an Operator package that is available from a given CatalogSource which will resolve to a ClusterServiceVersion. + keywords: ['packagemanifests', 'olm', 'packages'] + maintainers: + - name: Red Hat + email: openshift-operators@redhat.com + provider: + name: Red Hat + links: + - name: Package Server + url: https://github.com/operator-framework/operator-lifecycle-manager/tree/master/pkg/packageserver + install: + strategy: deployment + spec: + permissions: + - serviceAccountName: packageserver + rules: + - apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch + - apiGroups: + - "operators.coreos.com" + resources: + - catalogsources + verbs: + - get + - list + - watch + - apiGroups: + - "packages.apps.redhat.com" + resources: + - packagemanifests + verbs: + - get + - list + - watch + - create + - delete + - patch + - update + deployments: + - name: packageserver + spec: + replicas: 1 + strategy: + type: RollingUpdate + selector: + matchLabels: + app: packageserver + template: + metadata: + labels: + app: packageserver + spec: + serviceAccountName: packageserver + containers: + - name: packageserver + command: + - /bin/package-server + - -v=4 + - --secure-port + - "5443" + - --global-namespace + - openshift-operator-lifecycle-manager + image: quay.io/coreos/olm@sha256:1639d570809c5827810a1870763016e8c046283632d47e0b47183c82f8e515f2 + imagePullPolicy: Always + ports: + - containerPort: 5443 + livenessProbe: + httpGet: + scheme: HTTPS + path: /healthz + port: 5443 + readinessProbe: + httpGet: + scheme: HTTPS + path: /healthz + port: 5443 + maturity: alpha + version: 0.8.0 + apiservicedefinitions: + owned: + - group: packages.apps.redhat.com + version: v1alpha1 + kind: PackageManifest + displayName: PackageManifest + description: A PackageManifest is a resource generated from existing CatalogSources and their ConfigMaps + deploymentName: packageserver + containerPort: 5443 + packages: |- + + - packageName: packageserver + channels: + - name: alpha + currentCSV: packageserver.v0.8.0 + diff --git a/deploy/ocp/manifests/0.8.0/0000_30_15-olm-operators.catalogsource.yaml b/deploy/ocp/manifests/0.8.0/0000_30_15-olm-operators.catalogsource.yaml new file mode 100644 index 00000000000..a46ba7b950d --- /dev/null +++ b/deploy/ocp/manifests/0.8.0/0000_30_15-olm-operators.catalogsource.yaml @@ -0,0 +1,14 @@ +--- +# Source: olm/templates/0000_30_15-olm-operators.catalogsource.yaml +#! validate-crd: ./deploy/chart/templates/05-catalogsource.crd.yaml +#! parse-kind: CatalogSource +apiVersion: operators.coreos.com/v1alpha1 +kind: CatalogSource +metadata: + name: olm-operators + namespace: openshift-operator-lifecycle-manager +spec: + sourceType: internal + configMap: olm-operators + displayName: OLM Operators + publisher: Red Hat diff --git a/manifests/0000_30_15-operatorgroup-default.yaml b/deploy/ocp/manifests/0.8.0/0000_30_16-operatorgroup-default.yaml similarity index 51% rename from manifests/0000_30_15-operatorgroup-default.yaml rename to deploy/ocp/manifests/0.8.0/0000_30_16-operatorgroup-default.yaml index 0f71176beb5..f768b77dab9 100644 --- a/manifests/0000_30_15-operatorgroup-default.yaml +++ b/deploy/ocp/manifests/0.8.0/0000_30_16-operatorgroup-default.yaml @@ -1,7 +1,7 @@ --- -# Source: olm/templates/0000_30_15-operatorgroup-default.yaml +# Source: olm/templates/0000_30_16-operatorgroup-default.yaml apiVersion: operators.coreos.com/v1alpha2 kind: OperatorGroup metadata: name: global-operators - namespace: openshift-operators + namespace: openshift-operators \ No newline at end of file diff --git a/deploy/ocp/manifests/0.8.0/0000_30_16-packageserver.subscription.yaml b/deploy/ocp/manifests/0.8.0/0000_30_16-packageserver.subscription.yaml new file mode 100644 index 00000000000..c2c1c6890ce --- /dev/null +++ b/deploy/ocp/manifests/0.8.0/0000_30_16-packageserver.subscription.yaml @@ -0,0 +1,13 @@ +--- +# Source: olm/templates/0000_30_16-packageserver.subscription.yaml +#! validate-crd: ./deploy/chart/templates/04-subscription.crd.yaml +#! parse-kind: Subscription +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: packageserver + namespace: openshift-operator-lifecycle-manager +spec: + source: olm-operators + name: packageserver + channel: alpha diff --git a/deploy/ocp/manifests/0.8.0/0000_30_17-packageserver.subscription.yaml b/deploy/ocp/manifests/0.8.0/0000_30_17-packageserver.subscription.yaml new file mode 100644 index 00000000000..30ef76bee89 --- /dev/null +++ b/deploy/ocp/manifests/0.8.0/0000_30_17-packageserver.subscription.yaml @@ -0,0 +1,13 @@ +--- +# Source: olm/templates/0000_30_17-packageserver.subscription.yaml +#! validate-crd: ./deploy/chart/templates/04-subscription.crd.yaml +#! parse-kind: Subscription +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: packageserver + namespace: openshift-operator-lifecycle-manager +spec: + source: olm-operators + name: packageserver + channel: alpha diff --git a/deploy/okd/manifests/0.8.0/0000_30_00-namespace.yaml b/deploy/okd/manifests/0.8.0/0000_30_00-namespace.yaml index dc52dd4df73..f6a10f97923 100644 --- a/deploy/okd/manifests/0.8.0/0000_30_00-namespace.yaml +++ b/deploy/okd/manifests/0.8.0/0000_30_00-namespace.yaml @@ -6,3 +6,8 @@ metadata: name: openshift-operator-lifecycle-manager labels: openshift.io/run-level: "1" +--- +apiVersion: v1 +kind: Namespace +metadata: + name: openshift-operators diff --git a/deploy/okd/manifests/0.8.0/0000_30_06-rh-operators.configmap.yaml b/deploy/okd/manifests/0.8.0/0000_30_06-rh-operators.configmap.yaml index ab03e908269..e753b01c68a 100644 --- a/deploy/okd/manifests/0.8.0/0000_30_06-rh-operators.configmap.yaml +++ b/deploy/okd/manifests/0.8.0/0000_30_06-rh-operators.configmap.yaml @@ -4424,6 +4424,35 @@ data: - acls required: - authentication + - apiVersion: apiextensions.k8s.io/v1beta1 + kind: CustomResourceDefinition + metadata: + name: deschedulers.descheduler.io + spec: + group: descheduler.io + names: + kind: Descheduler + listKind: DeschedulerList + plural: deschedulers + singular: descheduler + scope: Namespaced + version: v1alpha1 + validation: + openAPIV3Schema: + properties: + spec: + strategies: + type: array + uniqueItems: true + minItems: 1 + maxItems: 4 + collectionFormat: pipes + items: + type: string + schedule: + type: string + pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$' + - apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: @@ -9550,6 +9579,142 @@ data: path: authorization.type x-descriptors: - 'urn:alm:descriptor:com.tectonic.ui:label' + - apiVersion: operators.coreos.com/v1alpha1 + kind: ClusterServiceVersion + metadata: + annotations: + categories: openshift optional + certifiedLevel: Primed + containerImage: registry.svc.ci.openshift.org/openshift/origin-v4.0:descheduler-operator + createdAt: 2019/11/15 + description: An operator to run the OpenShift descheduler + healthIndex: B + repository: https://github.com/openshift/descheduler-operator + support: Red Hat + name: descheduler.v0.0.1 + namespace: openshift-descheduler-operator + spec: + description: | + # Descheduler for Kubernetes + + ## Introduction + + Scheduling in Kubernetes is the process of binding pending pods to nodes, and is performed by + a component of Kubernetes called kube-scheduler. The scheduler's decisions, whether or where a + pod can or can not be scheduled, are guided by its configurable policy which comprises of set of + rules, called predicates and priorities. The scheduler's decisions are influenced by its view of + a Kubernetes cluster at that point of time when a new pod appears first time for scheduling. + As Kubernetes clusters are very dynamic and their state change over time, there may be desired + to move already running pods to some other nodes for various reasons + + * Some nodes are under or over utilized. + * The original scheduling decision does not hold true any more, as taints or labels are added to + or removed from nodes, pod/node affinity requirements are not satisfied any more. + * Some nodes failed and their pods moved to other nodes. + New nodes are added to clusters. + + Consequently, there might be several pods scheduled on less desired nodes in a cluster. + Descheduler, based on its policy, finds pods that can be moved and evicts them. Please + note, in current implementation, descheduler does not schedule replacement of evicted pods + but relies on the default scheduler for that. + + ## Note + + Any api could be changed any time with out any notice. That said, your feedback is + very important and appreciated to make this project more stable and useful. + + customresourcedefinitions: + owned: + - description: Represents an instance of a Descheduler application + displayName: Descheduler Operator + kind: Descheduler + name: deschedulers.descheduler.io + version: v1alpha1 + displayName: Descheduler + install: + spec: + clusterPermissions: + - rules: + - apiGroups: + - "" + resources: + - services + - pods + - configmaps + - secrets + - names + - nodes + - pods/eviction + verbs: + - '*' + - apiGroups: + - apps + resources: + - deployments + verbs: + - '*' + - apiGroups: + - batch + - extensions + resources: + - jobs + verbs: + - '*' + - apiGroups: + - descheduler.io + resources: + - '*' + verbs: + - '*' + serviceAccountName: openshift-descheduler + deployments: + - name: descheduler-operator + spec: + replicas: 1 + selector: + matchLabels: + app: descheduler-operator + template: + metadata: + labels: + app: descheduler-operator + spec: + containers: + - command: + - descheduler-operator + env: + - name: MY_POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: MY_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: WATCH_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: OPERATOR_NAME + value: descheduler-operator + image: registry.svc.ci.openshift.org/openshift/origin-v4.0:descheduler-operator + imagePullPolicy: Always + name: descheduler-operator + restartPolicy: Always + serviceAccount: openshift-descheduler + serviceAccountName: openshift-descheduler + terminationGracePeriodSeconds: 5 + strategy: deployment + labels: + olm-owner-enterprise-app: descheduler-operator + olm-status-descriptors: descheduler.v0.0.1 + maintainers: + - email: support@redhat.com + name: Red Hat + provider: + name: Red Hat + version: 0.0.1 + - #! validate-crd: ./deploy/chart/templates/03-clusterserviceversion.crd.yaml #! parse-kind: ClusterServiceVersion apiVersion: operators.coreos.com/v1alpha1 @@ -11713,6 +11878,11 @@ data: - name: preview currentCSV: amqstreams.v1.0.0.beta + - packageName: descheduler + channels: + - name: alpha + currentCSV: descheduler.v0.0.1 + - #! package-manifest: ./deploy/chart/catalog_resources/rh-operators/etcdoperator.v0.9.2.clusterserviceversion.yaml packageName: etcd channels: diff --git a/deploy/okd/manifests/0.8.0/0000_30_13-operatorgroup.crd.yaml b/deploy/okd/manifests/0.8.0/0000_30_13-operatorgroup.crd.yaml new file mode 100644 index 00000000000..0ac06fad75d --- /dev/null +++ b/deploy/okd/manifests/0.8.0/0000_30_13-operatorgroup.crd.yaml @@ -0,0 +1,79 @@ +--- +# Source: olm/templates/0000_30_13-operatorgroup.crd.yaml +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: operatorgroups.operators.coreos.com +spec: + group: operators.coreos.com + version: v1alpha2 + versions: + - name: v1alpha2 + served: true + storage: true + names: + plural: operatorgroups + singular: operatorgroup + kind: OperatorGroup + listKind: OperatorGroupList + scope: Namespaced + subresources: + # status enables the status subresource. + status: {} + validation: + openAPIV3Schema: + properties: + spec: + properties: + selector: + type: object + description: Label selector to find resources associated with or managed by the operator + properties: + matchLabels: + type: object + description: Label key:value pairs to match directly + matchExpressions: + type: array + description: A set of expressions to match against the resource. + items: + allOf: + - type: object + required: + - key + - operator + - values + properties: + key: + type: string + description: the key to match + operator: + type: string + description: the operator for the expression + enum: + - In + - NotIn + - Exists + - DoesNotExist + values: + type: array + description: set of values for the expression + serviceAccountName: + type: string + required: + - selector + type: object + status: + properties: + lastUpdated: + format: date-time + type: string + namespaces: + items: + type: string + type: array + required: + - namespaces + - lastUpdated + type: object + required: + - metadata \ No newline at end of file diff --git a/deploy/okd/manifests/0.8.0/0000_30_14-olm-operators.configmap.yaml b/deploy/okd/manifests/0.8.0/0000_30_14-olm-operators.configmap.yaml new file mode 100644 index 00000000000..d3a4da6f61e --- /dev/null +++ b/deploy/okd/manifests/0.8.0/0000_30_14-olm-operators.configmap.yaml @@ -0,0 +1,119 @@ +--- +# Source: olm/templates/0000_30_14-olm-operators.configmap.yaml +kind: ConfigMap +apiVersion: v1 +metadata: + name: olm-operators + namespace: openshift-operator-lifecycle-manager + +data: + customResourceDefinitions: |- + clusterServiceVersions: |- + + - apiVersion: operators.coreos.com/v1alpha1 + kind: ClusterServiceVersion + metadata: + name: packageserver.v0.8.0 + namespace: openshift-operator-lifecycle-manager + spec: + displayName: Package Server + description: Represents an Operator package that is available from a given CatalogSource which will resolve to a ClusterServiceVersion. + keywords: ['packagemanifests', 'olm', 'packages'] + maintainers: + - name: Red Hat + email: openshift-operators@redhat.com + provider: + name: Red Hat + links: + - name: Package Server + url: https://github.com/operator-framework/operator-lifecycle-manager/tree/master/pkg/packageserver + install: + strategy: deployment + spec: + permissions: + - serviceAccountName: packageserver + rules: + - apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch + - apiGroups: + - "operators.coreos.com" + resources: + - catalogsources + verbs: + - get + - list + - watch + - apiGroups: + - "packages.apps.redhat.com" + resources: + - packagemanifests + verbs: + - get + - list + - watch + - create + - delete + - patch + - update + deployments: + - name: packageserver + spec: + replicas: 1 + strategy: + type: RollingUpdate + selector: + matchLabels: + app: packageserver + template: + metadata: + labels: + app: packageserver + spec: + serviceAccountName: packageserver + containers: + - name: packageserver + command: + - /bin/package-server + - -v=4 + - --secure-port + - "5443" + - --global-namespace + - openshift-operator-lifecycle-manager + image: quay.io/coreos/olm@sha256:1639d570809c5827810a1870763016e8c046283632d47e0b47183c82f8e515f2 + imagePullPolicy: Always + ports: + - containerPort: 5443 + livenessProbe: + httpGet: + scheme: HTTPS + path: /healthz + port: 5443 + readinessProbe: + httpGet: + scheme: HTTPS + path: /healthz + port: 5443 + maturity: alpha + version: 0.8.0 + apiservicedefinitions: + owned: + - group: packages.apps.redhat.com + version: v1alpha1 + kind: PackageManifest + displayName: PackageManifest + description: A PackageManifest is a resource generated from existing CatalogSources and their ConfigMaps + deploymentName: packageserver + containerPort: 5443 + packages: |- + + - packageName: packageserver + channels: + - name: alpha + currentCSV: packageserver.v0.8.0 + diff --git a/deploy/okd/manifests/0.8.0/0000_30_15-olm-operators.catalogsource.yaml b/deploy/okd/manifests/0.8.0/0000_30_15-olm-operators.catalogsource.yaml new file mode 100644 index 00000000000..a46ba7b950d --- /dev/null +++ b/deploy/okd/manifests/0.8.0/0000_30_15-olm-operators.catalogsource.yaml @@ -0,0 +1,14 @@ +--- +# Source: olm/templates/0000_30_15-olm-operators.catalogsource.yaml +#! validate-crd: ./deploy/chart/templates/05-catalogsource.crd.yaml +#! parse-kind: CatalogSource +apiVersion: operators.coreos.com/v1alpha1 +kind: CatalogSource +metadata: + name: olm-operators + namespace: openshift-operator-lifecycle-manager +spec: + sourceType: internal + configMap: olm-operators + displayName: OLM Operators + publisher: Red Hat diff --git a/deploy/okd/manifests/0.8.0/0000_30_16-operatorgroup-default.yaml b/deploy/okd/manifests/0.8.0/0000_30_16-operatorgroup-default.yaml new file mode 100644 index 00000000000..f768b77dab9 --- /dev/null +++ b/deploy/okd/manifests/0.8.0/0000_30_16-operatorgroup-default.yaml @@ -0,0 +1,7 @@ +--- +# Source: olm/templates/0000_30_16-operatorgroup-default.yaml +apiVersion: operators.coreos.com/v1alpha2 +kind: OperatorGroup +metadata: + name: global-operators + namespace: openshift-operators \ No newline at end of file diff --git a/deploy/okd/manifests/0.8.0/0000_30_16-packageserver.subscription.yaml b/deploy/okd/manifests/0.8.0/0000_30_16-packageserver.subscription.yaml new file mode 100644 index 00000000000..c2c1c6890ce --- /dev/null +++ b/deploy/okd/manifests/0.8.0/0000_30_16-packageserver.subscription.yaml @@ -0,0 +1,13 @@ +--- +# Source: olm/templates/0000_30_16-packageserver.subscription.yaml +#! validate-crd: ./deploy/chart/templates/04-subscription.crd.yaml +#! parse-kind: Subscription +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: packageserver + namespace: openshift-operator-lifecycle-manager +spec: + source: olm-operators + name: packageserver + channel: alpha diff --git a/deploy/okd/manifests/0.8.0/0000_30_17-packageserver.subscription.yaml b/deploy/okd/manifests/0.8.0/0000_30_17-packageserver.subscription.yaml new file mode 100644 index 00000000000..30ef76bee89 --- /dev/null +++ b/deploy/okd/manifests/0.8.0/0000_30_17-packageserver.subscription.yaml @@ -0,0 +1,13 @@ +--- +# Source: olm/templates/0000_30_17-packageserver.subscription.yaml +#! validate-crd: ./deploy/chart/templates/04-subscription.crd.yaml +#! parse-kind: Subscription +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: packageserver + namespace: openshift-operator-lifecycle-manager +spec: + source: olm-operators + name: packageserver + channel: alpha diff --git a/deploy/upstream/manifests/0.8.0/0000_30_00-namespace.yaml b/deploy/upstream/manifests/0.8.0/0000_30_00-namespace.yaml index 21845605e0b..01026e85481 100644 --- a/deploy/upstream/manifests/0.8.0/0000_30_00-namespace.yaml +++ b/deploy/upstream/manifests/0.8.0/0000_30_00-namespace.yaml @@ -6,3 +6,8 @@ metadata: name: olm labels: openshift.io/run-level: "1" +--- +apiVersion: v1 +kind: Namespace +metadata: + name: operators diff --git a/deploy/upstream/manifests/0.8.0/0000_30_06-rh-operators.configmap.yaml b/deploy/upstream/manifests/0.8.0/0000_30_06-rh-operators.configmap.yaml index 49021214052..76659f4ce57 100644 --- a/deploy/upstream/manifests/0.8.0/0000_30_06-rh-operators.configmap.yaml +++ b/deploy/upstream/manifests/0.8.0/0000_30_06-rh-operators.configmap.yaml @@ -4424,6 +4424,35 @@ data: - acls required: - authentication + - apiVersion: apiextensions.k8s.io/v1beta1 + kind: CustomResourceDefinition + metadata: + name: deschedulers.descheduler.io + spec: + group: descheduler.io + names: + kind: Descheduler + listKind: DeschedulerList + plural: deschedulers + singular: descheduler + scope: Namespaced + version: v1alpha1 + validation: + openAPIV3Schema: + properties: + spec: + strategies: + type: array + uniqueItems: true + minItems: 1 + maxItems: 4 + collectionFormat: pipes + items: + type: string + schedule: + type: string + pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$' + - apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: @@ -9550,6 +9579,142 @@ data: path: authorization.type x-descriptors: - 'urn:alm:descriptor:com.tectonic.ui:label' + - apiVersion: operators.coreos.com/v1alpha1 + kind: ClusterServiceVersion + metadata: + annotations: + categories: openshift optional + certifiedLevel: Primed + containerImage: registry.svc.ci.openshift.org/openshift/origin-v4.0:descheduler-operator + createdAt: 2019/11/15 + description: An operator to run the OpenShift descheduler + healthIndex: B + repository: https://github.com/openshift/descheduler-operator + support: Red Hat + name: descheduler.v0.0.1 + namespace: openshift-descheduler-operator + spec: + description: | + # Descheduler for Kubernetes + + ## Introduction + + Scheduling in Kubernetes is the process of binding pending pods to nodes, and is performed by + a component of Kubernetes called kube-scheduler. The scheduler's decisions, whether or where a + pod can or can not be scheduled, are guided by its configurable policy which comprises of set of + rules, called predicates and priorities. The scheduler's decisions are influenced by its view of + a Kubernetes cluster at that point of time when a new pod appears first time for scheduling. + As Kubernetes clusters are very dynamic and their state change over time, there may be desired + to move already running pods to some other nodes for various reasons + + * Some nodes are under or over utilized. + * The original scheduling decision does not hold true any more, as taints or labels are added to + or removed from nodes, pod/node affinity requirements are not satisfied any more. + * Some nodes failed and their pods moved to other nodes. + New nodes are added to clusters. + + Consequently, there might be several pods scheduled on less desired nodes in a cluster. + Descheduler, based on its policy, finds pods that can be moved and evicts them. Please + note, in current implementation, descheduler does not schedule replacement of evicted pods + but relies on the default scheduler for that. + + ## Note + + Any api could be changed any time with out any notice. That said, your feedback is + very important and appreciated to make this project more stable and useful. + + customresourcedefinitions: + owned: + - description: Represents an instance of a Descheduler application + displayName: Descheduler Operator + kind: Descheduler + name: deschedulers.descheduler.io + version: v1alpha1 + displayName: Descheduler + install: + spec: + clusterPermissions: + - rules: + - apiGroups: + - "" + resources: + - services + - pods + - configmaps + - secrets + - names + - nodes + - pods/eviction + verbs: + - '*' + - apiGroups: + - apps + resources: + - deployments + verbs: + - '*' + - apiGroups: + - batch + - extensions + resources: + - jobs + verbs: + - '*' + - apiGroups: + - descheduler.io + resources: + - '*' + verbs: + - '*' + serviceAccountName: openshift-descheduler + deployments: + - name: descheduler-operator + spec: + replicas: 1 + selector: + matchLabels: + app: descheduler-operator + template: + metadata: + labels: + app: descheduler-operator + spec: + containers: + - command: + - descheduler-operator + env: + - name: MY_POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: MY_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: WATCH_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: OPERATOR_NAME + value: descheduler-operator + image: registry.svc.ci.openshift.org/openshift/origin-v4.0:descheduler-operator + imagePullPolicy: Always + name: descheduler-operator + restartPolicy: Always + serviceAccount: openshift-descheduler + serviceAccountName: openshift-descheduler + terminationGracePeriodSeconds: 5 + strategy: deployment + labels: + olm-owner-enterprise-app: descheduler-operator + olm-status-descriptors: descheduler.v0.0.1 + maintainers: + - email: support@redhat.com + name: Red Hat + provider: + name: Red Hat + version: 0.0.1 + - #! validate-crd: ./deploy/chart/templates/03-clusterserviceversion.crd.yaml #! parse-kind: ClusterServiceVersion apiVersion: operators.coreos.com/v1alpha1 @@ -11713,6 +11878,11 @@ data: - name: preview currentCSV: amqstreams.v1.0.0.beta + - packageName: descheduler + channels: + - name: alpha + currentCSV: descheduler.v0.0.1 + - #! package-manifest: ./deploy/chart/catalog_resources/rh-operators/etcdoperator.v0.9.2.clusterserviceversion.yaml packageName: etcd channels: diff --git a/deploy/upstream/manifests/0.8.0/0000_30_13-operatorgroup.crd.yaml b/deploy/upstream/manifests/0.8.0/0000_30_13-operatorgroup.crd.yaml new file mode 100644 index 00000000000..0ac06fad75d --- /dev/null +++ b/deploy/upstream/manifests/0.8.0/0000_30_13-operatorgroup.crd.yaml @@ -0,0 +1,79 @@ +--- +# Source: olm/templates/0000_30_13-operatorgroup.crd.yaml +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: operatorgroups.operators.coreos.com +spec: + group: operators.coreos.com + version: v1alpha2 + versions: + - name: v1alpha2 + served: true + storage: true + names: + plural: operatorgroups + singular: operatorgroup + kind: OperatorGroup + listKind: OperatorGroupList + scope: Namespaced + subresources: + # status enables the status subresource. + status: {} + validation: + openAPIV3Schema: + properties: + spec: + properties: + selector: + type: object + description: Label selector to find resources associated with or managed by the operator + properties: + matchLabels: + type: object + description: Label key:value pairs to match directly + matchExpressions: + type: array + description: A set of expressions to match against the resource. + items: + allOf: + - type: object + required: + - key + - operator + - values + properties: + key: + type: string + description: the key to match + operator: + type: string + description: the operator for the expression + enum: + - In + - NotIn + - Exists + - DoesNotExist + values: + type: array + description: set of values for the expression + serviceAccountName: + type: string + required: + - selector + type: object + status: + properties: + lastUpdated: + format: date-time + type: string + namespaces: + items: + type: string + type: array + required: + - namespaces + - lastUpdated + type: object + required: + - metadata \ No newline at end of file diff --git a/deploy/upstream/manifests/0.8.0/0000_30_14-olm-operators.configmap.yaml b/deploy/upstream/manifests/0.8.0/0000_30_14-olm-operators.configmap.yaml new file mode 100644 index 00000000000..0f15662bd55 --- /dev/null +++ b/deploy/upstream/manifests/0.8.0/0000_30_14-olm-operators.configmap.yaml @@ -0,0 +1,119 @@ +--- +# Source: olm/templates/0000_30_14-olm-operators.configmap.yaml +kind: ConfigMap +apiVersion: v1 +metadata: + name: olm-operators + namespace: olm + +data: + customResourceDefinitions: |- + clusterServiceVersions: |- + + - apiVersion: operators.coreos.com/v1alpha1 + kind: ClusterServiceVersion + metadata: + name: packageserver.v0.8.0 + namespace: olm + spec: + displayName: Package Server + description: Represents an Operator package that is available from a given CatalogSource which will resolve to a ClusterServiceVersion. + keywords: ['packagemanifests', 'olm', 'packages'] + maintainers: + - name: Red Hat + email: openshift-operators@redhat.com + provider: + name: Red Hat + links: + - name: Package Server + url: https://github.com/operator-framework/operator-lifecycle-manager/tree/master/pkg/packageserver + install: + strategy: deployment + spec: + permissions: + - serviceAccountName: packageserver + rules: + - apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch + - apiGroups: + - "operators.coreos.com" + resources: + - catalogsources + verbs: + - get + - list + - watch + - apiGroups: + - "packages.apps.redhat.com" + resources: + - packagemanifests + verbs: + - get + - list + - watch + - create + - delete + - patch + - update + deployments: + - name: packageserver + spec: + replicas: 1 + strategy: + type: RollingUpdate + selector: + matchLabels: + app: packageserver + template: + metadata: + labels: + app: packageserver + spec: + serviceAccountName: packageserver + containers: + - name: packageserver + command: + - /bin/package-server + - -v=4 + - --secure-port + - "5443" + - --global-namespace + - olm + image: quay.io/coreos/olm@sha256:1639d570809c5827810a1870763016e8c046283632d47e0b47183c82f8e515f2 + imagePullPolicy: Always + ports: + - containerPort: 5443 + livenessProbe: + httpGet: + scheme: HTTPS + path: /healthz + port: 5443 + readinessProbe: + httpGet: + scheme: HTTPS + path: /healthz + port: 5443 + maturity: alpha + version: 0.8.0 + apiservicedefinitions: + owned: + - group: packages.apps.redhat.com + version: v1alpha1 + kind: PackageManifest + displayName: PackageManifest + description: A PackageManifest is a resource generated from existing CatalogSources and their ConfigMaps + deploymentName: packageserver + containerPort: 5443 + packages: |- + + - packageName: packageserver + channels: + - name: alpha + currentCSV: packageserver.v0.8.0 + diff --git a/deploy/upstream/manifests/0.8.0/0000_30_15-olm-operators.catalogsource.yaml b/deploy/upstream/manifests/0.8.0/0000_30_15-olm-operators.catalogsource.yaml new file mode 100644 index 00000000000..25b6c1bddbb --- /dev/null +++ b/deploy/upstream/manifests/0.8.0/0000_30_15-olm-operators.catalogsource.yaml @@ -0,0 +1,14 @@ +--- +# Source: olm/templates/0000_30_15-olm-operators.catalogsource.yaml +#! validate-crd: ./deploy/chart/templates/05-catalogsource.crd.yaml +#! parse-kind: CatalogSource +apiVersion: operators.coreos.com/v1alpha1 +kind: CatalogSource +metadata: + name: olm-operators + namespace: olm +spec: + sourceType: internal + configMap: olm-operators + displayName: OLM Operators + publisher: Red Hat diff --git a/deploy/upstream/manifests/0.8.0/0000_30_16-operatorgroup-default.yaml b/deploy/upstream/manifests/0.8.0/0000_30_16-operatorgroup-default.yaml new file mode 100644 index 00000000000..cb6f43926a3 --- /dev/null +++ b/deploy/upstream/manifests/0.8.0/0000_30_16-operatorgroup-default.yaml @@ -0,0 +1,7 @@ +--- +# Source: olm/templates/0000_30_16-operatorgroup-default.yaml +apiVersion: operators.coreos.com/v1alpha2 +kind: OperatorGroup +metadata: + name: global-operators + namespace: operators \ No newline at end of file diff --git a/deploy/upstream/manifests/0.8.0/0000_30_16-packageserver.subscription.yaml b/deploy/upstream/manifests/0.8.0/0000_30_16-packageserver.subscription.yaml new file mode 100644 index 00000000000..7c10b1de341 --- /dev/null +++ b/deploy/upstream/manifests/0.8.0/0000_30_16-packageserver.subscription.yaml @@ -0,0 +1,13 @@ +--- +# Source: olm/templates/0000_30_16-packageserver.subscription.yaml +#! validate-crd: ./deploy/chart/templates/04-subscription.crd.yaml +#! parse-kind: Subscription +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: packageserver + namespace: olm +spec: + source: olm-operators + name: packageserver + channel: alpha diff --git a/deploy/upstream/manifests/0.8.0/0000_30_17-packageserver.subscription.yaml b/deploy/upstream/manifests/0.8.0/0000_30_17-packageserver.subscription.yaml new file mode 100644 index 00000000000..7b6b9b1b189 --- /dev/null +++ b/deploy/upstream/manifests/0.8.0/0000_30_17-packageserver.subscription.yaml @@ -0,0 +1,13 @@ +--- +# Source: olm/templates/0000_30_17-packageserver.subscription.yaml +#! validate-crd: ./deploy/chart/templates/04-subscription.crd.yaml +#! parse-kind: Subscription +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: packageserver + namespace: olm +spec: + source: olm-operators + name: packageserver + channel: alpha diff --git a/e2e.namespace b/e2e.namespace deleted file mode 100644 index f7f7c78c52d..00000000000 --- a/e2e.namespace +++ /dev/null @@ -1 +0,0 @@ -e2e-tests-1543931109-3970 \ No newline at end of file diff --git a/go.mod b/go.mod index 6e330d847fb..90bdbf87f43 100644 --- a/go.mod +++ b/go.mod @@ -62,6 +62,7 @@ require ( golang.org/x/oauth2 v0.0.0-20181105165119-ca4130e427c7 // indirect golang.org/x/sys v0.0.0-20181023152157-44b849a8bc13 // indirect golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2 // indirect + golang.org/x/tools v0.0.0-20181207222222-4c874b978acb // indirect google.golang.org/genproto v0.0.0-20181016170114-94acd270e44e // indirect google.golang.org/grpc v1.16.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/go.sum b/go.sum index 6b133eb42f2..f406f9dde6d 100644 --- a/go.sum +++ b/go.sum @@ -190,6 +190,8 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011152555-a398e557df60 h1:PDHN4Zqpfzyio+3C8FTXO2gSMFZa0f8tFifs+K4tdoQ= golang.org/x/tools v0.0.0-20181011152555-a398e557df60/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181207222222-4c874b978acb h1:YIXCxYolAiiPmVSqA4gVUVcHo8Mi1ivU7ANnK9a63JY= +golang.org/x/tools v0.0.0-20181207222222-4c874b978acb/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= google.golang.org/appengine v1.1.0 h1:igQkv0AAhEIvTEpD5LIpAfav2eeVO9HBTjvKHVJPRSs= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= diff --git a/manifests/0000_30_06-rh-operators.configmap.yaml b/manifests/0000_30_06-rh-operators.configmap.yaml index ab03e908269..e753b01c68a 100644 --- a/manifests/0000_30_06-rh-operators.configmap.yaml +++ b/manifests/0000_30_06-rh-operators.configmap.yaml @@ -4424,6 +4424,35 @@ data: - acls required: - authentication + - apiVersion: apiextensions.k8s.io/v1beta1 + kind: CustomResourceDefinition + metadata: + name: deschedulers.descheduler.io + spec: + group: descheduler.io + names: + kind: Descheduler + listKind: DeschedulerList + plural: deschedulers + singular: descheduler + scope: Namespaced + version: v1alpha1 + validation: + openAPIV3Schema: + properties: + spec: + strategies: + type: array + uniqueItems: true + minItems: 1 + maxItems: 4 + collectionFormat: pipes + items: + type: string + schedule: + type: string + pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$' + - apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: @@ -9550,6 +9579,142 @@ data: path: authorization.type x-descriptors: - 'urn:alm:descriptor:com.tectonic.ui:label' + - apiVersion: operators.coreos.com/v1alpha1 + kind: ClusterServiceVersion + metadata: + annotations: + categories: openshift optional + certifiedLevel: Primed + containerImage: registry.svc.ci.openshift.org/openshift/origin-v4.0:descheduler-operator + createdAt: 2019/11/15 + description: An operator to run the OpenShift descheduler + healthIndex: B + repository: https://github.com/openshift/descheduler-operator + support: Red Hat + name: descheduler.v0.0.1 + namespace: openshift-descheduler-operator + spec: + description: | + # Descheduler for Kubernetes + + ## Introduction + + Scheduling in Kubernetes is the process of binding pending pods to nodes, and is performed by + a component of Kubernetes called kube-scheduler. The scheduler's decisions, whether or where a + pod can or can not be scheduled, are guided by its configurable policy which comprises of set of + rules, called predicates and priorities. The scheduler's decisions are influenced by its view of + a Kubernetes cluster at that point of time when a new pod appears first time for scheduling. + As Kubernetes clusters are very dynamic and their state change over time, there may be desired + to move already running pods to some other nodes for various reasons + + * Some nodes are under or over utilized. + * The original scheduling decision does not hold true any more, as taints or labels are added to + or removed from nodes, pod/node affinity requirements are not satisfied any more. + * Some nodes failed and their pods moved to other nodes. + New nodes are added to clusters. + + Consequently, there might be several pods scheduled on less desired nodes in a cluster. + Descheduler, based on its policy, finds pods that can be moved and evicts them. Please + note, in current implementation, descheduler does not schedule replacement of evicted pods + but relies on the default scheduler for that. + + ## Note + + Any api could be changed any time with out any notice. That said, your feedback is + very important and appreciated to make this project more stable and useful. + + customresourcedefinitions: + owned: + - description: Represents an instance of a Descheduler application + displayName: Descheduler Operator + kind: Descheduler + name: deschedulers.descheduler.io + version: v1alpha1 + displayName: Descheduler + install: + spec: + clusterPermissions: + - rules: + - apiGroups: + - "" + resources: + - services + - pods + - configmaps + - secrets + - names + - nodes + - pods/eviction + verbs: + - '*' + - apiGroups: + - apps + resources: + - deployments + verbs: + - '*' + - apiGroups: + - batch + - extensions + resources: + - jobs + verbs: + - '*' + - apiGroups: + - descheduler.io + resources: + - '*' + verbs: + - '*' + serviceAccountName: openshift-descheduler + deployments: + - name: descheduler-operator + spec: + replicas: 1 + selector: + matchLabels: + app: descheduler-operator + template: + metadata: + labels: + app: descheduler-operator + spec: + containers: + - command: + - descheduler-operator + env: + - name: MY_POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: MY_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: WATCH_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: OPERATOR_NAME + value: descheduler-operator + image: registry.svc.ci.openshift.org/openshift/origin-v4.0:descheduler-operator + imagePullPolicy: Always + name: descheduler-operator + restartPolicy: Always + serviceAccount: openshift-descheduler + serviceAccountName: openshift-descheduler + terminationGracePeriodSeconds: 5 + strategy: deployment + labels: + olm-owner-enterprise-app: descheduler-operator + olm-status-descriptors: descheduler.v0.0.1 + maintainers: + - email: support@redhat.com + name: Red Hat + provider: + name: Red Hat + version: 0.0.1 + - #! validate-crd: ./deploy/chart/templates/03-clusterserviceversion.crd.yaml #! parse-kind: ClusterServiceVersion apiVersion: operators.coreos.com/v1alpha1 @@ -11713,6 +11878,11 @@ data: - name: preview currentCSV: amqstreams.v1.0.0.beta + - packageName: descheduler + channels: + - name: alpha + currentCSV: descheduler.v0.0.1 + - #! package-manifest: ./deploy/chart/catalog_resources/rh-operators/etcdoperator.v0.9.2.clusterserviceversion.yaml packageName: etcd channels: diff --git a/manifests/0000_30_13-operatorgroup.crd.yaml b/manifests/0000_30_13-operatorgroup.crd.yaml new file mode 100644 index 00000000000..0ac06fad75d --- /dev/null +++ b/manifests/0000_30_13-operatorgroup.crd.yaml @@ -0,0 +1,79 @@ +--- +# Source: olm/templates/0000_30_13-operatorgroup.crd.yaml +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: operatorgroups.operators.coreos.com +spec: + group: operators.coreos.com + version: v1alpha2 + versions: + - name: v1alpha2 + served: true + storage: true + names: + plural: operatorgroups + singular: operatorgroup + kind: OperatorGroup + listKind: OperatorGroupList + scope: Namespaced + subresources: + # status enables the status subresource. + status: {} + validation: + openAPIV3Schema: + properties: + spec: + properties: + selector: + type: object + description: Label selector to find resources associated with or managed by the operator + properties: + matchLabels: + type: object + description: Label key:value pairs to match directly + matchExpressions: + type: array + description: A set of expressions to match against the resource. + items: + allOf: + - type: object + required: + - key + - operator + - values + properties: + key: + type: string + description: the key to match + operator: + type: string + description: the operator for the expression + enum: + - In + - NotIn + - Exists + - DoesNotExist + values: + type: array + description: set of values for the expression + serviceAccountName: + type: string + required: + - selector + type: object + status: + properties: + lastUpdated: + format: date-time + type: string + namespaces: + items: + type: string + type: array + required: + - namespaces + - lastUpdated + type: object + required: + - metadata \ No newline at end of file diff --git a/manifests/0000_30_14-olm-operators.configmap.yaml b/manifests/0000_30_14-olm-operators.configmap.yaml new file mode 100644 index 00000000000..d3a4da6f61e --- /dev/null +++ b/manifests/0000_30_14-olm-operators.configmap.yaml @@ -0,0 +1,119 @@ +--- +# Source: olm/templates/0000_30_14-olm-operators.configmap.yaml +kind: ConfigMap +apiVersion: v1 +metadata: + name: olm-operators + namespace: openshift-operator-lifecycle-manager + +data: + customResourceDefinitions: |- + clusterServiceVersions: |- + + - apiVersion: operators.coreos.com/v1alpha1 + kind: ClusterServiceVersion + metadata: + name: packageserver.v0.8.0 + namespace: openshift-operator-lifecycle-manager + spec: + displayName: Package Server + description: Represents an Operator package that is available from a given CatalogSource which will resolve to a ClusterServiceVersion. + keywords: ['packagemanifests', 'olm', 'packages'] + maintainers: + - name: Red Hat + email: openshift-operators@redhat.com + provider: + name: Red Hat + links: + - name: Package Server + url: https://github.com/operator-framework/operator-lifecycle-manager/tree/master/pkg/packageserver + install: + strategy: deployment + spec: + permissions: + - serviceAccountName: packageserver + rules: + - apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch + - apiGroups: + - "operators.coreos.com" + resources: + - catalogsources + verbs: + - get + - list + - watch + - apiGroups: + - "packages.apps.redhat.com" + resources: + - packagemanifests + verbs: + - get + - list + - watch + - create + - delete + - patch + - update + deployments: + - name: packageserver + spec: + replicas: 1 + strategy: + type: RollingUpdate + selector: + matchLabels: + app: packageserver + template: + metadata: + labels: + app: packageserver + spec: + serviceAccountName: packageserver + containers: + - name: packageserver + command: + - /bin/package-server + - -v=4 + - --secure-port + - "5443" + - --global-namespace + - openshift-operator-lifecycle-manager + image: quay.io/coreos/olm@sha256:1639d570809c5827810a1870763016e8c046283632d47e0b47183c82f8e515f2 + imagePullPolicy: Always + ports: + - containerPort: 5443 + livenessProbe: + httpGet: + scheme: HTTPS + path: /healthz + port: 5443 + readinessProbe: + httpGet: + scheme: HTTPS + path: /healthz + port: 5443 + maturity: alpha + version: 0.8.0 + apiservicedefinitions: + owned: + - group: packages.apps.redhat.com + version: v1alpha1 + kind: PackageManifest + displayName: PackageManifest + description: A PackageManifest is a resource generated from existing CatalogSources and their ConfigMaps + deploymentName: packageserver + containerPort: 5443 + packages: |- + + - packageName: packageserver + channels: + - name: alpha + currentCSV: packageserver.v0.8.0 + diff --git a/manifests/0000_30_14-operatorgroup.crd.yaml b/manifests/0000_30_14-operatorgroup.crd.yaml index 34c8cb61dfd..ac0a45712aa 100644 --- a/manifests/0000_30_14-operatorgroup.crd.yaml +++ b/manifests/0000_30_14-operatorgroup.crd.yaml @@ -76,4 +76,5 @@ spec: - lastUpdated type: object required: - - metadata \ No newline at end of file + - metadata + - spec diff --git a/manifests/0000_30_15-olm-operators.catalogsource.yaml b/manifests/0000_30_15-olm-operators.catalogsource.yaml new file mode 100644 index 00000000000..a46ba7b950d --- /dev/null +++ b/manifests/0000_30_15-olm-operators.catalogsource.yaml @@ -0,0 +1,14 @@ +--- +# Source: olm/templates/0000_30_15-olm-operators.catalogsource.yaml +#! validate-crd: ./deploy/chart/templates/05-catalogsource.crd.yaml +#! parse-kind: CatalogSource +apiVersion: operators.coreos.com/v1alpha1 +kind: CatalogSource +metadata: + name: olm-operators + namespace: openshift-operator-lifecycle-manager +spec: + sourceType: internal + configMap: olm-operators + displayName: OLM Operators + publisher: Red Hat diff --git a/manifests/0000_30_16-operatorgroup-default.yaml b/manifests/0000_30_16-operatorgroup-default.yaml new file mode 100644 index 00000000000..f768b77dab9 --- /dev/null +++ b/manifests/0000_30_16-operatorgroup-default.yaml @@ -0,0 +1,7 @@ +--- +# Source: olm/templates/0000_30_16-operatorgroup-default.yaml +apiVersion: operators.coreos.com/v1alpha2 +kind: OperatorGroup +metadata: + name: global-operators + namespace: openshift-operators \ No newline at end of file diff --git a/manifests/0000_30_16-packageserver.subscription.yaml b/manifests/0000_30_16-packageserver.subscription.yaml new file mode 100644 index 00000000000..c2c1c6890ce --- /dev/null +++ b/manifests/0000_30_16-packageserver.subscription.yaml @@ -0,0 +1,13 @@ +--- +# Source: olm/templates/0000_30_16-packageserver.subscription.yaml +#! validate-crd: ./deploy/chart/templates/04-subscription.crd.yaml +#! parse-kind: Subscription +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: packageserver + namespace: openshift-operator-lifecycle-manager +spec: + source: olm-operators + name: packageserver + channel: alpha diff --git a/manifests/0000_30_17-packageserver.subscription.yaml b/manifests/0000_30_17-packageserver.subscription.yaml new file mode 100644 index 00000000000..30ef76bee89 --- /dev/null +++ b/manifests/0000_30_17-packageserver.subscription.yaml @@ -0,0 +1,13 @@ +--- +# Source: olm/templates/0000_30_17-packageserver.subscription.yaml +#! validate-crd: ./deploy/chart/templates/04-subscription.crd.yaml +#! parse-kind: Subscription +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: packageserver + namespace: openshift-operator-lifecycle-manager +spec: + source: olm-operators + name: packageserver + channel: alpha diff --git a/minikube.kubeconfig b/minikube.kubeconfig deleted file mode 100644 index ca57bdcb3cc..00000000000 --- a/minikube.kubeconfig +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -clusters: -- cluster: - certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM1ekNDQWMrZ0F3SUJBZ0lCQVRBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwdGFXNXAKYTNWaVpVTkJNQjRYRFRFNE1URXdOakl4TXpjME4xb1hEVEk0TVRFd05ESXhNemMwTjFvd0ZURVRNQkVHQTFVRQpBeE1LYldsdWFXdDFZbVZEUVRDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTVhGCjRNTlF5VnVERWZzMkphMXRhWEFTdE5HMkFwdllaek04Ui93NXZ6K1I2c2pjQWtCajhjNURId015SEFiek5Jd2wKb25GSnovcjh2bldmMXVuOVQvVU9lRG5IWTJ6UUN4d2g5OW51ZThoS1hucFFFcnd1TXdYUDRQMkU0amQydEdVTwo0ZFNEOXQvQ1haSTNmMjQzcXQvVmNlczBpTzBVbkhBN3hlZDZKa08xQ2tqbU95NmZDM2FtUG4xVGlWT2VPWXUzClp3MGY2Ull0QTRoLzlETnBlSGk2aFZ4QzVHclVwV0ZHRnZuekpRa0xZdmdNQ2hESG9qcjNDb3NqUUJQY2NnTEYKS3ovendnbUJFVUFrZGowL0FzUFBIQ05GMEZMc1ZmQ2FDQ2s0dE1GVExZTGRKT0IxQ1BSR2Voamx5bmhiMStuTQp2ZkJPUEhYWUxtUkZYY2FlUFdNQ0F3RUFBYU5DTUVBd0RnWURWUjBQQVFIL0JBUURBZ0trTUIwR0ExVWRKUVFXCk1CUUdDQ3NHQVFVRkJ3TUNCZ2dyQmdFRkJRY0RBVEFQQmdOVkhSTUJBZjhFQlRBREFRSC9NQTBHQ1NxR1NJYjMKRFFFQkN3VUFBNElCQVFCTy9aMFFHekdBWFYranJIekhYZC9kY2JjTnowQTgwMGowb1pKZ3ZidmNEVVZKeHErdwpZT1NkSjg2MjVkWEpNM3VpYURDdmcwNGFoRVlWOENLbkphMlJPc0w1VWhEYmh6SmlCaWFaR3lLZHVaQW8xcEVoCjdFeVZmSE0xZm12M1R4WWJWOUtQVTBBWjNCQWU2NFZITENILy9WSW9HMmcwWDVXcVpLTlhjV3FsSGtXb0l3Y0UKMU13dmdwSS9iM2JTT3VzeGpQL0hqVDk5eHpsNUxnUU1DaUlJUlM4WjhhemFwRy8rUUs1ZFhYVEZycTFvLytmTwpUZzhUUmxhK2RoNm1mdDJBSjF4Q0hOTDN5cEFGLzE4cWtzQ2k5WU9TdWN0RGsrbXNtVDJnbkJGSDNseGFJVzdhClFNMjdBNHZHMXYxbmd5RUoxN0lBL2JSLzF0SENEdkZXNmNHMQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg== - server: https://192.168.99.100:8443 - name: minikube -contexts: -- context: - cluster: minikube - user: minikube - name: minikube -current-context: minikube -kind: Config -preferences: {} -users: -- name: minikube - user: - client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURBRENDQWVpZ0F3SUJBZ0lCQWpBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwdGFXNXAKYTNWaVpVTkJNQjRYRFRFNE1URXlPVEU1TkRNMU9Wb1hEVEU1TVRFek1ERTVORE0xT1Zvd01URVhNQlVHQTFVRQpDaE1PYzNsemRHVnRPbTFoYzNSbGNuTXhGakFVQmdOVkJBTVREVzFwYm1scmRXSmxMWFZ6WlhJd2dnRWlNQTBHCkNTcUdTSWIzRFFFQkFRVUFBNElCRHdBd2dnRUtBb0lCQVFEQWhGc3R1MzFhTGd6ZG5OOFlCSzExbG02cWVWVGIKRDI4eVlrT1g2QjNLY1BjNVlwOGFLWEhCSlpZYkg2Q2Q5TFRuWmNwVmxIck8xUHhiNUlLWkZMUFAxaWRMSEVCcwpLZGx3RCs0NG5PcDNaMW5xZkNvamZ0WG9tR1lnK2lYL1V1VzR2ZjNjUVFwUDdVNWx0WXJrTzlibHBnN2x2LzdXCnlTcnBRaVlRVmNPTFp5N3VpOGFRdzREa0N2QzMyUDg0dFpJamZaczRGV2VaaTF1M1IybVd2ZEYxWXhKRHVISWkKcE56dlZwQUFUSUM0SURwWGwvUEo1TmtkbDVxeHEyQnhTTjMreGZJay9LTEdQbk5UR3VUM1hJNWlmZTNtU0NRSQpYTERRUmNVK2tzaDlOdDhTVkpzV2JSaTAzMForbngxdnZRQ3ZyYlRkRjNnanpIQkRyZy81dTh0RkFnTUJBQUdqClB6QTlNQTRHQTFVZER3RUIvd1FFQXdJRm9EQWRCZ05WSFNVRUZqQVVCZ2dyQmdFRkJRY0RBUVlJS3dZQkJRVUgKQXdJd0RBWURWUjBUQVFIL0JBSXdBREFOQmdrcWhraUc5dzBCQVFzRkFBT0NBUUVBSDYrN1VpUi84QTdadlU3aQpiTC9YY0E2NEpFV3RmREdLUkJ3TTJLNlE5RnlPU2dodlpjTURETERaOVlqeUxjS3h6NjNKTUFoMXphT3ZQeWxFClIrZnFXSVdBcGExRDNrOHdxUThUcFJlOHlRbE05WEtNdldwTzZHNTBSWFRSb0xYMDFwblVIM05pMk5FbElMQnoKK082bWFVbkNVRGJ6WXZzR0tLbHFSQXVHVWpDeDNlQVR5U2YySzRGcUl5OHhzTHVwcFpsdFdjNUc0MjBnT2RSTworNmFqSm52STZidi9SbkhoSWt6bWJ1RHhrU3MzckRLREFBUFdkc2FyNEl3Nkg5Q29KcU1ESmR3blRkcUtWOWNBCnZZaU0zTVV6UEtLcWMrSzhoeTVCR3JHb08zeEk1bVJJR1FDRm01S2MvbkJ1bitxYWt5Ym1HRzgxeld6TjlRWHoKYWlkTThBPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= - client-key-data: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcEFJQkFBS0NBUUVBd0lSYkxidDlXaTRNM1p6ZkdBU3RkWlp1cW5sVTJ3OXZNbUpEbCtnZHluRDNPV0tmCkdpbHh3U1dXR3grZ25mUzA1MlhLVlpSNnp0VDhXK1NDbVJTeno5WW5TeHhBYkNuWmNBL3VPSnpxZDJkWjZud3EKSTM3VjZKaG1JUG9sLzFMbHVMMzkzRUVLVCsxT1piV0s1RHZXNWFZTzViLysxc2txNlVJbUVGWERpMmN1N292RwprTU9BNUFyd3Q5ai9PTFdTSTMyYk9CVm5tWXRidDBkcGxyM1JkV01TUTdoeUlxVGM3MWFRQUV5QXVDQTZWNWZ6CnllVFpIWmVhc2F0Z2NVamQvc1h5SlB5aXhqNXpVeHJrOTF5T1luM3Q1a2drQ0Z5dzBFWEZQcExJZlRiZkVsU2IKRm0wWXROOUdmcDhkYjcwQXI2MjAzUmQ0STh4d1E2NFArYnZMUlFJREFRQUJBb0lCQUFMTDZXY29xaEY5U2NLTwpYTTlFZ2lDTEp1QmpFdEI3ME9teWM3anBMa1dham56TzZmQy9XVitzNUJsUXhFeUhHWG1qQ09WbFdzTldaTFFSCkJiU2prRmtjaTBXVUMzdUd3Qm5Zb1dWQklrYkp3WXllY1I1QzRXaVhqaVE4ZmdEUGUzYkxpN3gvVlY4RDIzZXUKdzIyOVVNblZON0l1cjh6Kzd4aWtWVmszWmJmSXFYUyt6dmt1ZnUzcVpBSDNmQ1NmYjNTM2tFMUtFTnlwVXBMOQpNTXkrNU52SEVoRVQ4WVRYRS82cnRlLzJPalo0VSt3YUtnQ3NROXdvTk1iNjhSczE4S3NOWkZBdHlLQTRVTFE2CjJQMEdnYnNZbzlKNnpwdVFyeHpSbmNaREVGMWtBbEhNN0dxMnIrdDNZQUp6b2xDTGQ5RWh4S1I1TjkyN0FKbm8KWUdEV282RUNnWUVBOGJ0LzM4OU0vTnJ3bngwTk5qdTExUWlkeE9ZMU5rT3REajJSWThvMExlVUs4MjRzaDJ0egorZFhWUk9CNjFFQy9hblZzZ29lMlY2MzhUVW43ZlhWeENUMGllUEVrUndTY2gyZW5mcHZldllqVytrV0tCbzgvCmx1WlA3UXUxZS9JQnJCbmFET20zYWFLdzd2QnFzRGI1cUJQQTU5NExKaU5ST1JMTGdZM2NTcGNDZ1lFQXkrRTYKT3FoVUVOVWVHcWJEc0RoRm9peFpIQUdrZEYzaXo0cjcvdE1TNDJJY2R2NzBvVnl0YjRsekpaQzNSaGdLSGtueAozalc5YTg5UjZJTzZucVBsMk1yRDZiaW8wSFlWMTFZUENlTW9HWS9mTE45L2I2aWh3bUk4STRhSnhPUmlkQmp6CmdWMWFuMjdmOWtIdVRmcjVCOGFHSTRVQVphVmJaVExGK2FoZllJTUNnWUF1Q2lvR3RITFRUZGU2Vmt3bjRpTjEKbVppQzRkMk1va01aalR4ZHB5dGMrbHlsbEh4Q3BvS0dPT1hQb25tQ1ozcU5paVBLa0pKNERKa2JGMVlneFBkcwpiUXBkd24vSVR1YUpHNExaS0ZLNkFvLy9Sck5OSUlkWjlDK1ExRVFTZ1RzMFRoQXJtVy9uWEtjYU93djIxK0dnCjAzSlFOd2dra1dGczMxbUhLVCtsclFLQmdRQ2ZPUUJ1dXZNY1NqUStnQ3FudnVxeTRvdWRFYk5McGQ3eVV3ckcKVWpXWUd4RTc1WlZMUjhPekxkY2RhVTJZa2tHa3NmOFFtVXVibk1mTkhNTnNEWGY5dlMwUHBNVkNPRmFLVzQxWApIVzQ5dUZ5RkFPN1hWdzB0Yitham4vaU1LZ2l4dnFLOVR4anRGbndXS0J0aUR6VFpXN042bmU1WGM3SlM4RG9vCjVkUEczUUtCZ1FEZFNaeHRUeitQR1FKNmxPNVV5MW9HcWo2YlgyemxrM0xxOXA1amdVdW9jNDVCaW1YaVlZVjYKQ2M1MENWRHNqcDZzZjUyRFlTVzRSck4rdG5LOHpYOURFdTR3dG5mL2dHZmRYb1pQTlI4UGcwbkE0ZkxlVWl1TQo0VlNVOUEyWkZmUnNkN3NJNFlOMDMxbGxLcXFrVTBvdUQ5VVYyVlVIZUdPemdVVXl1cSs5Y0E9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo= diff --git a/pkg/api/apis/operators/v1alpha1/clusterserviceversion.go b/pkg/api/apis/operators/v1alpha1/clusterserviceversion.go index e09dfcd908c..8b3a21aa12e 100644 --- a/pkg/api/apis/operators/v1alpha1/clusterserviceversion.go +++ b/pkg/api/apis/operators/v1alpha1/clusterserviceversion.go @@ -1,7 +1,7 @@ package v1alpha1 import ( - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/record" ) diff --git a/pkg/controller/operators/catalog/operator.go b/pkg/controller/operators/catalog/operator.go index 6c0826c9231..c19647594b0 100644 --- a/pkg/controller/operators/catalog/operator.go +++ b/pkg/controller/operators/catalog/operator.go @@ -13,6 +13,7 @@ import ( v1beta1ext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" "k8s.io/client-go/util/workqueue" @@ -23,6 +24,7 @@ import ( olmerrors "github.com/operator-framework/operator-lifecycle-manager/pkg/controller/errors" "github.com/operator-framework/operator-lifecycle-manager/pkg/controller/registry" "github.com/operator-framework/operator-lifecycle-manager/pkg/controller/registry/resolver" + "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/operatorlister" "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/ownerutil" "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/queueinformer" "github.com/operator-framework/operator-lifecycle-manager/pkg/metrics" @@ -46,6 +48,7 @@ var timeNow = func() metav1.Time { return metav1.NewTime(time.Now().UTC()) } type Operator struct { *queueinformer.Operator client versioned.Interface + lister operatorlister.OperatorLister namespace string sources map[registry.ResourceKey]registry.Source sourcesLock sync.RWMutex @@ -67,6 +70,9 @@ func NewOperator(kubeconfigPath string, logger *logrus.Logger, wakeupInterval ti return nil, err } + // Create an OperatorLister + lister := operatorlister.NewLister() + // Create an informer for each watched namespace. ipSharedIndexInformers := []cache.SharedIndexInformer{} subSharedIndexInformers := []cache.SharedIndexInformer{} @@ -74,6 +80,7 @@ func NewOperator(kubeconfigPath string, logger *logrus.Logger, wakeupInterval ti nsInformerFactory := externalversions.NewSharedInformerFactoryWithOptions(crClient, wakeupInterval, externalversions.WithNamespace(namespace)) ipSharedIndexInformers = append(ipSharedIndexInformers, nsInformerFactory.Operators().V1alpha1().InstallPlans().Informer()) subSharedIndexInformers = append(subSharedIndexInformers, nsInformerFactory.Operators().V1alpha1().Subscriptions().Informer()) + lister.OperatorsV1alpha1().RegisterSubscriptionLister(namespace, nsInformerFactory.Operators().V1alpha1().Subscriptions().Lister()) } // Create an informer for each catalog namespace @@ -93,6 +100,7 @@ func NewOperator(kubeconfigPath string, logger *logrus.Logger, wakeupInterval ti op := &Operator{ Operator: queueOperator, client: crClient, + lister: lister, namespace: operatorNamespace, sources: make(map[registry.ResourceKey]registry.Source), dependencyResolver: &resolver.MultiSourceResolver{}, @@ -195,6 +203,28 @@ func (o *Operator) syncCatalogSources(obj interface{}) (syncError error) { o.sources[sourceKey] = src o.sourcesLastUpdate = timeNow() + logger := logrus.WithFields(logrus.Fields{"catalogSource": out.GetName(), "catalogNamespace": out.GetNamespace()}) + + // Sync any dependent Subscriptions + subs, err := o.lister.OperatorsV1alpha1().SubscriptionLister().List(labels.Everything()) + if err != nil { + logger.Warnf("could not list Subscriptions") + return nil + } + + for _, sub := range subs { + subLogger := logger.WithFields(logrus.Fields{"subscriptionCatalogSource": sub.Spec.CatalogSource, "subscriptionCatalogNamespace": sub.Spec.CatalogSourceNamespace}) + catalogNamespace := sub.Spec.CatalogSourceNamespace + if catalogNamespace == "" { + catalogNamespace = o.namespace + } + subLogger.Debug("checking subscription") + if sub.Spec.CatalogSource == out.GetName() && catalogNamespace == out.GetNamespace() { + logger.Debug("requeueing subscription") + o.requeueSubscription(sub.GetName(), sub.GetNamespace()) + } + } + return nil } @@ -241,7 +271,7 @@ func (o *Operator) syncSubscriptions(obj interface{}) (syncError error) { return } -func (o *Operator) requeueInstallPlan(name, namespace string) { +func (o *Operator) requeueSubscription(name, namespace string) { // we can build the key directly, will need to change if queue uses different key scheme key := fmt.Sprintf("%s/%s", namespace, name) o.subQueue.AddRateLimited(key) @@ -276,7 +306,7 @@ func (o *Operator) syncInstallPlans(obj interface{}) (syncError error) { // notify subscription loop of installplan changes if ownerutil.IsOwnedByKind(outInstallPlan, v1alpha1.SubscriptionKind) { oref := ownerutil.GetOwnerByKind(outInstallPlan, v1alpha1.SubscriptionKind) - o.requeueInstallPlan(oref.Name, outInstallPlan.GetNamespace()) + o.requeueSubscription(oref.Name, outInstallPlan.GetNamespace()) } // Update InstallPlan with status of transition. Log errors if we can't write them to the status. diff --git a/pkg/controller/operators/catalog/operator_test.go b/pkg/controller/operators/catalog/operator_test.go index 93ea975ccf0..677e81e973f 100644 --- a/pkg/controller/operators/catalog/operator_test.go +++ b/pkg/controller/operators/catalog/operator_test.go @@ -2,11 +2,12 @@ package catalog import ( "errors" - "github.com/sirupsen/logrus" + "fmt" "testing" + "time" "github.com/ghodss/yaml" - + "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" @@ -15,14 +16,17 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" k8sfake "k8s.io/client-go/kubernetes/fake" + "k8s.io/client-go/tools/cache" apiregistrationfake "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/fake" "github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1" "github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned/fake" + "github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/informers/externalversions" olmerrors "github.com/operator-framework/operator-lifecycle-manager/pkg/controller/errors" "github.com/operator-framework/operator-lifecycle-manager/pkg/controller/registry" "github.com/operator-framework/operator-lifecycle-manager/pkg/controller/registry/resolver" "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/operatorclient" + "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/operatorlister" "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/queueinformer" ) @@ -262,7 +266,9 @@ func TestSyncCatalogSources(t *testing.T) { k8sObjs := []runtime.Object{tt.configMap} // Create test operator - op, err := NewFakeOperator(clientObjs, k8sObjs, nil, nil, resolver, tt.operatorNamespace) + stopCh := make(chan struct{}) + defer func() { stopCh <- struct{}{} }() + op, _, err := NewFakeOperator(clientObjs, k8sObjs, nil, nil, resolver, tt.operatorNamespace, stopCh) require.NoError(t, err) // Run sync @@ -375,7 +381,7 @@ func fakeConfigMapData() map[string]string { } // NewFakeOprator creates a new operator using fake clients -func NewFakeOperator(clientObjs []runtime.Object, k8sObjs []runtime.Object, extObjs []runtime.Object, regObjs []runtime.Object, resolver resolver.DependencyResolver, namespace string) (*Operator, error) { +func NewFakeOperator(clientObjs []runtime.Object, k8sObjs []runtime.Object, extObjs []runtime.Object, regObjs []runtime.Object, resolver resolver.DependencyResolver, namespace string, stopCh <-chan struct{}) (*Operator, []cache.InformerSynced, error) { // Create client fakes clientFake := fake.NewSimpleClientset(clientObjs...) opClientFake := operatorclient.NewClient(k8sfake.NewSimpleClientset(k8sObjs...), apiextensionsfake.NewSimpleClientset(extObjs...), apiregistrationfake.NewSimpleClientset(regObjs...)) @@ -383,7 +389,7 @@ func NewFakeOperator(clientObjs []runtime.Object, k8sObjs []runtime.Object, extO // Create test namespace _, err := opClientFake.KubernetesInterface().CoreV1().Namespaces().Create(&corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: namespace}}) if err != nil { - return nil, err + return nil, nil, err } // Create the new operator @@ -391,12 +397,32 @@ func NewFakeOperator(clientObjs []runtime.Object, k8sObjs []runtime.Object, extO op := &Operator{ Operator: queueOperator, client: clientFake, + lister: operatorlister.NewLister(), namespace: namespace, sources: make(map[registry.ResourceKey]registry.Source), dependencyResolver: resolver, } - return op, nil + // Register informers + wakeupInterval := 5 * time.Minute + informerList := []cache.SharedIndexInformer{} + subscriptionInformer := externalversions.NewSharedInformerFactoryWithOptions(clientFake, wakeupInterval, externalversions.WithNamespace(namespace)).Operators().V1alpha1().Subscriptions() + op.lister.OperatorsV1alpha1().RegisterSubscriptionLister(namespace, subscriptionInformer.Lister()) + informerList = append(informerList, subscriptionInformer.Informer()) + + // Wait for caches to sync + var hasSyncedCheckFns []cache.InformerSynced + for _, informer := range informerList { + op.RegisterInformer(informer) + hasSyncedCheckFns = append(hasSyncedCheckFns, informer.HasSynced) + go informer.Run(stopCh) + } + + if ok := cache.WaitForCacheSync(stopCh, hasSyncedCheckFns...); !ok { + return nil, nil, fmt.Errorf("failed to wait for caches to sync") + } + + return op, hasSyncedCheckFns, nil } func installPlan(names ...string) v1alpha1.InstallPlan { diff --git a/pkg/controller/operators/olm/apiservices.go b/pkg/controller/operators/olm/apiservices.go index 1b1c2273b08..2a3e1e89e08 100644 --- a/pkg/controller/operators/olm/apiservices.go +++ b/pkg/controller/operators/olm/apiservices.go @@ -13,7 +13,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1" - + "github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1" "github.com/operator-framework/operator-lifecycle-manager/pkg/controller/certs" "github.com/operator-framework/operator-lifecycle-manager/pkg/controller/install" diff --git a/pkg/controller/operators/olm/operator_test.go b/pkg/controller/operators/olm/operator_test.go index 0c265fa40c1..abc51024114 100644 --- a/pkg/controller/operators/olm/operator_test.go +++ b/pkg/controller/operators/olm/operator_test.go @@ -2525,9 +2525,6 @@ func TestSyncOperatorGroups(t *testing.T) { op, hasSyncedFns, err := NewFakeOperator(tt.initial.clientObjs, tt.initial.k8sObjs, tt.initial.crds, tt.initial.apis, &install.StrategyResolver{}, namespaces, stopCh) require.NoError(t, err) - ok := cache.WaitForCacheSync(stopCh, hasSyncedFns...) - require.True(t, ok, "wait for cache sync failed") - err = op.syncOperatorGroups(tt.initial.operatorGroup) require.NoError(t, err) @@ -2537,6 +2534,10 @@ func TestSyncOperatorGroups(t *testing.T) { require.NoError(t, err) for _, obj := range opGroupCSVs.Items { + // wait for informers to sync before continuing + ok := cache.WaitForCacheSync(stopCh, hasSyncedFns...) + require.True(t, ok, "wait for cache sync failed") + err = op.syncClusterServiceVersion(&obj) require.NoError(t, err, "%#v", obj) } diff --git a/pkg/controller/operators/olm/requirements.go b/pkg/controller/operators/olm/requirements.go index c9f8746da65..eedcc5a93bc 100644 --- a/pkg/controller/operators/olm/requirements.go +++ b/pkg/controller/operators/olm/requirements.go @@ -3,6 +3,7 @@ package olm import ( "encoding/json" "fmt" + "github.com/sirupsen/logrus" "github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1" diff --git a/pkg/controller/registry/configmap_loader.go b/pkg/controller/registry/configmap_loader.go index 209cbaa8aa5..701f386905e 100644 --- a/pkg/controller/registry/configmap_loader.go +++ b/pkg/controller/registry/configmap_loader.go @@ -6,7 +6,7 @@ import ( "github.com/ghodss/yaml" log "github.com/sirupsen/logrus" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/controller/registry/resolver/resolver_test.go b/pkg/controller/registry/resolver/resolver_test.go index 9ade6a83481..a21b9f59889 100644 --- a/pkg/controller/registry/resolver/resolver_test.go +++ b/pkg/controller/registry/resolver/resolver_test.go @@ -8,7 +8,7 @@ import ( "github.com/operator-framework/operator-lifecycle-manager/pkg/controller/install" log "github.com/sirupsen/logrus" appsv1 "k8s.io/api/apps/v1" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" rbac "k8s.io/api/rbac/v1" "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/lib/event/event.go b/pkg/lib/event/event.go index f6e08175b67..79f73a0d9fc 100644 --- a/pkg/lib/event/event.go +++ b/pkg/lib/event/event.go @@ -2,7 +2,7 @@ package event import ( "github.com/golang/glog" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" typedcorev1 "k8s.io/client-go/kubernetes/typed/core/v1" "k8s.io/client-go/tools/record" diff --git a/pkg/lib/operatorclient/client.go b/pkg/lib/operatorclient/client.go index 7c8173e54b0..8a6ae143560 100644 --- a/pkg/lib/operatorclient/client.go +++ b/pkg/lib/operatorclient/client.go @@ -3,7 +3,7 @@ package operatorclient import ( "github.com/sirupsen/logrus" appsv1 "k8s.io/api/apps/v1" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" apiextensions "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/lib/operatorclient/mock_client.go b/pkg/lib/operatorclient/mock_client.go index 418fc781c82..bb0bd5b7b08 100644 --- a/pkg/lib/operatorclient/mock_client.go +++ b/pkg/lib/operatorclient/mock_client.go @@ -5,6 +5,8 @@ package operatorclient import ( + reflect "reflect" + gomock "github.com/golang/mock/gomock" v1 "k8s.io/api/apps/v1" v10 "k8s.io/api/core/v1" @@ -16,7 +18,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v13 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1" clientset0 "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset" - reflect "reflect" ) // MockClientInterface is a mock of ClientInterface interface diff --git a/pkg/lib/operatorclient/patch.go b/pkg/lib/operatorclient/patch.go index 57122feab58..6c9881fc2ba 100644 --- a/pkg/lib/operatorclient/patch.go +++ b/pkg/lib/operatorclient/patch.go @@ -5,7 +5,7 @@ import ( "fmt" appsv1 "k8s.io/api/apps/v1" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" v1beta1ext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" "k8s.io/apimachinery/pkg/api/meta" diff --git a/pkg/lib/operatorclient/secret.go b/pkg/lib/operatorclient/secret.go index 6658ce27d67..e20d3d8b6f7 100644 --- a/pkg/lib/operatorclient/secret.go +++ b/pkg/lib/operatorclient/secret.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/golang/glog" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) diff --git a/pkg/lib/operatorclient/service.go b/pkg/lib/operatorclient/service.go index 88975a343f3..4491233d788 100644 --- a/pkg/lib/operatorclient/service.go +++ b/pkg/lib/operatorclient/service.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/golang/glog" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) diff --git a/pkg/lib/operatorclient/serviceaccount.go b/pkg/lib/operatorclient/serviceaccount.go index b1575965302..4e6591d5b21 100644 --- a/pkg/lib/operatorclient/serviceaccount.go +++ b/pkg/lib/operatorclient/serviceaccount.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/golang/glog" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) diff --git a/pkg/lib/operatorlister/apiservice.go b/pkg/lib/operatorlister/apiservice.go index b7a8c16867b..5de0879c2a0 100644 --- a/pkg/lib/operatorlister/apiservice.go +++ b/pkg/lib/operatorlister/apiservice.go @@ -5,7 +5,7 @@ import ( "sync" "k8s.io/apimachinery/pkg/labels" - "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1" + v1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1" aregv1 "k8s.io/kube-aggregator/pkg/client/listers/apiregistration/v1" ) diff --git a/pkg/lib/operatorlister/clusterrole.go b/pkg/lib/operatorlister/clusterrole.go index 81ebda03a1d..174ffa1da4a 100644 --- a/pkg/lib/operatorlister/clusterrole.go +++ b/pkg/lib/operatorlister/clusterrole.go @@ -4,7 +4,7 @@ import ( "fmt" "sync" - "k8s.io/api/rbac/v1" + v1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/labels" rbacv1 "k8s.io/client-go/listers/rbac/v1" ) diff --git a/pkg/lib/operatorlister/clusterrolebinding.go b/pkg/lib/operatorlister/clusterrolebinding.go index bf4ca0cbfbc..c0ed5c74455 100644 --- a/pkg/lib/operatorlister/clusterrolebinding.go +++ b/pkg/lib/operatorlister/clusterrolebinding.go @@ -4,7 +4,7 @@ import ( "fmt" "sync" - "k8s.io/api/rbac/v1" + v1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/labels" rbacv1 "k8s.io/client-go/listers/rbac/v1" ) diff --git a/pkg/lib/operatorlister/deployment.go b/pkg/lib/operatorlister/deployment.go index ae514e05de8..af7fea9a7fa 100644 --- a/pkg/lib/operatorlister/deployment.go +++ b/pkg/lib/operatorlister/deployment.go @@ -4,7 +4,7 @@ import ( "fmt" "sync" - "k8s.io/api/apps/v1" + v1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/types" diff --git a/pkg/lib/operatorlister/lister.go b/pkg/lib/operatorlister/lister.go index eec8992a8d7..4f70a0c3270 100644 --- a/pkg/lib/operatorlister/lister.go +++ b/pkg/lib/operatorlister/lister.go @@ -74,8 +74,10 @@ type APIExtensionsV1beta1Lister interface { //go:generate counterfeiter . OperatorsV1alpha1Lister type OperatorsV1alpha1Lister interface { RegisterClusterServiceVersionLister(namespace string, lister v1alpha1.ClusterServiceVersionLister) + RegisterSubscriptionLister(namespace string, lister v1alpha1.SubscriptionLister) ClusterServiceVersionLister() v1alpha1.ClusterServiceVersionLister + SubscriptionLister() v1alpha1.SubscriptionLister } //go:generate counterfeiter . OperatorsV1alpha2Lister @@ -149,11 +151,13 @@ func newAPIExtensionsV1beta1Lister() *apiExtensionsV1beta1Lister { type operatorsV1alpha1Lister struct { clusterServiceVersionLister *UnionClusterServiceVersionLister + subscriptionLister *UnionSubscriptionLister } func newOperatorsV1alpha1Lister() *operatorsV1alpha1Lister { return &operatorsV1alpha1Lister{ clusterServiceVersionLister: &UnionClusterServiceVersionLister{}, + subscriptionLister: &UnionSubscriptionLister{}, } } diff --git a/pkg/lib/operatorlister/namespace.go b/pkg/lib/operatorlister/namespace.go index d949de81684..1aaf302eb91 100644 --- a/pkg/lib/operatorlister/namespace.go +++ b/pkg/lib/operatorlister/namespace.go @@ -4,7 +4,7 @@ import ( "fmt" "sync" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" corev1 "k8s.io/client-go/listers/core/v1" ) diff --git a/pkg/lib/operatorlister/operatorlisterfakes/fake_operators_v1alpha1lister.go b/pkg/lib/operatorlister/operatorlisterfakes/fake_operators_v1alpha1lister.go index eee7e35bd00..71d18d91300 100644 --- a/pkg/lib/operatorlister/operatorlisterfakes/fake_operators_v1alpha1lister.go +++ b/pkg/lib/operatorlister/operatorlisterfakes/fake_operators_v1alpha1lister.go @@ -25,6 +25,22 @@ type FakeOperatorsV1alpha1Lister struct { arg1 string arg2 v1alpha1.ClusterServiceVersionLister } + RegisterSubscriptionListerStub func(string, v1alpha1.SubscriptionLister) + registerSubscriptionListerMutex sync.RWMutex + registerSubscriptionListerArgsForCall []struct { + arg1 string + arg2 v1alpha1.SubscriptionLister + } + SubscriptionListerStub func() v1alpha1.SubscriptionLister + subscriptionListerMutex sync.RWMutex + subscriptionListerArgsForCall []struct { + } + subscriptionListerReturns struct { + result1 v1alpha1.SubscriptionLister + } + subscriptionListerReturnsOnCall map[int]struct { + result1 v1alpha1.SubscriptionLister + } invocations map[string][][]interface{} invocationsMutex sync.RWMutex } @@ -113,6 +129,90 @@ func (fake *FakeOperatorsV1alpha1Lister) RegisterClusterServiceVersionListerArgs return argsForCall.arg1, argsForCall.arg2 } +func (fake *FakeOperatorsV1alpha1Lister) RegisterSubscriptionLister(arg1 string, arg2 v1alpha1.SubscriptionLister) { + fake.registerSubscriptionListerMutex.Lock() + fake.registerSubscriptionListerArgsForCall = append(fake.registerSubscriptionListerArgsForCall, struct { + arg1 string + arg2 v1alpha1.SubscriptionLister + }{arg1, arg2}) + fake.recordInvocation("RegisterSubscriptionLister", []interface{}{arg1, arg2}) + fake.registerSubscriptionListerMutex.Unlock() + if fake.RegisterSubscriptionListerStub != nil { + fake.RegisterSubscriptionListerStub(arg1, arg2) + } +} + +func (fake *FakeOperatorsV1alpha1Lister) RegisterSubscriptionListerCallCount() int { + fake.registerSubscriptionListerMutex.RLock() + defer fake.registerSubscriptionListerMutex.RUnlock() + return len(fake.registerSubscriptionListerArgsForCall) +} + +func (fake *FakeOperatorsV1alpha1Lister) RegisterSubscriptionListerCalls(stub func(string, v1alpha1.SubscriptionLister)) { + fake.registerSubscriptionListerMutex.Lock() + defer fake.registerSubscriptionListerMutex.Unlock() + fake.RegisterSubscriptionListerStub = stub +} + +func (fake *FakeOperatorsV1alpha1Lister) RegisterSubscriptionListerArgsForCall(i int) (string, v1alpha1.SubscriptionLister) { + fake.registerSubscriptionListerMutex.RLock() + defer fake.registerSubscriptionListerMutex.RUnlock() + argsForCall := fake.registerSubscriptionListerArgsForCall[i] + return argsForCall.arg1, argsForCall.arg2 +} + +func (fake *FakeOperatorsV1alpha1Lister) SubscriptionLister() v1alpha1.SubscriptionLister { + fake.subscriptionListerMutex.Lock() + ret, specificReturn := fake.subscriptionListerReturnsOnCall[len(fake.subscriptionListerArgsForCall)] + fake.subscriptionListerArgsForCall = append(fake.subscriptionListerArgsForCall, struct { + }{}) + fake.recordInvocation("SubscriptionLister", []interface{}{}) + fake.subscriptionListerMutex.Unlock() + if fake.SubscriptionListerStub != nil { + return fake.SubscriptionListerStub() + } + if specificReturn { + return ret.result1 + } + fakeReturns := fake.subscriptionListerReturns + return fakeReturns.result1 +} + +func (fake *FakeOperatorsV1alpha1Lister) SubscriptionListerCallCount() int { + fake.subscriptionListerMutex.RLock() + defer fake.subscriptionListerMutex.RUnlock() + return len(fake.subscriptionListerArgsForCall) +} + +func (fake *FakeOperatorsV1alpha1Lister) SubscriptionListerCalls(stub func() v1alpha1.SubscriptionLister) { + fake.subscriptionListerMutex.Lock() + defer fake.subscriptionListerMutex.Unlock() + fake.SubscriptionListerStub = stub +} + +func (fake *FakeOperatorsV1alpha1Lister) SubscriptionListerReturns(result1 v1alpha1.SubscriptionLister) { + fake.subscriptionListerMutex.Lock() + defer fake.subscriptionListerMutex.Unlock() + fake.SubscriptionListerStub = nil + fake.subscriptionListerReturns = struct { + result1 v1alpha1.SubscriptionLister + }{result1} +} + +func (fake *FakeOperatorsV1alpha1Lister) SubscriptionListerReturnsOnCall(i int, result1 v1alpha1.SubscriptionLister) { + fake.subscriptionListerMutex.Lock() + defer fake.subscriptionListerMutex.Unlock() + fake.SubscriptionListerStub = nil + if fake.subscriptionListerReturnsOnCall == nil { + fake.subscriptionListerReturnsOnCall = make(map[int]struct { + result1 v1alpha1.SubscriptionLister + }) + } + fake.subscriptionListerReturnsOnCall[i] = struct { + result1 v1alpha1.SubscriptionLister + }{result1} +} + func (fake *FakeOperatorsV1alpha1Lister) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() @@ -120,6 +220,10 @@ func (fake *FakeOperatorsV1alpha1Lister) Invocations() map[string][][]interface{ defer fake.clusterServiceVersionListerMutex.RUnlock() fake.registerClusterServiceVersionListerMutex.RLock() defer fake.registerClusterServiceVersionListerMutex.RUnlock() + fake.registerSubscriptionListerMutex.RLock() + defer fake.registerSubscriptionListerMutex.RUnlock() + fake.subscriptionListerMutex.RLock() + defer fake.subscriptionListerMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/pkg/lib/operatorlister/role.go b/pkg/lib/operatorlister/role.go index e2161476b60..0bf360ec908 100644 --- a/pkg/lib/operatorlister/role.go +++ b/pkg/lib/operatorlister/role.go @@ -4,7 +4,7 @@ import ( "fmt" "sync" - "k8s.io/api/rbac/v1" + v1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/types" diff --git a/pkg/lib/operatorlister/rolebinding.go b/pkg/lib/operatorlister/rolebinding.go index c5333159fac..2227a1616d7 100644 --- a/pkg/lib/operatorlister/rolebinding.go +++ b/pkg/lib/operatorlister/rolebinding.go @@ -4,7 +4,7 @@ import ( "fmt" "sync" - "k8s.io/api/rbac/v1" + v1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/types" diff --git a/pkg/lib/operatorlister/secret.go b/pkg/lib/operatorlister/secret.go index ffdcbfefabe..b059c7bfc16 100644 --- a/pkg/lib/operatorlister/secret.go +++ b/pkg/lib/operatorlister/secret.go @@ -4,7 +4,7 @@ import ( "fmt" "sync" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/types" diff --git a/pkg/lib/operatorlister/service.go b/pkg/lib/operatorlister/service.go index 1660fac3662..dd8f5a8148f 100644 --- a/pkg/lib/operatorlister/service.go +++ b/pkg/lib/operatorlister/service.go @@ -4,7 +4,7 @@ import ( "fmt" "sync" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/types" diff --git a/pkg/lib/operatorlister/serviceaccount.go b/pkg/lib/operatorlister/serviceaccount.go index f130b311ae9..3ff3cf0b867 100644 --- a/pkg/lib/operatorlister/serviceaccount.go +++ b/pkg/lib/operatorlister/serviceaccount.go @@ -4,7 +4,7 @@ import ( "fmt" "sync" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/types" diff --git a/pkg/lib/operatorlister/subscription.go b/pkg/lib/operatorlister/subscription.go new file mode 100644 index 00000000000..5e3a1a0387b --- /dev/null +++ b/pkg/lib/operatorlister/subscription.go @@ -0,0 +1,96 @@ +package operatorlister + +import ( + "fmt" + "sync" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + + "github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1" + listers "github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/listers/operators/v1alpha1" +) + +type UnionSubscriptionLister struct { + subscriptionListers map[string]listers.SubscriptionLister + subscriptionLock sync.RWMutex +} + +// List lists all Subscriptions in the indexer. +func (usl *UnionSubscriptionLister) List(selector labels.Selector) (ret []*v1alpha1.Subscription, err error) { + usl.subscriptionLock.RLock() + defer usl.subscriptionLock.RUnlock() + + set := make(map[types.UID]*v1alpha1.Subscription) + for _, cl := range usl.subscriptionListers { + subscriptions, err := cl.List(selector) + if err != nil { + return nil, err + } + + for _, subscription := range subscriptions { + set[subscription.GetUID()] = subscription + } + } + + for _, subscription := range set { + ret = append(ret, subscription) + } + + return +} + +// Subscriptions returns an object that can list and get Subscriptions. +func (usl *UnionSubscriptionLister) Subscriptions(namespace string) listers.SubscriptionNamespaceLister { + usl.subscriptionLock.RLock() + defer usl.subscriptionLock.RUnlock() + + // Check for specific namespace listers + if cl, ok := usl.subscriptionListers[namespace]; ok { + return cl.Subscriptions(namespace) + } + + // Check for any namespace-all listers + if cl, ok := usl.subscriptionListers[metav1.NamespaceAll]; ok { + return cl.Subscriptions(namespace) + } + + return &NullSubscriptionNamespaceLister{} +} + +func (usl *UnionSubscriptionLister) RegisterSubscriptionLister(namespace string, lister listers.SubscriptionLister) { + usl.subscriptionLock.Lock() + defer usl.subscriptionLock.Unlock() + + if usl.subscriptionListers == nil { + usl.subscriptionListers = make(map[string]listers.SubscriptionLister) + } + + usl.subscriptionListers[namespace] = lister +} + +func (l *operatorsV1alpha1Lister) RegisterSubscriptionLister(namespace string, lister listers.SubscriptionLister) { + l.subscriptionLister.RegisterSubscriptionLister(namespace, lister) +} + +func (l *operatorsV1alpha1Lister) SubscriptionLister() listers.SubscriptionLister { + return l.subscriptionLister +} + +// NullSubscriptionNamespaceLister is an implementation of a null SubscriptionNamespaceLister. It is +// used to prevent nil pointers when no SubscriptionNamespaceLister has been registered for a given +// namespace. +type NullSubscriptionNamespaceLister struct { + listers.SubscriptionNamespaceLister +} + +// List returns nil and an error explaining that this is a NullSubscriptionNamespaceLister. +func (n *NullSubscriptionNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Subscription, err error) { + return nil, fmt.Errorf("cannot list Subscriptions with a NullSubscriptionNamespaceLister") +} + +// Get returns nil and an error explaining that this is a NullSubscriptionNamespaceLister. +func (n *NullSubscriptionNamespaceLister) Get(name string) (*v1alpha1.Subscription, error) { + return nil, fmt.Errorf("cannot get Subscription with a NullSubscriptionNamespaceLister") +} diff --git a/pkg/lib/ownerutil/util.go b/pkg/lib/ownerutil/util.go index 9ad242462d2..0035fde6f41 100644 --- a/pkg/lib/ownerutil/util.go +++ b/pkg/lib/ownerutil/util.go @@ -2,6 +2,7 @@ package ownerutil import ( "fmt" + "github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1" log "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" diff --git a/pkg/package-server/apis/openapi/zz_generated.openapi.go b/pkg/package-server/apis/openapi/zz_generated.openapi.go index 917717e58c4..403a178453f 100644 --- a/pkg/package-server/apis/openapi/zz_generated.openapi.go +++ b/pkg/package-server/apis/openapi/zz_generated.openapi.go @@ -38,47 +38,47 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/packagemanifest/v1alpha1.PackageManifestList": schema_package_server_apis_packagemanifest_v1alpha1_PackageManifestList(ref), "github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/packagemanifest/v1alpha1.PackageManifestSpec": schema_package_server_apis_packagemanifest_v1alpha1_PackageManifestSpec(ref), "github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/packagemanifest/v1alpha1.PackageManifestStatus": schema_package_server_apis_packagemanifest_v1alpha1_PackageManifestStatus(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup": schema_pkg_apis_meta_v1_APIGroup(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroupList": schema_pkg_apis_meta_v1_APIGroupList(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIResource": schema_pkg_apis_meta_v1_APIResource(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIResourceList": schema_pkg_apis_meta_v1_APIResourceList(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIVersions": schema_pkg_apis_meta_v1_APIVersions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.DeleteOptions": schema_pkg_apis_meta_v1_DeleteOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Duration": schema_pkg_apis_meta_v1_Duration(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ExportOptions": schema_pkg_apis_meta_v1_ExportOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions": schema_pkg_apis_meta_v1_GetOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind": schema_pkg_apis_meta_v1_GroupKind(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupResource": schema_pkg_apis_meta_v1_GroupResource(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersion": schema_pkg_apis_meta_v1_GroupVersion(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery": schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionKind": schema_pkg_apis_meta_v1_GroupVersionKind(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionResource": schema_pkg_apis_meta_v1_GroupVersionResource(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Initializer": schema_pkg_apis_meta_v1_Initializer(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Initializers": schema_pkg_apis_meta_v1_Initializers(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.InternalEvent": schema_pkg_apis_meta_v1_InternalEvent(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector": schema_pkg_apis_meta_v1_LabelSelector(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement": schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.List": schema_pkg_apis_meta_v1_List(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta": schema_pkg_apis_meta_v1_ListMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ListOptions": schema_pkg_apis_meta_v1_ListOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime": schema_pkg_apis_meta_v1_MicroTime(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta": schema_pkg_apis_meta_v1_ObjectMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference": schema_pkg_apis_meta_v1_OwnerReference(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Patch": schema_pkg_apis_meta_v1_Patch(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions": schema_pkg_apis_meta_v1_Preconditions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.RootPaths": schema_pkg_apis_meta_v1_RootPaths(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR": schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Status": schema_pkg_apis_meta_v1_Status(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause": schema_pkg_apis_meta_v1_StatusCause(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails": schema_pkg_apis_meta_v1_StatusDetails(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Time": schema_pkg_apis_meta_v1_Time(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Timestamp": schema_pkg_apis_meta_v1_Timestamp(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta": schema_pkg_apis_meta_v1_TypeMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.WatchEvent": schema_pkg_apis_meta_v1_WatchEvent(ref), - "k8s.io/apimachinery/pkg/runtime.RawExtension": schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref), - "k8s.io/apimachinery/pkg/runtime.TypeMeta": schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref), - "k8s.io/apimachinery/pkg/runtime.Unknown": schema_k8sio_apimachinery_pkg_runtime_Unknown(ref), - "k8s.io/apimachinery/pkg/version.Info": schema_k8sio_apimachinery_pkg_version_Info(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup": schema_pkg_apis_meta_v1_APIGroup(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroupList": schema_pkg_apis_meta_v1_APIGroupList(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIResource": schema_pkg_apis_meta_v1_APIResource(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIResourceList": schema_pkg_apis_meta_v1_APIResourceList(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIVersions": schema_pkg_apis_meta_v1_APIVersions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.DeleteOptions": schema_pkg_apis_meta_v1_DeleteOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Duration": schema_pkg_apis_meta_v1_Duration(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ExportOptions": schema_pkg_apis_meta_v1_ExportOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions": schema_pkg_apis_meta_v1_GetOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind": schema_pkg_apis_meta_v1_GroupKind(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupResource": schema_pkg_apis_meta_v1_GroupResource(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersion": schema_pkg_apis_meta_v1_GroupVersion(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery": schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionKind": schema_pkg_apis_meta_v1_GroupVersionKind(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionResource": schema_pkg_apis_meta_v1_GroupVersionResource(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Initializer": schema_pkg_apis_meta_v1_Initializer(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Initializers": schema_pkg_apis_meta_v1_Initializers(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.InternalEvent": schema_pkg_apis_meta_v1_InternalEvent(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector": schema_pkg_apis_meta_v1_LabelSelector(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement": schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.List": schema_pkg_apis_meta_v1_List(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta": schema_pkg_apis_meta_v1_ListMeta(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ListOptions": schema_pkg_apis_meta_v1_ListOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime": schema_pkg_apis_meta_v1_MicroTime(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta": schema_pkg_apis_meta_v1_ObjectMeta(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference": schema_pkg_apis_meta_v1_OwnerReference(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Patch": schema_pkg_apis_meta_v1_Patch(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions": schema_pkg_apis_meta_v1_Preconditions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.RootPaths": schema_pkg_apis_meta_v1_RootPaths(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR": schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Status": schema_pkg_apis_meta_v1_Status(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause": schema_pkg_apis_meta_v1_StatusCause(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails": schema_pkg_apis_meta_v1_StatusDetails(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Time": schema_pkg_apis_meta_v1_Time(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Timestamp": schema_pkg_apis_meta_v1_Timestamp(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta": schema_pkg_apis_meta_v1_TypeMeta(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.WatchEvent": schema_pkg_apis_meta_v1_WatchEvent(ref), + "k8s.io/apimachinery/pkg/runtime.RawExtension": schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref), + "k8s.io/apimachinery/pkg/runtime.TypeMeta": schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref), + "k8s.io/apimachinery/pkg/runtime.Unknown": schema_k8sio_apimachinery_pkg_runtime_Unknown(ref), + "k8s.io/apimachinery/pkg/version.Info": schema_k8sio_apimachinery_pkg_version_Info(ref), } } diff --git a/pkg/package-server/provider/inmem.go b/pkg/package-server/provider/inmem.go index 7b3bc99c318..b29d9facdc3 100644 --- a/pkg/package-server/provider/inmem.go +++ b/pkg/package-server/provider/inmem.go @@ -197,8 +197,8 @@ func (m *InMemoryProvider) syncCatalogSource(obj interface{}) error { } logger := logrus.WithFields(logrus.Fields{ - "Action": "Sync CatalogSource", - "name": catsrc.GetName(), + "Action": "Sync CatalogSource", + "name": catsrc.GetName(), "namespace": catsrc.GetNamespace(), }) diff --git a/pkg/package-server/storage/packagemanifest/watcher_test.go b/pkg/package-server/storage/packagemanifest/watcher_test.go index 8440e735d8d..5ae8a8961e6 100644 --- a/pkg/package-server/storage/packagemanifest/watcher_test.go +++ b/pkg/package-server/storage/packagemanifest/watcher_test.go @@ -6,7 +6,7 @@ import ( "k8s.io/apimachinery/pkg/labels" "github.com/stretchr/testify/require" - "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/watch" "github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/packagemanifest/v1alpha1" diff --git a/scripts/install_local.sh b/scripts/install_local.sh index 055d4376bae..ffd89620268 100755 --- a/scripts/install_local.sh +++ b/scripts/install_local.sh @@ -28,4 +28,4 @@ done # wait for deployments to be ready kubectl rollout status -w deployment/olm-operator --namespace=${namespace} kubectl rollout status -w deployment/catalog-operator --namespace=${namespace} -kubectl rollout status -w deployment/package-server --namespace=${namespace} +kubectl rollout status -w deployment/packageserver --namespace=${namespace} diff --git a/scripts/run_e2e_docker.sh b/scripts/run_e2e_docker.sh index dad0894083e..08ad3066406 100755 --- a/scripts/run_e2e_docker.sh +++ b/scripts/run_e2e_docker.sh @@ -17,7 +17,7 @@ cp test/e2e/e2e-values.yaml "$test_e2e_config" echo "catalog_namespace: ${namespace}"; echo "operator_namespace: ${operator_namespace}"; } >> "$test_e2e_config" -./scripts/package-release.sh 1.0.0-e2e test/e2e/resources "$test_e2e_config" +./scripts/package-release.sh 1.0.0 test/e2e/resources "$test_e2e_config" function cleanup { for resource in test/e2e/test-resources/*.yaml; do diff --git a/scripts/run_e2e_local.sh b/scripts/run_e2e_local.sh index f311c5ee6e5..192eab499ee 100755 --- a/scripts/run_e2e_local.sh +++ b/scripts/run_e2e_local.sh @@ -18,7 +18,7 @@ cp test/e2e/e2e-values.yaml "$test_e2e_config" echo "catalog_namespace: ${namespace}"; echo "operator_namespace: ${operator_namespace}"; } >> "$test_e2e_config" -./scripts/package-release.sh 1.0.0-e2e test/e2e/resources "$test_e2e_config" +./scripts/package-release.sh 1.0.0 test/e2e/resources "$test_e2e_config" function cleanup { for resource in test/e2e/resources/*.yaml; do @@ -35,7 +35,7 @@ function cleanupAndExit { echo "error running tests. logs written to olm.log, catalog.log, and package.log"; kubectl -n "${namespace}" logs -l app=olm-operator > olm.log; kubectl -n "${namespace}" logs -l app=catalog-operator > catalog.log; - kubectl -n "${namespace}" logs -l app=package-server > package.log + kubectl -n "${namespace}" logs -l app=packageserver > package.log else cleanup fi diff --git a/test/e2e/csv_e2e_test.go b/test/e2e/csv_e2e_test.go index 19293880c99..59940136ba5 100644 --- a/test/e2e/csv_e2e_test.go +++ b/test/e2e/csv_e2e_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/require" appsv1 "k8s.io/api/apps/v1" - "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" extv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -619,10 +619,10 @@ func TestCreateCSVRequirementsMetCRD(t *testing.T) { }, } crd.SetOwnerReferences([]metav1.OwnerReference{{ - Name: fetchedCSV.GetName(), + Name: fetchedCSV.GetName(), APIVersion: v1alpha1.ClusterServiceVersionAPIVersion, - Kind: v1alpha1.ClusterServiceVersionKind, - UID: fetchedCSV.GetUID(), + Kind: v1alpha1.ClusterServiceVersionKind, + UID: fetchedCSV.GetUID(), }}) cleanupCRD, err := createCRD(c, crd) defer cleanupCRD() @@ -922,7 +922,7 @@ func TestCreateCSVWithOwnedAPIService(t *testing.T) { owned := make([]v1alpha1.APIServiceDescription, len(mockKinds)) for i, kind := range mockKinds { owned[i] = v1alpha1.APIServiceDescription{ - Name: apiServiceName, + Name: apiServiceName, Group: mockGroup, Version: version, Kind: kind, diff --git a/test/e2e/packagemanifest_e2e_test.go b/test/e2e/packagemanifest_e2e_test.go index 8583dc31100..4ca228eaf75 100644 --- a/test/e2e/packagemanifest_e2e_test.go +++ b/test/e2e/packagemanifest_e2e_test.go @@ -84,8 +84,8 @@ func TestPackageManifestLoading(t *testing.T) { } watcher, err := pmc.PackagemanifestV1alpha1().PackageManifests(testNamespace).Watch(metav1.ListOptions{}) - defer watcher.Stop() require.NoError(t, err) + defer watcher.Stop() receivedPackage := make(chan bool) go func() { event := <-watcher.ResultChan() diff --git a/test/e2e/util_test.go b/test/e2e/util_test.go index 2aa52ec2c33..94776555ab3 100644 --- a/test/e2e/util_test.go +++ b/test/e2e/util_test.go @@ -39,18 +39,19 @@ const ( expectedEtcdNodes = 3 expectedPrometheusSize = 3 ocsConfigMap = "rh-operators" - packageServerCSV = "packageserver.v8.0.0" + olmConfigMap = "olm-operators" + packageServerCSV = "packageserver.v1.0.0" ) var ( cleaner *namespaceCleaner genName = names.SimpleNameGenerator.GenerateName - persistentCatalogNames = []string{ocsConfigMap} + persistentCatalogNames = []string{ocsConfigMap, olmConfigMap} nonPersistentCatalogsFieldSelector = createFieldNotEqualSelector("metadata.name", persistentCatalogNames...) - persistentConfigMapNames = []string{ocsConfigMap} + persistentConfigMapNames = []string{ocsConfigMap, olmConfigMap} nonPersistentConfigMapsFieldSelector = createFieldNotEqualSelector("metadata.name", persistentConfigMapNames...) - persistentCSVNames = []string{packageServerCSV} + persistentCSVNames = []string{packageServerCSV} nonPersistentCSVFieldSelector = createFieldNotEqualSelector("metadata.name", persistentCSVNames...) ) diff --git a/test/schema/catalog_versions_test.go b/test/schema/catalog_versions_test.go index 680c52c5488..3ba7ee43794 100644 --- a/test/schema/catalog_versions_test.go +++ b/test/schema/catalog_versions_test.go @@ -16,7 +16,7 @@ import ( "github.com/operator-framework/operator-lifecycle-manager/pkg/controller/registry" "github.com/operator-framework/operator-lifecycle-manager/pkg/controller/registry/resolver" "github.com/stretchr/testify/require" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/tools.go b/tools.go index 31330f5dcb3..c853201e6d1 100644 --- a/tools.go +++ b/tools.go @@ -3,18 +3,17 @@ package tools import ( - _ "github.com/golang/mock/mockgen" - _ "github.com/maxbrunsfeld/counterfeiter" - _ "k8s.io/code-generator/cmd/client-gen" - _ "k8s.io/code-generator/cmd/conversion-gen/" - _ "k8s.io/code-generator/cmd/deepcopy-gen" - _ "k8s.io/code-generator/cmd/defaulter-gen" - _ "k8s.io/code-generator/cmd/go-to-protobuf" - _ "k8s.io/code-generator/cmd/import-boss" - _ "k8s.io/code-generator/cmd/informer-gen" - _ "k8s.io/code-generator/cmd/lister-gen" - _ "k8s.io/code-generator/cmd/openapi-gen" - _ "k8s.io/code-generator/cmd/set-gen" - _ "k8s.io/kube-openapi/cmd/openapi-gen" + _ "github.com/golang/mock/mockgen" + _ "github.com/maxbrunsfeld/counterfeiter" + _ "k8s.io/code-generator/cmd/client-gen" + _ "k8s.io/code-generator/cmd/conversion-gen/" + _ "k8s.io/code-generator/cmd/deepcopy-gen" + _ "k8s.io/code-generator/cmd/defaulter-gen" + _ "k8s.io/code-generator/cmd/go-to-protobuf" + _ "k8s.io/code-generator/cmd/import-boss" + _ "k8s.io/code-generator/cmd/informer-gen" + _ "k8s.io/code-generator/cmd/lister-gen" + _ "k8s.io/code-generator/cmd/openapi-gen" + _ "k8s.io/code-generator/cmd/set-gen" + _ "k8s.io/kube-openapi/cmd/openapi-gen" ) -