-
Notifications
You must be signed in to change notification settings - Fork 262
fix(chart): make the openshift flavor functional and align with kustomize #3945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 9 commits
e2adcc0
6d84cb3
d1feafa
59d667f
ee0375e
c3d009f
afde9f7
b7d7c43
2f345ab
42b8578
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,17 +96,31 @@ tekton-operator | |
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{- define "tekton-operator.controllers" -}} | ||
| {{- if .Values.openshift.enabled -}} | ||
| tektonconfig,tektonpipeline,tektontrigger,tektonchain,tektonaddon,tektonresult,openshiftpipelinesascode,manualapprovalgate,tektonpruner,tektonscheduler,tektonmulticlusterproxyaae,syncerservice | ||
| {{- else -}} | ||
| tektonconfig,tektonpipeline,tektontrigger,tektonchain,tektonresult,tektondashboard,manualapprovalgate,tektonpruner,tektonscheduler,tektonmulticlusterproxyaae,openshiftpipelinesascode | ||
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{- define "tekton-operator.validateTargetNamespace" -}} | ||
| {{- if and .Values.openshift.enabled .Values.operator.defaultTargetNamespace (ne .Values.operator.defaultTargetNamespace "openshift-pipelines") -}} | ||
| {{- fail (printf "operator.defaultTargetNamespace must be \"openshift-pipelines\" when openshift.enabled=true (got %q). The openshift addon sample pipelines hardcode that namespace, so a custom value breaks them; this is also first-install-only - once the TektonConfig CR exists the operator never re-reads it. To change the target namespace, set spec.targetNamespace on the TektonConfig CR (requires deleting and recreating the CR)." .Values.operator.defaultTargetNamespace) -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{- define "tekton-operator.operator-image" -}} | ||
| {{- $tag := default .Chart.AppVersion .Values.operator.image.tag -}} | ||
| {{- $image := "" -}} | ||
| {{- if .Values.operator.image.repository -}} | ||
| {{- $image = .Values.operator.image.repository }} | ||
| {{- else -}} | ||
| {{- if .Values.openshift.enabled -}} | ||
| {{- $image = "ghcr.io/tektoncd/operator/operator-1d69a75f22dd094880847eac907fb2c1" -}} | ||
| {{- else -}} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ident, remove space for readbility
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Flattened to match the chart style — fixed in 42b8578. |
||
| {{- $image = "ghcr.io/tektoncd/operator/operator-303303c315a48490ba6517859ef65b77" -}} | ||
| {{- else -}} | ||
| {{- $image = "ghcr.io/tektoncd/operator/operator-303303c315a48490ba6517859ef65b77" -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same identation for readbility
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same — flattened in 42b8578. |
||
| {{- end -}} | ||
| {{- printf "%s:%s" $image $tag -}} | ||
| {{- end -}} | ||
|
|
@@ -126,10 +140,10 @@ tekton-operator | |
| {{- $image = .Values.webhook.image.repository }} | ||
| {{- else -}} | ||
| {{- if .Values.openshift.enabled -}} | ||
| {{- $image = "ghcr.io/tektoncd/operator/webhook-340ad78e88ca5477447aa144fedfe1a1" -}} | ||
| {{- else -}} | ||
| {{- $image = "ghcr.io/tektoncd/operator/webhook-f2bb711aa8f0c0892856a4cbf6d9ddd8" -}} | ||
| {{- else -}} | ||
| {{- $image = "ghcr.io/tektoncd/operator/webhook-f2bb711aa8f0c0892856a4cbf6d9ddd8" -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
| {{- printf "%s:%s" $image $tag -}} | ||
| {{- end -}} | ||
|
|
@@ -149,10 +163,10 @@ tekton-operator | |
| {{- $image = .Values.webhookProxy.image.repository }} | ||
| {{- else -}} | ||
| {{- if .Values.openshift.enabled -}} | ||
| {{- $image = "ghcr.io/tektoncd/operator/proxy-webhook-f8f95c9cea9508fe8915ae3d012d15fb" -}} | ||
| {{- else -}} | ||
| {{- $image = "ghcr.io/tektoncd/operator/proxy-webhook-f6167da7bc41b96a27c5529f850e63d1" -}} | ||
| {{- else -}} | ||
| {{- $image = "ghcr.io/tektoncd/operator/proxy-webhook-f6167da7bc41b96a27c5529f850e63d1" -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
| {{- printf "%s:%s" $image $tag -}} | ||
| {{- end -}} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,156 @@ | ||
| {{- if .Values.rbac.create -}} | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: Role | ||
| metadata: | ||
| name: tekton-operator-info | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Orphaned resource risk: kubernetes-rbac.yaml to common-rbac.yaml rename RoleBinding named {{ include "tekton-operator.fullname" . }}-info
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Valid concern — addressed in two parts: the kubernetes flavor's -info Role/RoleBinding went back to their pre-PR names (so that particular orphan no longer occurs for kubernetes upgrades from released charts), and the PR description now carries an upgrade note with the exact kubectl cleanup commands for the objects that do get orphaned (the literal config-read pair on both flavors, and the literal info pair on openshift). A pre-upgrade hook felt like the wrong trade: it would need its own RBAC to delete RBAC.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correction to my earlier reply — and to the orphan concern itself: |
||
| labels: | ||
| {{- include "tekton-operator.labels" . | nindent 4 }} | ||
| rules: | ||
| - apiGroups: | ||
| - "" | ||
| resourceNames: | ||
| - tekton-operator-info | ||
| resources: | ||
| - configmaps | ||
| verbs: | ||
| - get | ||
| - describe | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: RoleBinding | ||
| metadata: | ||
| labels: | ||
| app.kubernetes.io/instance: default | ||
| name: tekton-operator-info | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: Role | ||
| name: tekton-operator-info | ||
| subjects: | ||
| - apiGroup: rbac.authorization.k8s.io | ||
| kind: Group | ||
| name: system:authenticated | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: tekton-config-read-role | ||
| labels: | ||
| {{- include "tekton-operator.labels" . | nindent 4 }} | ||
| rules: | ||
| - apiGroups: | ||
| - operator.tekton.dev | ||
| resources: | ||
| - tektonconfigs | ||
| verbs: | ||
| - get | ||
| - watch | ||
| - list | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: tekton-config-read-rolebinding | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. may be not hardcode the name , two simultaneous chart installs in the same cluster will conflict on this ClusterRole and ClusterRoleBinding, use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch — fixed in 42b8578: the info Role/RoleBinding and config-read ClusterRole/ClusterRoleBinding are now fullname-prefixed, so two installs no longer collide on cluster-scoped names. One deliberate exception: the Role's resourceNames entry stays the literal tekton-operator-info, because it refers to the ConfigMap that tkn version reads — that object keeps a fixed name. |
||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: tekton-config-read-role | ||
| subjects: | ||
| - apiGroup: rbac.authorization.k8s.io | ||
| kind: Group | ||
| name: system:authenticated | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: {{ include "tekton-operator.fullname" . }}-scheduler-role | ||
| labels: | ||
| {{- include "tekton-operator.labels" . | nindent 4 }} | ||
| rules: | ||
| - apiGroups: | ||
| - kueue.x-k8s.io | ||
| resources: | ||
| - resourceflavors | ||
| - workloads | ||
| - workloads/finalizers | ||
| - workloads/status | ||
| - workloadpriorityclasses | ||
| - multikueueclusters | ||
| verbs: | ||
| - get | ||
| - list | ||
| - create | ||
| - update | ||
| - delete | ||
| - patch | ||
| - watch | ||
| - apiGroups: | ||
| - scheduling.k8s.io | ||
| resources: | ||
| - priorityclasses | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
| - apiGroups: | ||
| - cert-manager.io | ||
| resources: | ||
| - certificates | ||
| - issuers | ||
| verbs: | ||
| - get | ||
| - create | ||
| - update | ||
| - list | ||
| - nonResourceURLs: | ||
| - /metrics | ||
| verbs: | ||
| - get | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: {{ include "tekton-operator.fullname" . }}-scheduler-rolebinding | ||
| labels: | ||
| {{- include "tekton-operator.labels" . | nindent 4 }} | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: {{ include "tekton-operator.fullname" . }}-scheduler-role | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: {{ include "tekton-operator.serviceAccountName" . }} | ||
| namespace: {{ .Release.Namespace }} | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: {{ include "tekton-operator.fullname" . }}-result-read-role | ||
| labels: | ||
| {{- include "tekton-operator.labels" . | nindent 4 }} | ||
| rules: | ||
| - apiGroups: | ||
| - operator.tekton.dev | ||
| resources: | ||
| - tektonresults | ||
| verbs: | ||
| - get | ||
| - watch | ||
| - list | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: {{ include "tekton-operator.fullname" . }}-result-read-rolebinding | ||
| labels: | ||
| {{- include "tekton-operator.labels" . | nindent 4 }} | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: {{ include "tekton-operator.fullname" . }}-result-read-role | ||
| subjects: | ||
| - apiGroup: rbac.authorization.k8s.io | ||
| kind: Group | ||
| name: system:authenticated | ||
| {{- end -}} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comment for digest pinning
{{/* OpenShift image repositories are digest-pinned to the v0.81.0 .
Update all three slugs (operator/webhook/proxy-webhook) when bumping AppVersion. */}}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in 42b8578, with one correction to the wording: the repositories are the ko-published binary slugs from the v0.81.0 release assets and the tag follows Chart.AppVersion (no @sha256 pinning), so the comment now says where the slugs come from and that all three must be updated together if a release renames them.