Skip to content

Commit

Permalink
refactor: make message simpler to understand
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanGoasdoue committed Sep 27, 2024
1 parent 1669fb9 commit ef1eb04
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions charts/lighthouse/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | `{}` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions charts/lighthouse/templates/tekton-controller-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ rules:
- list
- get
- watch
{{- if .Values.tektoncontroller.rerunPrReconciler }}
{{- if .Values.tektoncontroller.enableRerunStatusUpdate }}
- update
{{- end }}
- apiGroups:
Expand All @@ -28,7 +28,7 @@ rules:
- lighthousebreakpoints
- lighthousejobs
verbs:
{{- if .Values.tektoncontroller.rerunPrReconciler }}
{{- if .Values.tektoncontroller.enableRerunStatusUpdate }}
- create
{{- end }}
- get
Expand Down
4 changes: 2 additions & 2 deletions charts/lighthouse/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions cmd/tektoncontroller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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")
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit ef1eb04

Please sign in to comment.