diff --git a/charts/lighthouse/README.md b/charts/lighthouse/README.md index ed4700eef..99cdafcf6 100644 --- a/charts/lighthouse/README.md +++ b/charts/lighthouse/README.md @@ -168,6 +168,7 @@ helm uninstall my-lighthouse --namespace lighthouse | `tektoncontroller.resources.requests` | object | Resource requests applied to the tekton controller pods | `{"cpu":"80m","memory":"128Mi"}` | | `tektoncontroller.service` | object | Service settings for the tekton controller | `{"annotations":{}}` | | `tektoncontroller.terminationGracePeriodSeconds` | int | Termination grace period for tekton controller pods | `180` | +| `tektoncontroller.enableRerunStatusUpdate` | bool | Enable updating the status on GitHub when PipelineRuns are rerun | `false` | | `tektoncontroller.tolerations` | list | [Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) applied to the tekton controller pods | `[]` | | `user` | string | Git user name (used when GitHub app authentication is not enabled) | `""` | | `webhooks.affinity` | object | [Affinity rules](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) applied to the webhooks pods | `{}` | diff --git a/charts/lighthouse/templates/tekton-controller-deployment.yaml b/charts/lighthouse/templates/tekton-controller-deployment.yaml index 138373077..ab3182bdc 100644 --- a/charts/lighthouse/templates/tekton-controller-deployment.yaml +++ b/charts/lighthouse/templates/tekton-controller-deployment.yaml @@ -27,7 +27,7 @@ spec: - --namespace={{ .Release.Namespace }} - --dashboard-url={{ .Values.tektoncontroller.dashboardURL }} - --dashboard-template={{ .Values.tektoncontroller.dashboardTemplate }} - - --rerun-pr-reconciler={{ .Values.tektoncontroller.rerunPrReconciler | default false }} + - --enable-rerun-status-update={{ .Values.tektoncontroller.enableRerunStatusUpdate | default false }} ports: - name: metrics containerPort: 8080 diff --git a/charts/lighthouse/templates/tekton-controller-role.yaml b/charts/lighthouse/templates/tekton-controller-role.yaml index c40c1ed02..3d82838eb 100644 --- a/charts/lighthouse/templates/tekton-controller-role.yaml +++ b/charts/lighthouse/templates/tekton-controller-role.yaml @@ -19,7 +19,7 @@ rules: - list - get - watch - {{- if .Values.tektoncontroller.rerunPrReconciler }} + {{- if .Values.tektoncontroller.enableRerunStatusUpdate }} - update {{- end }} - apiGroups: @@ -28,7 +28,7 @@ rules: - lighthousebreakpoints - lighthousejobs verbs: - {{- if .Values.tektoncontroller.rerunPrReconciler }} + {{- if .Values.tektoncontroller.enableRerunStatusUpdate }} - create {{- end }} - get diff --git a/charts/lighthouse/values.yaml b/charts/lighthouse/values.yaml index 01ccbadb8..67ad7bd0d 100644 --- a/charts/lighthouse/values.yaml +++ b/charts/lighthouse/values.yaml @@ -275,8 +275,8 @@ tektoncontroller: # tektoncontroller.terminationGracePeriodSeconds -- Termination grace period for tekton controller pods terminationGracePeriodSeconds: 180 - # tektoncontroller.rerunPrReconciler -- Enables the rerun pipelinerun reconciler to run and update rerun pipelinerun status to github - rerunPrReconciler: false + # tektoncontroller.enableRerunStatusUpdate -- Enable updating the status on GitHub when PipelineRuns are rerun + enableRerunStatusUpdate: false image: # tektoncontroller.image.repository -- Template for computing the tekton controller docker image repository diff --git a/cmd/tektoncontroller/main.go b/cmd/tektoncontroller/main.go index 98ec63ea0..416f7cc8e 100644 --- a/cmd/tektoncontroller/main.go +++ b/cmd/tektoncontroller/main.go @@ -16,10 +16,10 @@ import ( ) type options struct { - namespace string - dashboardURL string - dashboardTemplate string - rerunPipelineRunReconciler bool + namespace string + dashboardURL string + dashboardTemplate string + enableRerunStatusUpdate bool } func (o *options) Validate() error { @@ -31,7 +31,7 @@ func gatherOptions(fs *flag.FlagSet, args ...string) options { fs.StringVar(&o.namespace, "namespace", "", "The namespace to listen in") fs.StringVar(&o.dashboardURL, "dashboard-url", "", "The base URL for the Tekton Dashboard to link to for build reports") fs.StringVar(&o.dashboardTemplate, "dashboard-template", "", "The template expression for generating the URL to the build report based on the PipelineRun parameters. If not specified defaults to $LIGHTHOUSE_DASHBOARD_TEMPLATE") - fs.BoolVar(&o.rerunPipelineRunReconciler, "rerun-pr-reconciler", false, "Enables the rerun pipelinerun reconciler to run and update rerun pipelinerun status to github") + fs.BoolVar(&o.enableRerunStatusUpdate, "enable-rerun-status-update", false, "Enable updating the status on GitHub when PipelineRuns are rerun") err := fs.Parse(args) if err != nil { logrus.WithError(err).Fatal("Invalid options") @@ -71,7 +71,7 @@ func main() { logrus.WithError(err).Fatal("Unable to create controller") } - if o.rerunPipelineRunReconciler { + if o.enableRerunStatusUpdate { rerunPipelineRunReconciler := tektonengine.NewRerunPipelineRunReconciler(mgr.GetClient(), mgr.GetScheme()) if err = rerunPipelineRunReconciler.SetupWithManager(mgr); err != nil { logrus.WithError(err).Fatal("Unable to create RerunPipelineRun controller")