Repository: tektoncd/operator
Pull request #1022 (2022-08-26 13:00:49)

Update pipelines features flag in TektonConfig
Signed-off-by: Shivam Mukhade <smukhade@redhat.com>

# Changes

<!-- 🎉🎉🎉 Thank you for the PR!!! 🎉🎉🎉 -->

<!-- Describe your changes here- ideally you can get that description straight from
your descriptive commit message(s)! -->

# Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

- [x] Run `make test lint` before submitting a PR
- [x] Includes [tests](https://github.com/tektoncd/community/blob/master/standards.md#principles) (if functionality changed/added)
- [x] Includes [docs](https://github.com/tektoncd/community/blob/master/standards.md#principles) (if user facing)
- [x] Commit messages follow [commit message best practices](https://github.com/tektoncd/community/blob/master/standards.md#commit-messages)

_See [the contribution guide](https://github.com/tektoncd/operator/blob/master/CONTRIBUTING.md) for more details._

# Release Notes

<!--
Describe any user facing changes here, or delete this block.

Examples of user facing changes:
- API changes
- Bug fixes
- Any changes in behavior
- Changes requiring upgrade notices or deprecation warnings

For pull requests with a release note:

```release-note
Your release note here
```

For pull requests that require additional action from users switching to the new release, include the string "action required" (case insensitive) in the release note:

```release-note
action required: your release note here
```

For pull requests that don't need to be mentioned at release time, use the `/release-note-none` Prow command to add the `release-note-none` label to the PR. You can also write the string "NONE" as a release note in your PR description:

```release-note
NONE
```
-->


tekton-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please ask for approval from **sm43** after the PR has been reviewed.

The full list of commands accepted by this bot can be found [here](https://prow.tekton.dev/command-help?repo=tektoncd%2Foperator).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/tektoncd/operator/blob/main/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["sm43"]} -->
tekton-robot: The following is the coverage report on the affected files.
Say `/test pull-tekton-operator-go-coverage` to re-run this coverage report

File | Old Coverage | New Coverage | Delta
---- |:------------:|:------------:|:-----:
[pkg/apis/operator/v1alpha1/tektonpipeline_validation.go](https://storage.cloud.google.com/tekton-prow/pr-logs/pull/tektoncd_operator/1022/pull-tekton-operator-go-coverage/1564131435210608640/artifacts/line-cov.html#file2) | 73.3% | 66.7% | -6.7

tekton-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/tektoncd/operator/pull/1022#pullrequestreview-1088632690" title="Approved">vdemeester</a>*

The full list of commands accepted by this bot can be found [here](https://prow.tekton.dev/command-help?repo=tektoncd%2Foperator).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/tektoncd/operator/blob/main/OWNERS)~~ [vdemeester]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
tekton-robot: The following is the coverage report on the affected files.
Say `/test pull-tekton-operator-go-coverage` to re-run this coverage report

File | Old Coverage | New Coverage | Delta
---- |:------------:|:------------:|:-----:
[pkg/apis/operator/v1alpha1/tektonpipeline_validation.go](https://storage.cloud.google.com/tekton-prow/pr-logs/pull/tektoncd_operator/1022/pull-tekton-operator-go-coverage/1571736938107375616/artifacts/line-cov.html#file2) | 73.3% | 66.7% | -6.7

piyush-garg: /lgtm

Patch:
diff --git a/pkg/apis/operator/v1alpha1/const.go b/pkg/apis/operator/v1alpha1/const.go
index 5d2d521bf..d17609cbd 100644
--- a/pkg/apis/operator/v1alpha1/const.go
+++ b/pkg/apis/operator/v1alpha1/const.go
@@ -40,9 +40,6 @@ const (
 	// Hub Params
 	EnableDevconsoleIntegrationParam = "enable-devconsole-integration"
 
-	ApiFieldAlpha  = "alpha"
-	ApiFieldStable = "stable"
-
 	LastAppliedHashKey     = "operator.tekton.dev/last-applied-hash"
 	CreatedByKey           = "operator.tekton.dev/created-by"
 	ReleaseVersionKey      = "operator.tekton.dev/release-version"
diff --git a/pkg/apis/operator/v1alpha1/tektonpipeline_defaults.go b/pkg/apis/operator/v1alpha1/tektonpipeline_defaults.go
index f9f86bea3..a8e975ad6 100644
--- a/pkg/apis/operator/v1alpha1/tektonpipeline_defaults.go
+++ b/pkg/apis/operator/v1alpha1/tektonpipeline_defaults.go
@@ -19,53 +19,56 @@ package v1alpha1
 import (
 	"context"
 
+	"github.com/tektoncd/pipeline/pkg/apis/config"
 	"knative.dev/pkg/ptr"
 )
 
-const (
-	DefaultMetricsPipelinerunLevel       = "pipeline"
-	DefaultMetricsTaskrunLevel           = "task"
-	DefaultMetricsPipelierunDurationType = "histogram"
-	DefaultMetricsTaskrunDurationType    = "histogram"
-)
-
 func (tp *TektonPipeline) SetDefaults(ctx context.Context) {
 	tp.Spec.PipelineProperties.setDefaults()
 }
 
 func (p *PipelineProperties) setDefaults() {
 	if p.DisableCredsInit == nil {
-		p.DisableCredsInit = ptr.Bool(false)
+		p.DisableCredsInit = ptr.Bool(config.DefaultDisableCredsInit)
+	}
+	if p.AwaitSidecarReadiness == nil {
+		p.AwaitSidecarReadiness = ptr.Bool(config.DefaultAwaitSidecarReadiness)
 	}
 	if p.RunningInEnvironmentWithInjectedSidecars == nil {
-		p.RunningInEnvironmentWithInjectedSidecars = ptr.Bool(true)
+		p.RunningInEnvironmentWithInjectedSidecars = ptr.Bool(config.DefaultRunningInEnvWithInjectedSidecars)
 	}
 	if p.RequireGitSshSecretKnownHosts == nil {
-		p.RequireGitSshSecretKnownHosts = ptr.Bool(false)
+		p.RequireGitSshSecretKnownHosts = ptr.Bool(config.DefaultRequireGitSSHSecretKnownHosts)
 	}
 	if p.EnableTektonOciBundles == nil {
-		p.EnableTektonOciBundles = ptr.Bool(false)
+		p.EnableTektonOciBundles = ptr.Bool(config.DefaultEnableTektonOciBundles)
 	}
 	if p.EnableCustomTasks == nil {
-		p.EnableCustomTasks = ptr.Bool(false)
+		p.EnableCustomTasks = ptr.Bool(config.DefaultEnableCustomTasks)
+	}
+	if p.SendCloudEventsForRuns == nil {
+		p.SendCloudEventsForRuns = ptr.Bool(config.DefaultSendCloudEventsForRuns)
 	}
 	if p.EnableApiFields == "" {
-		p.EnableApiFields = ApiFieldStable
+		p.EnableApiFields = config.DefaultEnableAPIFields
 	}
-	if p.ScopeWhenExpressionsToTask == nil {
-		p.ScopeWhenExpressionsToTask = ptr.Bool(false)
+	if p.EmbeddedStatus == "" {
+		p.EmbeddedStatus = config.DefaultEmbeddedStatus
 	}
+
+	// Deprecated: set to nil, remove in further release
+	p.ScopeWhenExpressionsToTask = nil
+
 	if p.MetricsPipelinerunDurationType == "" {
-		p.MetricsPipelinerunDurationType = DefaultMetricsPipelierunDurationType
+		p.MetricsPipelinerunDurationType = config.DefaultDurationPipelinerunType
 	}
 	if p.MetricsPipelinerunLevel == "" {
-		p.MetricsPipelinerunLevel = DefaultMetricsPipelinerunLevel
+		p.MetricsPipelinerunLevel = config.DefaultPipelinerunLevel
 	}
 	if p.MetricsTaskrunDurationType == "" {
-		p.MetricsTaskrunDurationType = DefaultMetricsTaskrunDurationType
+		p.MetricsTaskrunDurationType = config.DefaultDurationTaskrunType
 	}
 	if p.MetricsTaskrunLevel == "" {
-		p.MetricsTaskrunLevel = DefaultMetricsTaskrunLevel
+		p.MetricsTaskrunLevel = config.DefaultTaskrunLevel
 	}
-
 }
diff --git a/pkg/apis/operator/v1alpha1/tektonpipeline_types.go b/pkg/apis/operator/v1alpha1/tektonpipeline_types.go
index b0c9ba38a..125bf509b 100644
--- a/pkg/apis/operator/v1alpha1/tektonpipeline_types.go
+++ b/pkg/apis/operator/v1alpha1/tektonpipeline_types.go
@@ -87,13 +87,18 @@ type Pipeline struct {
 type PipelineProperties struct {
 	DisableAffinityAssistant                 *bool  `json:"disable-affinity-assistant,omitempty"`
 	DisableCredsInit                         *bool  `json:"disable-creds-init,omitempty"`
+	AwaitSidecarReadiness                    *bool  `json:"await-sidecar-readiness,omitempty"`
 	RunningInEnvironmentWithInjectedSidecars *bool  `json:"running-in-environment-with-injected-sidecars,omitempty"`
 	RequireGitSshSecretKnownHosts            *bool  `json:"require-git-ssh-secret-known-hosts,omitempty"`
 	EnableTektonOciBundles                   *bool  `json:"enable-tekton-oci-bundles,omitempty"`
 	EnableCustomTasks                        *bool  `json:"enable-custom-tasks,omitempty"`
 	EnableApiFields                          string `json:"enable-api-fields,omitempty"`
-	ScopeWhenExpressionsToTask               *bool  `json:"scope-when-expressions-to-task,omitempty"`
-	PipelineMetricsProperties                `json:",inline"`
+	EmbeddedStatus                           string `json:"embedded-status,omitempty"`
+	SendCloudEventsForRuns                   *bool  `json:"send-cloudevents-for-runs,omitempty"`
+
+	// ScopeWhenExpressionsToTask Deprecated: remove in next release
+	ScopeWhenExpressionsToTask *bool `json:"scope-when-expressions-to-task,omitempty"`
+	PipelineMetricsProperties  `json:",inline"`
 	// +optional
 	OptionalPipelineProperties `json:",inline"`
 }
@@ -101,12 +106,14 @@ type PipelineProperties struct {
 // OptionalPipelineProperties defines the fields which are to be
 // defined for pipelines only if user pass them
 type OptionalPipelineProperties struct {
-	DefaultTimeoutMinutes          *uint  `json:"default-timeout-minutes,omitempty"`
-	DefaultServiceAccount          string `json:"default-service-account,omitempty"`
-	DefaultManagedByLabelValue     string `json:"default-managed-by-label-value,omitempty"`
-	DefaultPodTemplate             string `json:"default-pod-template,omitempty"`
-	DefaultCloudEventsSink         string `json:"default-cloud-events-sink,omitempty"`
-	DefaultTaskRunWorkspaceBinding string `json:"default-task-run-workspace-binding,omitempty"`
+	DefaultTimeoutMinutes               *uint  `json:"default-timeout-minutes,omitempty"`
+	DefaultServiceAccount               string `json:"default-service-account,omitempty"`
+	DefaultManagedByLabelValue          string `json:"default-managed-by-label-value,omitempty"`
+	DefaultPodTemplate                  string `json:"default-pod-template,omitempty"`
+	DefaultCloudEventsSink              string `json:"default-cloud-events-sink,omitempty"`
+	DefaultAffinityAssistantPodTemplate string `json:"default-affinity-assistant-pod-template,omitempty"`
+	DefaultTaskRunWorkspaceBinding      string `json:"default-task-run-workspace-binding,omitempty"`
+	DefaultMaxMatrixCombinationsCount   string `json:"default-max-matrix-combinations-count,omitempty"`
 }
 
 // PipelineMetricsProperties defines the fields which are configurable for
diff --git a/pkg/apis/operator/v1alpha1/tektonpipeline_validation.go b/pkg/apis/operator/v1alpha1/tektonpipeline_validation.go
index ab4b065f2..b8f79dda5 100644
--- a/pkg/apis/operator/v1alpha1/tektonpipeline_validation.go
+++ b/pkg/apis/operator/v1alpha1/tektonpipeline_validation.go
@@ -20,6 +20,7 @@ import (
 	"context"
 	"fmt"
 
+	"github.com/tektoncd/pipeline/pkg/apis/config"
 	"knative.dev/pkg/apis"
 )
 
@@ -44,7 +45,7 @@ func (tp *TektonPipeline) Validate(ctx context.Context) (errs *apis.FieldError)
 func (p *PipelineProperties) validate(path string) (errs *apis.FieldError) {
 
 	if p.EnableApiFields != "" {
-		if p.EnableApiFields != ApiFieldStable && p.EnableApiFields != ApiFieldAlpha {
+		if p.EnableApiFields != config.StableAPIFields && p.EnableApiFields != config.AlphaAPIFields {
 			errs = errs.Also(apis.ErrInvalidValue(p.EnableApiFields, path+".enable-api-fields"))
 		}
 	}
@@ -53,5 +54,11 @@ func (p *PipelineProperties) validate(path string) (errs *apis.FieldError) {
 			errs = errs.Also(apis.ErrInvalidValue(p.DefaultTimeoutMinutes, path+".default-timeout-minutes"))
 		}
 	}
+
+	if p.EmbeddedStatus != "" {
+		if p.EmbeddedStatus != config.FullEmbeddedStatus && p.EmbeddedStatus != config.BothEmbeddedStatus && p.EmbeddedStatus != config.MinimalEmbeddedStatus {
+			errs = errs.Also(apis.ErrInvalidValue(p.EmbeddedStatus, path+".embedded-status"))
+		}
+	}
 	return errs
 }
diff --git a/pkg/apis/operator/v1alpha1/tektontrigger_defaults.go b/pkg/apis/operator/v1alpha1/tektontrigger_defaults.go
index d961df78b..57505b825 100644
--- a/pkg/apis/operator/v1alpha1/tektontrigger_defaults.go
+++ b/pkg/apis/operator/v1alpha1/tektontrigger_defaults.go
@@ -18,6 +18,8 @@ package v1alpha1
 
 import (
 	"context"
+
+	"github.com/tektoncd/pipeline/pkg/apis/config"
 )
 
 func (tt *TektonTrigger) SetDefaults(ctx context.Context) {
@@ -27,7 +29,7 @@ func (tt *TektonTrigger) SetDefaults(ctx context.Context) {
 func (p *TriggersProperties) setDefaults() {
 
 	if p.EnableApiFields == "" {
-		p.EnableApiFields = ApiFieldStable
+		p.EnableApiFields = config.DefaultEnableAPIFields
 	}
 
 }
diff --git a/pkg/apis/operator/v1alpha1/tektontrigger_validation.go b/pkg/apis/operator/v1alpha1/tektontrigger_validation.go
index 4f47fdc30..89a89423c 100644
--- a/pkg/apis/operator/v1alpha1/tektontrigger_validation.go
+++ b/pkg/apis/operator/v1alpha1/tektontrigger_validation.go
@@ -20,6 +20,7 @@ import (
 	"context"
 	"fmt"
 
+	"github.com/tektoncd/pipeline/pkg/apis/config"
 	"knative.dev/pkg/apis"
 )
 
@@ -44,7 +45,7 @@ func (tr *TektonTrigger) Validate(ctx context.Context) (errs *apis.FieldError) {
 func (tr *TriggersProperties) validate(path string) (errs *apis.FieldError) {
 
 	if tr.EnableApiFields != "" {
-		if tr.EnableApiFields != ApiFieldStable && tr.EnableApiFields != ApiFieldAlpha {
+		if tr.EnableApiFields != config.StableAPIFields && tr.EnableApiFields != config.AlphaAPIFields {
 			errs = errs.Also(apis.ErrInvalidValue(tr.EnableApiFields, path+".enable-api-fields"))
 		}
 	}
diff --git a/pkg/apis/operator/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/operator/v1alpha1/zz_generated.deepcopy.go
index 8f1b585cd..6284c1a72 100644
--- a/pkg/apis/operator/v1alpha1/zz_generated.deepcopy.go
+++ b/pkg/apis/operator/v1alpha1/zz_generated.deepcopy.go
@@ -341,6 +341,11 @@ func (in *PipelineProperties) DeepCopyInto(out *PipelineProperties) {
 		*out = new(bool)
 		**out = **in
 	}
+	if in.AwaitSidecarReadiness != nil {
+		in, out := &in.AwaitSidecarReadiness, &out.AwaitSidecarReadiness
+		*out = new(bool)
+		**out = **in
+	}
 	if in.RunningInEnvironmentWithInjectedSidecars != nil {
 		in, out := &in.RunningInEnvironmentWithInjectedSidecars, &out.RunningInEnvironmentWithInjectedSidecars
 		*out = new(bool)
@@ -361,6 +366,11 @@ func (in *PipelineProperties) DeepCopyInto(out *PipelineProperties) {
 		*out = new(bool)
 		**out = **in
 	}
+	if in.SendCloudEventsForRuns != nil {
+		in, out := &in.SendCloudEventsForRuns, &out.SendCloudEventsForRuns
+		*out = new(bool)
+		**out = **in
+	}
 	if in.ScopeWhenExpressionsToTask != nil {
 		in, out := &in.ScopeWhenExpressionsToTask, &out.ScopeWhenExpressionsToTask
 		*out = new(bool)
diff --git a/third_party/github.com/hashicorp/go-rootcerts/rootcerts_base.go b/third_party/github.com/hashicorp/go-rootcerts/rootcerts_base.go
index 66b1472c4..ba58717f5 100644
--- a/third_party/github.com/hashicorp/go-rootcerts/rootcerts_base.go
+++ b/third_party/github.com/hashicorp/go-rootcerts/rootcerts_base.go
@@ -1,3 +1,4 @@
+//go:build !darwin
 // +build !darwin
 
 package rootcerts
diff --git a/third_party/github.com/hashicorp/go-sockaddr/ifaddrs.go b/third_party/github.com/hashicorp/go-sockaddr/ifaddrs.go
index 80f61bef6..d58cb50af 100644
--- a/third_party/github.com/hashicorp/go-sockaddr/ifaddrs.go
+++ b/third_party/github.com/hashicorp/go-sockaddr/ifaddrs.go
@@ -1214,7 +1214,7 @@ func parseDefaultIfNameFromIPCmd(routeOut string) (string, error) {
 // Android.
 func parseDefaultIfNameFromIPCmdAndroid(routeOut string) (string, error) {
 	parsedLines := parseIfNameFromIPCmd(routeOut)
-	if (len(parsedLines) > 0) {
+	if len(parsedLines) > 0 {
 		ifName := strings.TrimSpace(parsedLines[0][4])
 		return ifName, nil
 	}
@@ -1222,7 +1222,6 @@ func parseDefaultIfNameFromIPCmdAndroid(routeOut string) (string, error) {
 	return "", errors.New("No default interface found")
 }
 
-
 // parseIfNameFromIPCmd parses interfaces from ip(8) for
 // Linux.
 func parseIfNameFromIPCmd(routeOut string) [][]string {
diff --git a/third_party/github.com/hashicorp/go-sockaddr/route_info_android.go b/third_party/github.com/hashicorp/go-sockaddr/route_info_android.go
index 9885915a6..6f484cc44 100644
--- a/third_party/github.com/hashicorp/go-sockaddr/route_info_android.go
+++ b/third_party/github.com/hashicorp/go-sockaddr/route_info_android.go
@@ -25,7 +25,6 @@ func (ri routeInfo) GetDefaultInterfaceName() (string, error) {
 		return "", err
 	}
 
-
 	var ifName string
 	if ifName, err = parseDefaultIfNameFromIPCmdAndroid(string(out)); err != nil {
 		return "", errors.New("No default interface found")
diff --git a/third_party/github.com/hashicorp/go-sockaddr/route_info_bsd.go b/third_party/github.com/hashicorp/go-sockaddr/route_info_bsd.go
index 705757abc..89308cf7c 100644
--- a/third_party/github.com/hashicorp/go-sockaddr/route_info_bsd.go
+++ b/third_party/github.com/hashicorp/go-sockaddr/route_info_bsd.go
@@ -1,3 +1,4 @@
+//go:build darwin || dragonfly || freebsd || netbsd || openbsd
 // +build darwin dragonfly freebsd netbsd openbsd
 
 package sockaddr
diff --git a/third_party/github.com/hashicorp/go-sockaddr/route_info_default.go b/third_party/github.com/hashicorp/go-sockaddr/route_info_default.go
index d1b009f65..fe291fb0d 100644
--- a/third_party/github.com/hashicorp/go-sockaddr/route_info_default.go
+++ b/third_party/github.com/hashicorp/go-sockaddr/route_info_default.go
@@ -1,3 +1,4 @@
+//go:build android || nacl || plan9
 // +build android nacl plan9
 
 package sockaddr
diff --git a/third_party/github.com/hashicorp/go-sockaddr/route_info_linux.go b/third_party/github.com/hashicorp/go-sockaddr/route_info_linux.go
index b62ce6ecb..1b2720488 100644
--- a/third_party/github.com/hashicorp/go-sockaddr/route_info_linux.go
+++ b/third_party/github.com/hashicorp/go-sockaddr/route_info_linux.go
@@ -1,3 +1,4 @@
+//go:build !android
 // +build !android
 
 package sockaddr
diff --git a/third_party/github.com/hashicorp/golang-lru/simplelru/lru_interface.go b/third_party/github.com/hashicorp/golang-lru/simplelru/lru_interface.go
index 92d70934d..a0b97e3f7 100644
--- a/third_party/github.com/hashicorp/golang-lru/simplelru/lru_interface.go
+++ b/third_party/github.com/hashicorp/golang-lru/simplelru/lru_interface.go
@@ -34,6 +34,6 @@ type LRUCache interface {
 	// Clears all cache entries.
 	Purge()
 
-  // Resizes cache, returning number evicted
-  Resize(int) int
+	// Resizes cache, returning number evicted
+	Resize(int) int
 }


Test patch:
diff --git a/pkg/apis/operator/v1alpha1/tektonpipeline_defaults_test.go b/pkg/apis/operator/v1alpha1/tektonpipeline_defaults_test.go
index 7dc0370fd..487b7343f 100644
--- a/pkg/apis/operator/v1alpha1/tektonpipeline_defaults_test.go
+++ b/pkg/apis/operator/v1alpha1/tektonpipeline_defaults_test.go
@@ -42,17 +42,20 @@ func Test_SetDefaults_PipelineProperties(t *testing.T) {
 
 	properties := PipelineProperties{
 		DisableCredsInit:                         ptr.Bool(false),
+		AwaitSidecarReadiness:                    ptr.Bool(true),
 		RunningInEnvironmentWithInjectedSidecars: ptr.Bool(true),
 		RequireGitSshSecretKnownHosts:            ptr.Bool(false),
 		EnableTektonOciBundles:                   ptr.Bool(false),
 		EnableCustomTasks:                        ptr.Bool(false),
-		EnableApiFields:                          ApiFieldStable,
-		ScopeWhenExpressionsToTask:               ptr.Bool(false),
+		EnableApiFields:                          "stable",
+		EmbeddedStatus:                           "full",
+		ScopeWhenExpressionsToTask:               nil,
+		SendCloudEventsForRuns:                   ptr.Bool(false),
 		PipelineMetricsProperties: PipelineMetricsProperties{
-			MetricsPipelinerunDurationType: DefaultMetricsPipelierunDurationType,
-			MetricsPipelinerunLevel:        DefaultMetricsPipelinerunLevel,
-			MetricsTaskrunDurationType:     DefaultMetricsTaskrunDurationType,
-			MetricsTaskrunLevel:            DefaultMetricsTaskrunLevel,
+			MetricsPipelinerunDurationType: "histogram",
+			MetricsPipelinerunLevel:        "pipeline",
+			MetricsTaskrunDurationType:     "histogram",
+			MetricsTaskrunLevel:            "task",
 		},
 	}
 
diff --git a/pkg/apis/operator/v1alpha1/tektontrigger_defaults_test.go b/pkg/apis/operator/v1alpha1/tektontrigger_defaults_test.go
index aa103c07a..75bb1b672 100644
--- a/pkg/apis/operator/v1alpha1/tektontrigger_defaults_test.go
+++ b/pkg/apis/operator/v1alpha1/tektontrigger_defaults_test.go
@@ -40,7 +40,7 @@ func Test_SetDefaults_TriggersProperties(t *testing.T) {
 	}
 
 	properties := TriggersProperties{
-		EnableApiFields: ApiFieldStable,
+		EnableApiFields: "stable",
 	}
 
 	tt.SetDefaults(context.TODO())
diff --git a/test/e2e/common/00_tektonconfigdeployment_test.go b/test/e2e/common/00_tektonconfigdeployment_test.go
index bd9b9b822..f51c93341 100644
--- a/test/e2e/common/00_tektonconfigdeployment_test.go
+++ b/test/e2e/common/00_tektonconfigdeployment_test.go
@@ -172,7 +172,7 @@ func runFeatureTest(t *testing.T, clients *utils.Clients, tc *v1alpha1.TektonCon
 		tc.Spec.Pipeline.OptionalPipelineProperties.DefaultServiceAccount = "foo"
 
 		// triggers feature-flags configMap
-		tc.Spec.Trigger.TriggersProperties.EnableApiFields = v1alpha1.ApiFieldAlpha
+		tc.Spec.Trigger.TriggersProperties.EnableApiFields = "alpha"
 
 		// triggers config-defaults configMap
 		tc.Spec.Trigger.OptionalTriggersProperties.DefaultServiceAccount = "foo"
@@ -238,7 +238,7 @@ func runFeatureTest(t *testing.T, clients *utils.Clients, tc *v1alpha1.TektonCon
 				return false, err
 			}
 			if featureFlags != nil &&
-				featureFlags.Data["enable-api-fields"] != v1alpha1.ApiFieldAlpha {
+				featureFlags.Data["enable-api-fields"] != "alpha" {
 				return false, nil
 			}
 			return true, nil