Skip to content

Commit

Permalink
Disabling removed feature flags in Pipleines v0.33.0
Browse files Browse the repository at this point in the history
This disables the flags in TektonPipeline for now, so
that in next operator release we can remove them
and upgrades can be smooth.

Signed-off-by: Shivam Mukhade <[email protected]>
  • Loading branch information
Shivam Mukhade authored and tekton-robot committed Mar 1, 2022
1 parent 3eb7d03 commit 3a71695
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 24 deletions.
15 changes: 0 additions & 15 deletions docs/TektonPipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,6 @@ them as per their need.
See more in the workspace documentation about [Affinity Assistant](https://github.com/tektoncd/pipeline/blob/main/docs/workspaces.md#affinity-assistant-and-specifying-workspace-order-in-a-pipeline)
or more info [here](https://github.com/tektoncd/pipeline/pull/2630).


- `disable-home-env-overwrite` (Default: `true`)

Setting this flag to "false" will allow Tekton to override your Task container's $HOME environment variable.

See more info [here](https://github.com/tektoncd/pipeline/issues/2013).


- `disable-working-directory-overwrite` (Default: `true`)

Setting this flag to "false" will allow Tekton to override your Task container's working directory.

See more info [here](https://github.com/tektoncd/pipeline/issues/1836).


- `disable-creds-init` (Default: `false`)

Setting this flag to "true" will prevent Tekton scanning attached service accounts and injecting any credentials it
Expand Down
11 changes: 7 additions & 4 deletions pkg/apis/operator/v1alpha1/tektonpipeline_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,15 @@ func (tp *TektonPipeline) SetDefaults(ctx context.Context) {
}

func (p *PipelineProperties) setDefaults() {
if p.DisableHomeEnvOverwrite == nil {
p.DisableHomeEnvOverwrite = ptr.Bool(true)
// Disabling this for now and will be removed in next release
// disabling will hide this from users in TektonConfig/TektonPipeline
if p.DisableHomeEnvOverwrite != nil {
p.DisableHomeEnvOverwrite = nil
}
if p.DisableWorkingDirectoryOverwrite == nil {
p.DisableWorkingDirectoryOverwrite = ptr.Bool(true)
if p.DisableWorkingDirectoryOverwrite != nil {
p.DisableWorkingDirectoryOverwrite = nil
}

if p.DisableCredsInit == nil {
p.DisableCredsInit = ptr.Bool(false)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/operator/v1alpha1/tektonpipeline_defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ func Test_SetDefaults_PipelineProperties(t *testing.T) {
}

properties := PipelineProperties{
DisableHomeEnvOverwrite: ptr.Bool(true),
DisableWorkingDirectoryOverwrite: ptr.Bool(true),
DisableHomeEnvOverwrite: nil,
DisableWorkingDirectoryOverwrite: nil,
DisableCredsInit: ptr.Bool(false),
RunningInEnvironmentWithInjectedSidecars: ptr.Bool(true),
RequireGitSshSecretKnownHosts: ptr.Bool(false),
Expand Down
10 changes: 7 additions & 3 deletions pkg/apis/operator/v1alpha1/tektonpipeline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,13 @@ type Pipeline struct {

// PipelineProperties defines customizable flags for Pipeline Component.
type PipelineProperties struct {
DisableAffinityAssistant *bool `json:"disable-affinity-assistant,omitempty"`
DisableHomeEnvOverwrite *bool `json:"disable-home-env-overwrite,omitempty"`
DisableWorkingDirectoryOverwrite *bool `json:"disable-working-directory-overwrite,omitempty"`
DisableAffinityAssistant *bool `json:"disable-affinity-assistant,omitempty"`

// DEPRECATED: (Removed in Pipelines v0.33.0): to be removed in next release
DisableHomeEnvOverwrite *bool `json:"disable-home-env-overwrite,omitempty"`
// DEPRECATED: (Removed in Pipelines v0.33.0): to be removed in next release
DisableWorkingDirectoryOverwrite *bool `json:"disable-working-directory-overwrite,omitempty"`

DisableCredsInit *bool `json:"disable-creds-init,omitempty"`
RunningInEnvironmentWithInjectedSidecars *bool `json:"running-in-environment-with-injected-sidecars,omitempty"`
RequireGitSshSecretKnownHosts *bool `json:"require-git-ssh-secret-known-hosts,omitempty"`
Expand Down

0 comments on commit 3a71695

Please sign in to comment.