tektoncd / tektoncd/operator

"options" generates unnecessary values on TektonConfig CR

Open
#2,001 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue help wanted kind/bug
Dominant language
Go
Stars
608
Forks
263
Avg merge
1d 3h
Merged PRs (30d)
125

Description

we have options under all the components.
User can update or create a resources with options as mentioned in https://tekton.dev/docs/operator/tektonconfig/#additional-fields-as-options

It is not mandatory to update all the fields, however GoLang struct[1] generates default data type values on TektonConfig CR.
This leads confusion on user point of view.

[1] - https://github.com/tektoncd/operator/blob/8a69188aafc4c031ace535a4c3f347f23e55195e/pkg/apis/operator/v1alpha1/additional_options.go#L29-L32

Expected:

Should not add struct default values on TektonConfig CR. keep only what user added.

Current Behavior:
Entered:
    options:
      disabled: false
      horizontalPodAutoscalers:
        tekton-pipelines-webhook:
          spec:
            minReplicas: 2 
Generated:
    options:
      disabled: false
      horizontalPodAutoscalers:
        tekton-pipelines-webhook:
          metadata:
            creationTimestamp: null
          spec:
            maxReplicas: 0
            minReplicas: 2
            scaleTargetRef:
              kind: ""
              name: ""
          status:
            currentMetrics: null
            desiredReplicas: 0 

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pkg/apis/operator/v1alpha1/additional_options.go at the linked options structs, then trace how TektonConfig resources are serialized and generated. Reproduce the YAML example and verify that omitted option fields are not written to the resulting TektonConfig CR while explicitly provided values remain.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.