Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions pkg/apis/operator/v1alpha1/tektonpipeline_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ func (tp *TektonPipeline) SetDefaults(ctx context.Context) {
}

func (p *PipelineProperties) setDefaults() {
if p.DisableAffinityAssistant == nil {
p.DisableAffinityAssistant = ptr.Bool(false)
}
if p.DisableHomeEnvOverwrite == nil {
p.DisableHomeEnvOverwrite = ptr.Bool(true)
}
Expand Down
1 change: 0 additions & 1 deletion pkg/apis/operator/v1alpha1/tektonpipeline_defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ func Test_SetDefaults_PipelineProperties(t *testing.T) {
}

properties := PipelineProperties{
DisableAffinityAssistant: ptr.Bool(false),
DisableHomeEnvOverwrite: ptr.Bool(true),
DisableWorkingDirectoryOverwrite: ptr.Bool(true),
DisableCredsInit: ptr.Bool(false),
Expand Down
9 changes: 5 additions & 4 deletions pkg/reconciler/openshift/tektonpipeline/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"knative.dev/pkg/injection"
"knative.dev/pkg/logging"
"knative.dev/pkg/ptr"
)

const (
Expand Down Expand Up @@ -135,10 +136,10 @@ func SetDefault(properties *v1alpha1.PipelineProperties) bool {
updated = true
}

// Set `disable-affinity-assistant` to true
// webhook will set `false` as default value
if properties.DisableAffinityAssistant == nil || !*properties.DisableAffinityAssistant {
*properties.DisableAffinityAssistant = DefaultDisableAffinityAssistant
// Set `disable-affinity-assistant` to true if not set in CR
// webhook will not set any value but by default in pipelines configmap it will be false
if properties.DisableAffinityAssistant == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so from Operator we can configure DisableAffinityAssistant only for Openshift and not for K8s then in that case can we add comment here https://github.com/tektoncd/operator/blob/main/pkg/apis/operator/v1alpha1/tektonpipeline_types.go#L84 so that it will be more clear

not necessarily in this instead we do it in another PR

WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@savitaashture it's support on all platform. Only on Openshift the default is different (true instead of false)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep. on kubernetes by default the field will not be set in TektonConfig CR, user can define and alter value.
by default it will be false in configmap.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sm43 but on k8s, if the user set then in the TektonConfig CR, the will be applied to the managed tekton instance right ?

Copy link
Member Author

@sm43 sm43 Aug 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes.. user can define the field in k8s and change the value

properties.DisableAffinityAssistant = ptr.Bool(DefaultDisableAffinityAssistant)
updated = true
}

Expand Down