Skip to content

Commit 487a5ea

Browse files
anithapriyanatarajantekton-robot
authored andcommitted
fix: update SendCloudEventsForRuns default and mark deprecated
Signed-off-by: Anitha Natarajan <anataraj@redhat.com>
1 parent b7c4acf commit 487a5ea

3 files changed

Lines changed: 24 additions & 14 deletions

File tree

pkg/apis/operator/v1alpha1/tektonpipeline_defaults.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ func (p *Pipeline) setDefaults() {
5757
// EnableCustomTask is always enable
5858
p.EnableCustomTasks = ptr.Bool(true)
5959
}
60+
// Deprecated: send-cloudevents-for-runs is deprecated upstream (pipeline v1.12.0).
61+
// Default is now true. Will be removed in a future operator release.
6062
if p.SendCloudEventsForRuns == nil {
6163
p.SendCloudEventsForRuns = ptr.Bool(config.DefaultSendCloudEventsForRuns)
6264
}

pkg/apis/operator/v1alpha1/tektonpipeline_defaults_test.go

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,21 @@ func Test_SetDefaults_PipelineProperties(t *testing.T) {
5050
EnableApiFields: "beta",
5151
EmbeddedStatus: "",
5252
ScopeWhenExpressionsToTask: nil,
53-
SendCloudEventsForRuns: ptr.Bool(false),
54-
VerificationNoMatchPolicy: config.DefaultNoMatchPolicyConfig,
55-
EnableProvenanceInStatus: ptr.Bool(true),
56-
EnforceNonfalsifiability: config.DefaultEnforceNonfalsifiability,
57-
EnableKeepPodOnCancel: ptr.Bool(config.DefaultEnableKeepPodOnCancel.Enabled),
58-
ResultExtractionMethod: config.DefaultResultExtractionMethod,
59-
MaxResultSize: ptr.Int32(config.DefaultMaxResultSize),
60-
SetSecurityContext: ptr.Bool(config.DefaultSetSecurityContext),
61-
Coschedule: config.DefaultCoschedule,
62-
DisableInlineSpec: config.DefaultDisableInlineSpec,
63-
EnableCELInWhenExpression: ptr.Bool(config.DefaultEnableCELInWhenExpression.Enabled),
64-
EnableStepActions: ptr.Bool(config.DefaultFeatureFlags.EnableStepActions),
65-
EnableParamEnum: ptr.Bool(config.DefaultEnableParamEnum.Enabled),
53+
// Deprecated: default changed from false to true in tektoncd/pipeline v1.12.0
54+
// (https://github.com/tektoncd/pipeline/pull/9774)
55+
SendCloudEventsForRuns: ptr.Bool(true),
56+
VerificationNoMatchPolicy: config.DefaultNoMatchPolicyConfig,
57+
EnableProvenanceInStatus: ptr.Bool(true),
58+
EnforceNonfalsifiability: config.DefaultEnforceNonfalsifiability,
59+
EnableKeepPodOnCancel: ptr.Bool(config.DefaultEnableKeepPodOnCancel.Enabled),
60+
ResultExtractionMethod: config.DefaultResultExtractionMethod,
61+
MaxResultSize: ptr.Int32(config.DefaultMaxResultSize),
62+
SetSecurityContext: ptr.Bool(config.DefaultSetSecurityContext),
63+
Coschedule: config.DefaultCoschedule,
64+
DisableInlineSpec: config.DefaultDisableInlineSpec,
65+
EnableCELInWhenExpression: ptr.Bool(config.DefaultEnableCELInWhenExpression.Enabled),
66+
EnableStepActions: ptr.Bool(config.DefaultFeatureFlags.EnableStepActions),
67+
EnableParamEnum: ptr.Bool(config.DefaultEnableParamEnum.Enabled),
6668
PipelineMetricsProperties: PipelineMetricsProperties{
6769
MetricsPipelinerunDurationType: "histogram",
6870
MetricsPipelinerunLevel: "pipeline",

pkg/apis/operator/v1alpha1/tektonpipeline_types.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,13 @@ type PipelineProperties struct {
102102
EnableCustomTasks *bool `json:"enable-custom-tasks,omitempty"`
103103
EnableApiFields string `json:"enable-api-fields,omitempty"`
104104
EmbeddedStatus string `json:"embedded-status,omitempty"`
105-
SendCloudEventsForRuns *bool `json:"send-cloudevents-for-runs,omitempty"`
105+
// Deprecated: send-cloudevents-for-runs is deprecated in tektoncd/pipeline v1.12.0
106+
// (https://github.com/tektoncd/pipeline/pull/9774) and will be removed in a future release.
107+
// CloudEvents for CustomRuns are now enabled by default when a sink is configured in
108+
// the config-events ConfigMap. This field only affects CustomRun objects; it has no
109+
// effect on TaskRuns or PipelineRuns. Set to false only to suppress duplicate events
110+
// when a custom task controller already sends its own CloudEvents.
111+
SendCloudEventsForRuns *bool `json:"send-cloudevents-for-runs,omitempty"`
106112
// "verification-mode" is deprecated and never used.
107113
// This field will be removed, see https://github.com/tektoncd/operator/issues/1497
108114
// originally this field was removed in https://github.com/tektoncd/operator/pull/1481

0 commit comments

Comments
 (0)