diff --git a/Makefile b/Makefile index c5cee6fcca..1c66cd386c 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +include operatorhub/Makefile + MODULE = $(shell env GO111MODULE=on $(GO) list -m) DATE ?= $(shell date +%FT%T%z) KO_DATA_PATH = $(shell pwd)/cmd/$(TARGET)/operator/kodata @@ -109,20 +111,3 @@ generated: | vendor ; $(info $(M) update generated files) ## Update generated fi vendor: ; $(info $(M) update vendor folder) ## Update vendor folder $Q ./hack/update-deps.sh -.PHONY: bundlegen -bundlegen: - mkdir csv-stub - kustomize build ../../config/olm-csv-stubs/overlays/openshift > csv-stub/csv-stub.yaml - pwd - kustomize build ../../config/olm-bundle-config/openshift | operator-sdk generate bundle \ - --channels stable,preview \ - --default-channel stable \ - --kustomize-dir csv-stub \ - --overwrite \ - --package openshift-pipelines-operator-rh \ - --version 0.22.0-1 - rm -rf csv-stub - - -bundle: - $(MAKE) -C operatorhub/openshift --file ../../Makefile bundlegen diff --git a/config/base/kustomization.yaml b/config/base/kustomization.yaml index 18b19ed460..0216c2f656 100644 --- a/config/base/kustomization.yaml +++ b/config/base/kustomization.yaml @@ -18,7 +18,6 @@ resources: - 300-operator_v1alpha1_pipeline_crd.yaml - 300-operator_v1alpha1_trigger_crd.yaml - 300-operator_v1alpha1_config_crd.yaml -- 300-operator_v1alpha1_result_crd.yaml - 500-webhooks.yaml - config-logging.yaml - tekton-config-defaults.yaml diff --git a/config/crs/kubernetes/kustomization.yaml b/config/crs/kubernetes/kustomization.yaml index 42a1b6e6f5..e18048c610 100644 --- a/config/crs/kubernetes/kustomization.yaml +++ b/config/crs/kubernetes/kustomization.yaml @@ -2,6 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - dashboard/operator_v1alpha1_dashboard_cr.yaml +- result/operator_v1alpha1_result_cr.yaml - pipeline/operator_v1alpha1_pipeline_cr.yaml - trigger/operator_v1alpha1_trigger_cr.yaml - config/all/operator_v1alpha1_config_cr.yaml diff --git a/config/kubernetes/kustomization.yaml b/config/kubernetes/kustomization.yaml index 5642a650cd..9dadb893eb 100644 --- a/config/kubernetes/kustomization.yaml +++ b/config/kubernetes/kustomization.yaml @@ -33,4 +33,5 @@ kind: Kustomization resources: - ../base/ - ../base/300-operator_v1alpha1_dashboard_crd.yaml +- ../base/300-operator_v1alpha1_result_crd.yaml - service_account.yaml diff --git a/config/kubernetes/operator.yaml b/config/kubernetes/operator.yaml index 988a4b76d5..614b570f0c 100644 --- a/config/kubernetes/operator.yaml +++ b/config/kubernetes/operator.yaml @@ -44,6 +44,6 @@ spec: - name: OPERATOR_NAME value: "tekton-operator" - name: IMAGE_PIPELINES_PROXY - value: ko://github.com/tektoncd/operator/cmd/kubernetes/proxy-webhook + value: ko://github.com/tektoncd/operator/cmd/kubernetes/proxy-webhook - name: IMAGE_JOB_PRUNER_TKN value: gcr.io/tekton-releases/dogfooding/tkn@sha256:f69a02ef099d8915e9e4ea1b74e43b7a9309fc97cf23cb457ebf191e73491677 diff --git a/operatorhub/Makefile b/operatorhub/Makefile new file mode 100644 index 0000000000..90159db27f --- /dev/null +++ b/operatorhub/Makefile @@ -0,0 +1,12 @@ +BUNDLE_ARGS := $(or ${BUNDLE_ARGS},--help) + +OPERATOR_SDK = $(or ${OPERATOR_SDK_BIN},$(BIN)/operator-sdk) + +$(BIN)/operator-sdk: | $(BIN) ; $(info $(M) getting operator-sdk) + ls $(BIN) + @./operatorhub/tools/install_operator-sdk.sh $(BIN) + +.PHONY: operator-bundle +operator-bundle: | $(OPERATOR_SDK) + @$(info BUNDLE_ARGS: $(BUNDLE_ARGS)) + @OPERATOR_SDK=$(OPERATOR_SDK) operatorhub/tools/bundle.py ${BUNDLE_ARGS} diff --git a/operatorhub/README.md b/operatorhub/README.md new file mode 100644 index 0000000000..5098a217fe --- /dev/null +++ b/operatorhub/README.md @@ -0,0 +1,9 @@ +# Generating Bundles (release artifact) for OperatorHub + +1. From project root run: + +```bash +export BUNDLE_ARGS="--workspace=operatorhub/kubernetes --operator-release-version=1.1.1 --channels=a,b --default-channel=a --fetch-strategy-local --upgrade-strategy-semver" +make bundle +``` + diff --git a/operatorhub/kubernetes/release-artifacts/bundle.Dockerfile b/operatorhub/kubernetes/release-artifacts/bundle.Dockerfile index 7783e36ad8..9d63677826 100644 --- a/operatorhub/kubernetes/release-artifacts/bundle.Dockerfile +++ b/operatorhub/kubernetes/release-artifacts/bundle.Dockerfile @@ -7,7 +7,7 @@ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ LABEL operators.operatorframework.io.bundle.package.v1=tektoncd-operator LABEL operators.operatorframework.io.bundle.channels.v1=a,b LABEL operators.operatorframework.io.bundle.channel.default.v1=a -LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.8.0 +LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.7.1+git LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 LABEL operators.operatorframework.io.metrics.project_layout=unknown diff --git a/operatorhub/kubernetes/release-artifacts/bundle/manifests/operator.tekton.dev_tektonconfigs.yaml b/operatorhub/kubernetes/release-artifacts/bundle/manifests/operator.tekton.dev_tektonconfigs.yaml index d61f177746..5173bfcbe2 100644 --- a/operatorhub/kubernetes/release-artifacts/bundle/manifests/operator.tekton.dev_tektonconfigs.yaml +++ b/operatorhub/kubernetes/release-artifacts/bundle/manifests/operator.tekton.dev_tektonconfigs.yaml @@ -4,7 +4,7 @@ metadata: creationTimestamp: null labels: operator.tekton.dev/release: devel - version: 0.24.1-1 + version: devel name: tektonconfigs.operator.tekton.dev spec: group: operator.tekton.dev @@ -26,80 +26,8 @@ spec: schema: openAPIV3Schema: description: Schema for the tektonconfigs API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec defines the desired state of TektonConfig - properties: - profile: - description: based on the type of profile where tekton components - will be installed - type: string - targetNamespace: - description: namespace where tekton components will be installed - type: string - type: object - status: - description: Status defines the observed state of TektonConfig - properties: - conditions: - description: The latest available observations of a resource's current - state. - items: - properties: - lastTransitionTime: - description: LastTransitionTime is the last time the condition - transitioned from one status to another. We use VolatileTime - in place of metav1.Time to exclude this from creating equality.Semantic - differences (all other things held constant). - type: string - message: - description: A human readable message indicating details about - the transition. - type: string - reason: - description: The reason for the condition's last transition. - type: string - severity: - description: Severity with which to treat failures of this type - of condition. When this is not specified, it defaults to Error. - type: string - status: - description: Status of the condition, one of True, False, Unknown. - type: string - type: - description: Type of condition. - type: string - required: - - type - - status - type: object - type: array - manifests: - description: The list of tektonconfig manifests, which have been installed - by the operator - items: - type: string - type: array - observedGeneration: - description: The generation last processed by the controller - type: integer - version: - description: The version of the installed release - type: string - type: object type: object + x-kubernetes-preserve-unknown-fields: true served: true storage: true subresources: diff --git a/operatorhub/kubernetes/release-artifacts/bundle/manifests/operator.tekton.dev_tektondashboards.yaml b/operatorhub/kubernetes/release-artifacts/bundle/manifests/operator.tekton.dev_tektondashboards.yaml index 1d026ada48..191cbab2b1 100644 --- a/operatorhub/kubernetes/release-artifacts/bundle/manifests/operator.tekton.dev_tektondashboards.yaml +++ b/operatorhub/kubernetes/release-artifacts/bundle/manifests/operator.tekton.dev_tektondashboards.yaml @@ -4,7 +4,7 @@ metadata: creationTimestamp: null labels: operator.tekton.dev/release: devel - version: 0.24.1-1 + version: devel name: tektondashboards.operator.tekton.dev spec: group: operator.tekton.dev @@ -29,76 +29,8 @@ spec: schema: openAPIV3Schema: description: Schema for the tektondashboards API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec defines the desired state of TektonDashboard - properties: - targetNamespace: - description: namespace where tekton dashboard will be installed - type: string - type: object - status: - description: Status defines the observed state of TektonDashboard - properties: - conditions: - description: The latest available observations of a resource's current - state. - items: - properties: - lastTransitionTime: - description: LastTransitionTime is the last time the condition - transitioned from one status to another. We use VolatileTime - in place of metav1.Time to exclude this from creating equality.Semantic - differences (all other things held constant). - type: string - message: - description: A human readable message indicating details about - the transition. - type: string - reason: - description: The reason for the condition's last transition. - type: string - severity: - description: Severity with which to treat failures of this type - of condition. When this is not specified, it defaults to Error. - type: string - status: - description: Status of the condition, one of True, False, Unknown. - type: string - type: - description: Type of condition. - type: string - required: - - type - - status - type: object - type: array - manifests: - description: The list of dashboard manifests, which have been installed - by the operator - items: - type: string - type: array - observedGeneration: - description: The generation last processed by the controller - type: integer - version: - description: The version of the installed release - type: string - type: object type: object + x-kubernetes-preserve-unknown-fields: true served: true storage: true subresources: diff --git a/operatorhub/kubernetes/release-artifacts/bundle/manifests/operator.tekton.dev_tektonpipelines.yaml b/operatorhub/kubernetes/release-artifacts/bundle/manifests/operator.tekton.dev_tektonpipelines.yaml index 31b57f6a9a..5be41d4cee 100644 --- a/operatorhub/kubernetes/release-artifacts/bundle/manifests/operator.tekton.dev_tektonpipelines.yaml +++ b/operatorhub/kubernetes/release-artifacts/bundle/manifests/operator.tekton.dev_tektonpipelines.yaml @@ -4,7 +4,7 @@ metadata: creationTimestamp: null labels: operator.tekton.dev/release: devel - version: 0.24.1-1 + version: devel name: tektonpipelines.operator.tekton.dev spec: group: operator.tekton.dev @@ -29,76 +29,8 @@ spec: schema: openAPIV3Schema: description: Schema for the tektonpipelines API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec defines the desired state of TektonPipeline - properties: - targetNamespace: - description: namespace where tekton pipelines will be installed - type: string - type: object - status: - description: Status defines the observed state of TektonPipeline - properties: - conditions: - description: The latest available observations of a resource's current - state. - items: - properties: - lastTransitionTime: - description: LastTransitionTime is the last time the condition - transitioned from one status to another. We use VolatileTime - in place of metav1.Time to exclude this from creating equality.Semantic - differences (all other things held constant). - type: string - message: - description: A human readable message indicating details about - the transition. - type: string - reason: - description: The reason for the condition's last transition. - type: string - severity: - description: Severity with which to treat failures of this type - of condition. When this is not specified, it defaults to Error. - type: string - status: - description: Status of the condition, one of True, False, Unknown. - type: string - type: - description: Type of condition. - type: string - required: - - type - - status - type: object - type: array - manifests: - description: The list of pipeline manifests, which have been installed - by the operator - items: - type: string - type: array - observedGeneration: - description: The generation last processed by the controller - type: integer - version: - description: The version of the installed release - type: string - type: object type: object + x-kubernetes-preserve-unknown-fields: true served: true storage: true subresources: diff --git a/operatorhub/kubernetes/release-artifacts/bundle/manifests/operator.tekton.dev_tektonresults.yaml b/operatorhub/kubernetes/release-artifacts/bundle/manifests/operator.tekton.dev_tektonresults.yaml new file mode 100644 index 0000000000..8c2a73726b --- /dev/null +++ b/operatorhub/kubernetes/release-artifacts/bundle/manifests/operator.tekton.dev_tektonresults.yaml @@ -0,0 +1,111 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + labels: + operator.tekton.dev/release: devel + version: devel + name: tektonresults.operator.tekton.dev +spec: + group: operator.tekton.dev + names: + kind: TektonResult + listKind: TektonResultList + plural: tektonresults + singular: tektonresult + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.version + name: Version + type: string + - jsonPath: .status.conditions[?(@.type=="Ready")].status + name: Ready + type: string + - jsonPath: .status.conditions[?(@.type=="Ready")].reason + name: Reason + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: Schema for the tektonresults API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/ api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec defines the desired state of TektonResult + properties: + targetNamespace: + description: namespace where tekton results will be installed + type: string + type: object + status: + description: Status defines the observed state of TektonResult + properties: + conditions: + description: The latest available observations of a resource's current + state. + items: + properties: + lastTransitionTime: + description: LastTransitionTime is the last time the condition + transitioned from one status to another. We use VolatileTime + in place of metav1.Time to exclude this from creating equality.Semantic + differences (all other things held constant). + type: string + message: + description: A human readable message indicating details about + the transition. + type: string + reason: + description: The reason for the condition's last transition. + type: string + severity: + description: Severity with which to treat failures of this type + of condition. When this is not specified, it defaults to Error. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: Type of condition. + type: string + required: + - type + - status + type: object + type: array + manifests: + description: The list of results manifests, which have been installed + by the operator + items: + type: string + type: array + observedGeneration: + description: The generation last processed by the controller + type: integer + version: + description: The version of the installed release + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null diff --git a/operatorhub/kubernetes/release-artifacts/bundle/manifests/operator.tekton.dev_tektontriggers.yaml b/operatorhub/kubernetes/release-artifacts/bundle/manifests/operator.tekton.dev_tektontriggers.yaml index 3d0af8c8db..3fdc433a51 100644 --- a/operatorhub/kubernetes/release-artifacts/bundle/manifests/operator.tekton.dev_tektontriggers.yaml +++ b/operatorhub/kubernetes/release-artifacts/bundle/manifests/operator.tekton.dev_tektontriggers.yaml @@ -4,7 +4,7 @@ metadata: creationTimestamp: null labels: operator.tekton.dev/release: devel - version: 0.24.1-1 + version: devel name: tektontriggers.operator.tekton.dev spec: group: operator.tekton.dev @@ -29,76 +29,8 @@ spec: schema: openAPIV3Schema: description: Schema for the tektontriggers API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec defines the desired state of TektonTrigger - properties: - targetNamespace: - description: namespace where tekton triggers will be installed - type: string - type: object - status: - description: Status defines the observed state of TektonTrigger - properties: - conditions: - description: The latest available observations of a resource's current - state. - items: - properties: - lastTransitionTime: - description: LastTransitionTime is the last time the condition - transitioned from one status to another. We use VolatileTime - in place of metav1.Time to exclude this from creating equality.Semantic - differences (all other things held constant). - type: string - message: - description: A human readable message indicating details about - the transition. - type: string - reason: - description: The reason for the condition's last transition. - type: string - severity: - description: Severity with which to treat failures of this type - of condition. When this is not specified, it defaults to Error. - type: string - status: - description: Status of the condition, one of True, False, Unknown. - type: string - type: - description: Type of condition. - type: string - required: - - type - - status - type: object - type: array - manifests: - description: The list of trigger manifests, which have been installed - by the operator - items: - type: string - type: array - observedGeneration: - description: The generation last processed by the controller - type: integer - version: - description: The version of the installed release - type: string - type: object type: object + x-kubernetes-preserve-unknown-fields: true served: true storage: true subresources: diff --git a/operatorhub/kubernetes/release-artifacts/bundle/manifests/tekton-config-defaults_v1_configmap.yaml b/operatorhub/kubernetes/release-artifacts/bundle/manifests/tekton-config-defaults_v1_configmap.yaml index 4a0e468705..883e5fc579 100644 --- a/operatorhub/kubernetes/release-artifacts/bundle/manifests/tekton-config-defaults_v1_configmap.yaml +++ b/operatorhub/kubernetes/release-artifacts/bundle/manifests/tekton-config-defaults_v1_configmap.yaml @@ -4,7 +4,6 @@ data: DEFAULT_TARGET_NAMESPACE: tekton-pipelines kind: ConfigMap metadata: - annotations: {} labels: operator.tekton.dev/release: devel name: tekton-config-defaults diff --git a/operatorhub/kubernetes/release-artifacts/bundle/manifests/tekton-operator-webhook-certs_v1_secret.yaml b/operatorhub/kubernetes/release-artifacts/bundle/manifests/tekton-operator-webhook-certs_v1_secret.yaml new file mode 100644 index 0000000000..47978f368e --- /dev/null +++ b/operatorhub/kubernetes/release-artifacts/bundle/manifests/tekton-operator-webhook-certs_v1_secret.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Secret +metadata: + labels: + app: tekton-operator + name: tekton-operator-webhook + name: tekton-operator-webhook-certs diff --git a/operatorhub/kubernetes/release-artifacts/bundle/manifests/tekton-operator-webhook_v1_service.yaml b/operatorhub/kubernetes/release-artifacts/bundle/manifests/tekton-operator-webhook_v1_service.yaml new file mode 100644 index 0000000000..1189dadb70 --- /dev/null +++ b/operatorhub/kubernetes/release-artifacts/bundle/manifests/tekton-operator-webhook_v1_service.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Service +metadata: + creationTimestamp: null + labels: + app: tekton-operator + name: tekton-operator-webhook + operator.tekton.dev/release: devel + version: devel + name: tekton-operator-webhook +spec: + ports: + - name: https-webhook + port: 443 + targetPort: 8443 + selector: + app: tekton-operator + name: tekton-operator-webhook +status: + loadBalancer: {} diff --git a/operatorhub/kubernetes/release-artifacts/bundle/manifests/tektoncd-operator.clusterserviceversion.yaml b/operatorhub/kubernetes/release-artifacts/bundle/manifests/tektoncd-operator.clusterserviceversion.yaml index 1c86c640f5..2ee03f9442 100644 --- a/operatorhub/kubernetes/release-artifacts/bundle/manifests/tektoncd-operator.clusterserviceversion.yaml +++ b/operatorhub/kubernetes/release-artifacts/bundle/manifests/tektoncd-operator.clusterserviceversion.yaml @@ -12,7 +12,10 @@ metadata: \ \"kind\": \"TektonPipeline\",\n \"metadata\": {\n \"name\": \"\ pipeline\"\n },\n \"spec\": {\n \"targetNamespace\": \"tekton-pipelines\"\ \n }\n },\n {\n \"apiVersion\": \"operator.tekton.dev/v1alpha1\",\n\ - \ \"kind\": \"TektonTrigger\",\n \"metadata\": {\n \"name\": \"trigger\"\ + \ \"kind\": \"TektonResult\",\n \"metadata\": {\n \"name\": \"result\"\ + \n },\n \"spec\": {\n \"targetNamespace\": \"tekton-pipelines\"\n\ + \ }\n },\n {\n \"apiVersion\": \"operator.tekton.dev/v1alpha1\",\n \ + \ \"kind\": \"TektonTrigger\",\n \"metadata\": {\n \"name\": \"trigger\"\ \n },\n \"spec\": {\n \"targetNamespace\": \"tekton-pipelines\"\n\ \ }\n }\n]" capabilities: Basic Install @@ -20,11 +23,11 @@ metadata: certified: 'false' description: Tekton Pipelines is a Kubernetes-Native CI/CD solution for building CI/CD pipelines. - operators.operatorframework.io/builder: operator-sdk-v1.8.0 + operators.operatorframework.io/builder: operator-sdk-v1.7.1+git operators.operatorframework.io/project_layout: unknown repository: https://github.com/tektoncd/operator support: The Tetkon Authors - name: tektoncd-operator.v1.2.3 + name: tektoncd-operator.v1.1.1 namespace: placeholder spec: apiservicedefinitions: {} @@ -77,6 +80,9 @@ spec: kind: TektonPipeline name: tektonpipelines.operator.tekton.dev version: v1alpha1 + - kind: TektonResult + name: tektonresults.operator.tekton.dev + version: v1alpha1 - description: 'TektonTrigger installs Tekton Triggers on a cluster. The operator installs Tekton Triggers on a cluster @@ -576,6 +582,49 @@ spec: - deletecollection - patch - watch + - apiGroups: + - batch + resources: + - cronjobs + verbs: + - delete + - create + - patch + - get + - list + - update + - watch + - apiGroups: + - admissionregistration.k8s.io + resources: + - mutatingwebhookconfigurations + - validatingwebhookconfigurations + verbs: + - delete + - create + - patch + - get + - list + - update + - watch + - apiGroups: + - authentication.k8s.io + resources: + - tokenreviews + verbs: + - create + - apiGroups: + - authorization.k8s.io + resources: + - subjectaccessreviews + verbs: + - create + - apiGroups: + - results.tekton.dev + resources: + - '*' + verbs: + - '*' serviceAccountName: tekton-operator deployments: - name: tekton-operator @@ -593,8 +642,6 @@ spec: spec: containers: - env: - - name: IMAGE_PIPELINES_PROXY - value: gcr.io/tekton-releases/github.com/tektoncd/operator/cmd/kubernetes/webhook@sha256:2dd7d2670830c805e523c5f383b11c69682eaa802f663ba8f93698f5f5d67aa3 - name: SYSTEM_NAMESPACE valueFrom: fieldRef: @@ -605,21 +652,47 @@ spec: fieldPath: metadata.name - name: OPERATOR_NAME value: tekton-operator - - name: AUTOINSTALL_COMPONENTS - valueFrom: - configMapKeyRef: - key: AUTOINSTALL_COMPONENTS - name: tekton-config-defaults - - name: DEFAULT_TARGET_NAMESPACE - valueFrom: - configMapKeyRef: - key: DEFAULT_TARGET_NAMESPACE - name: tekton-config-defaults - image: gcr.io/tekton-releases/github.com/tektoncd/operator/cmd/kubernetes/operator@sha256:7e55e79a3da2fe96a61af5731abab59eb8fb33c4024e9975a391797ed7ca05dc + - name: IMAGE_PIPELINES_PROXY + value: ko://github.com/tektoncd/operator/cmd/kubernetes/webhook:develEnv + - name: IMAGE_JOB_PRUNER_TKN + value: gcr.io/tekton-releases/dogfooding/tkn@sha256:f69a02ef099d8915e9e4ea1b74e43b7a9309fc97cf23cb457ebf191e73491677DEVEL + image: ko://github.com/tektoncd/operator/cmd/kubernetes/operator:develContainer imagePullPolicy: Always name: tekton-operator resources: {} serviceAccountName: tekton-operator + - name: tekton-operator-webhook + spec: + replicas: 1 + selector: + matchLabels: + name: tekton-operator-webhook + strategy: {} + template: + metadata: + labels: + app: tekton-operator + name: tekton-operator-webhook + spec: + containers: + - env: + - name: SYSTEM_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: CONFIG_LOGGING_NAME + value: config-logging + - name: WEBHOOK_SERVICE_NAME + value: tekton-operator-webhook + - name: WEBHOOK_SECRET_NAME + value: tekton-operator-webhook-certs + image: ko://github.com/tektoncd/operator/cmd/kubernetes/webhook + name: tekton-operator-webhook + ports: + - containerPort: 8443 + name: https-webhook + resources: {} + serviceAccountName: tekton-operator strategy: deployment installModes: - supported: false @@ -651,4 +724,44 @@ spec: maturity: alpha provider: name: The Tekton Authors - version: 1.2.3 + relatedImages: + - image: ko://github.com/tektoncd/operator/cmd/kubernetes/operator:develContainer + name: TEKTON_OPERATOR + - image: ko://github.com/tektoncd/operator/cmd/kubernetes/webhook:develEnv + name: IMAGE_PIPELINES_PROXY + - image: gcr.io/tekton-releases/dogfooding/tkn@sha256:f69a02ef099d8915e9e4ea1b74e43b7a9309fc97cf23cb457ebf191e73491677DEVEL + name: IMAGE_JOB_PRUNER_TKN + - image: ko://github.com/tektoncd/operator/cmd/kubernetes/webhook + name: TEKTON_OPERATOR_WEBHOOK + version: 1.1.1 + webhookdefinitions: + - admissionReviewVersions: + - v1beta1 + - v1 + containerPort: 443 + deploymentName: tekton-operator-webhook + failurePolicy: Fail + generateName: config.webhook.operator.tekton.dev + sideEffects: None + targetPort: 8443 + type: ValidatingAdmissionWebhook + - admissionReviewVersions: + - v1beta1 + - v1 + containerPort: 443 + deploymentName: tekton-operator-webhook + failurePolicy: Fail + generateName: validation.webhook.operator.tekton.dev + sideEffects: None + targetPort: 8443 + type: ValidatingAdmissionWebhook + - admissionReviewVersions: + - v1beta1 + - v1 + containerPort: 443 + deploymentName: tekton-operator-webhook + failurePolicy: Fail + generateName: webhook.operator.tekton.dev + sideEffects: None + targetPort: 8443 + type: MutatingAdmissionWebhook diff --git a/operatorhub/kubernetes/release-artifacts/bundle/metadata/annotations.yaml b/operatorhub/kubernetes/release-artifacts/bundle/metadata/annotations.yaml index ffe5236909..09d6f4ca7a 100644 --- a/operatorhub/kubernetes/release-artifacts/bundle/metadata/annotations.yaml +++ b/operatorhub/kubernetes/release-artifacts/bundle/metadata/annotations.yaml @@ -6,7 +6,7 @@ annotations: operators.operatorframework.io.bundle.package.v1: tektoncd-operator operators.operatorframework.io.bundle.channels.v1: a,b operators.operatorframework.io.bundle.channel.default.v1: a - operators.operatorframework.io.metrics.builder: operator-sdk-v1.8.0 + operators.operatorframework.io.metrics.builder: operator-sdk-v1.7.1+git operators.operatorframework.io.metrics.mediatype.v1: metrics+v1 operators.operatorframework.io.metrics.project_layout: unknown diff --git a/operatorhub/tools/bundle.py b/operatorhub/tools/bundle.py index 38765afd77..f43703cfc3 100755 --- a/operatorhub/tools/bundle.py +++ b/operatorhub/tools/bundle.py @@ -14,6 +14,8 @@ UPGRADE_STRATEGY_SEMVER = "upgrade-strategy-sermver-mode" UPGRADE_STRATEGY_REPLACE = "upgrade-strategy-replaces-mode" VERBOSE = False +OPERATOR_SDK = os.getenv("OPERATOR_SDK", "operator-sdk") + def buildConfig(): parser = setParser() @@ -184,7 +186,7 @@ def genBundleCmd(config): # https://github.com/operator-framework/operator-sdk/issues/4951 return ''' {resource_gen} | \ - operator-sdk generate bundle \ + {operator_sdk} generate bundle \ --channels {channels} \ --default-channel {default_channel} \ --kustomize-dir manifests \ @@ -192,6 +194,7 @@ def genBundleCmd(config): --package {packagename} \ --version {version}; '''.format( + operator_sdk=OPERATOR_SDK, resource_gen=aggregate_resources, channels=config["channels"], default_channel=config["default-channel"], diff --git a/operatorhub/tools/install_operator-sdk.sh b/operatorhub/tools/install_operator-sdk.sh new file mode 100755 index 0000000000..364ca3a700 --- /dev/null +++ b/operatorhub/tools/install_operator-sdk.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env sh + + +dest_dir=${1:-.bin} +[[ ! -d $dest_dir ]] && mkdir -p $dest_dir +echo $dest_dir +# https://sdk.operatorframework.io/docs/installation/#1-download-the-release-binary +export ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac) +export OS=$(uname | awk '{print tolower($0)}') +export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.8.0 +curl -L -o ${dest_dir}/operator-sdk ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} +chmod +x ${dest_dir}/operator-sdk diff --git a/pkg/apis/operator/v1alpha1/tektonconfig_validation_test.go b/pkg/apis/operator/v1alpha1/tektonconfig_validation_test.go index ffc4934b6a..6bc416920e 100644 --- a/pkg/apis/operator/v1alpha1/tektonconfig_validation_test.go +++ b/pkg/apis/operator/v1alpha1/tektonconfig_validation_test.go @@ -20,7 +20,6 @@ import ( "context" "testing" - "gotest.tools/v3/assert" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" diff --git a/pkg/apis/operator/v1alpha1/tektondashboard_validation_test.go b/pkg/apis/operator/v1alpha1/tektondashboard_validation_test.go index 6525c6caba..c83e8e4a78 100644 --- a/pkg/apis/operator/v1alpha1/tektondashboard_validation_test.go +++ b/pkg/apis/operator/v1alpha1/tektondashboard_validation_test.go @@ -20,7 +20,6 @@ import ( "context" "testing" - "gotest.tools/v3/assert" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" diff --git a/pkg/apis/operator/v1alpha1/tektonpipeline_validation_test.go b/pkg/apis/operator/v1alpha1/tektonpipeline_validation_test.go index b295f28944..0e49fa39c9 100644 --- a/pkg/apis/operator/v1alpha1/tektonpipeline_validation_test.go +++ b/pkg/apis/operator/v1alpha1/tektonpipeline_validation_test.go @@ -20,7 +20,6 @@ import ( "context" "testing" - "gotest.tools/v3/assert" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" diff --git a/pkg/apis/operator/v1alpha1/tektontrigger_validation_test.go b/pkg/apis/operator/v1alpha1/tektontrigger_validation_test.go index 341778e21a..1e44716ac2 100644 --- a/pkg/apis/operator/v1alpha1/tektontrigger_validation_test.go +++ b/pkg/apis/operator/v1alpha1/tektontrigger_validation_test.go @@ -20,7 +20,6 @@ import ( "context" "testing" - "gotest.tools/v3/assert" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis"