tektoncd/operator

"options" generates unnecessary values on TektonConfig CR

jkandasa opened this issue · 0 comments

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] -

ConfigMaps map[string]corev1.ConfigMap `json:"configMaps,omitempty"`
Deployments map[string]appsv1.Deployment `json:"deployments,omitempty"`
HorizontalPodAutoscalers map[string]autoscalingv2.HorizontalPodAutoscaler `json:"horizontalPodAutoscalers,omitempty"`
StatefulSets map[string]appsv1.StatefulSet `json:"statefulSets,omitempty"`

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