Skip to content

Commit c9ac5b9

Browse files
chengjoeytekton-robot
authored andcommitted
misc: promote keep-pod-on-cancel to beta for cancel TaskRuns using entrypoint binary #3238
Signed-off-by: chengjoey <[email protected]>
1 parent ffb5f02 commit c9ac5b9

File tree

5 files changed

+20
-2
lines changed

5 files changed

+20
-2
lines changed

pkg/apis/config/feature_flags.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ var (
139139
// DefaultEnableKeepPodOnCancel is the default PerFeatureFlag value for "keep-pod-on-cancel"
140140
DefaultEnableKeepPodOnCancel = PerFeatureFlag{
141141
Name: KeepPodOnCancel,
142-
Stability: AlphaAPIFields,
143-
Enabled: DefaultAlphaFeatureEnabled,
142+
Stability: BetaAPIFields,
143+
Enabled: DefaultBetaFeatureEnabled,
144144
}
145145

146146
// DefaultEnableCELInWhenExpression is the default PerFeatureFlag value for EnableCELInWhenExpression

test/e2e-tests-kind-prow-alpha.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ KO_DOCKER_REPO=registry.local:5000
55
E2E_GO_TEST_TIMEOUT=40m
66
RESULTS_FROM=sidecar-logs
77
ENABLE_STEP_ACTIONS=true
8+
KEEP_POD_ON_CANCEL=true
89
ENABLE_CEL_IN_WHENEXPRESSION=true
910
ENABLE_PARAM_ENUM=true
1011
ENABLE_ARTIFACTS=true

test/e2e-tests-kind-prow-beta.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ EMBEDDED_STATUS_GATE=minimal
44
RUN_YAML_TESTS=true
55
RESULTS_FROM=sidecar-logs
66
ENABLE_STEP_ACTIONS=true
7+
KEEP_POD_ON_CANCEL=true
78
KO_DOCKER_REPO=registry.local:5000
89
E2E_GO_TEST_TIMEOUT=40m

test/e2e-tests.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ E2E_GO_TEST_TIMEOUT=${E2E_GO_TEST_TIMEOUT:="20m"}
2929
RUN_FEATUREFLAG_TESTS=${RUN_FEATUREFLAG_TESTS:="false"}
3030
RESULTS_FROM=${RESULTS_FROM:-termination-message}
3131
ENABLE_STEP_ACTIONS=${ENABLE_STEP_ACTIONS:="false"}
32+
KEEP_POD_ON_CANCEL=${KEEP_POD_ON_CANCEL:="false"}
3233
ENABLE_CEL_IN_WHENEXPRESSION=${ENABLE_CEL_IN_WHENEXPRESSION:="false"}
3334
ENABLE_PARAM_ENUM=${ENABLE_PARAM_ENUM:="false"}
3435
ENABLE_ARTIFACTS=${ENABLE_ARTIFACTS:="false"}
@@ -99,6 +100,18 @@ function set_enable_step_actions() {
99100
kubectl patch configmap feature-flags -n tekton-pipelines -p "$jsonpatch"
100101
}
101102

103+
function set_keep_pod_on_cancel() {
104+
local method="$1"
105+
if [ "$method" != "false" ] && [ "$method" != "true" ]; then
106+
printf "Invalid value for keep-pod-on-cancel %s\n" ${method}
107+
exit 255
108+
fi
109+
printf "Setting keep-pod-on-cancel to %s\n", ${method}
110+
jsonpatch=$(printf "{\"data\": {\"keep-pod-on-cancel\": \"%s\"}}" $1)
111+
echo "feature-flags ConfigMap patch: ${jsonpatch}"
112+
kubectl patch configmap feature-flags -n tekton-pipelines -p "$jsonpatch"
113+
}
114+
102115
function set_cel_in_whenexpression() {
103116
local method="$1"
104117
if [ "$method" != "false" ] && [ "$method" != "true" ]; then
@@ -182,6 +195,7 @@ add_spire "$PIPELINE_FEATURE_GATE"
182195
set_feature_gate "$PIPELINE_FEATURE_GATE"
183196
set_result_extraction_method "$RESULTS_FROM"
184197
set_enable_step_actions "$ENABLE_STEP_ACTIONS"
198+
set_keep_pod_on_cancel "$KEEP_POD_ON_CANCEL"
185199
set_cel_in_whenexpression "$ENABLE_CEL_IN_WHENEXPRESSION"
186200
set_enable_param_enum "$ENABLE_PARAM_ENUM"
187201
set_enable_artifacts "$ENABLE_ARTIFACTS"

test/featureflags.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ func getFeatureFlagsBaseOnAPIFlag(t *testing.T) *config.FeatureFlags {
120120
"enable-artifacts": "true",
121121
"enable-concise-resolver-syntax": "true",
122122
"enable-kubernetes-sidecar": "true",
123+
"keep-pod-on-cancel": "true",
123124
})
124125
if err != nil {
125126
t.Fatalf("error creating alpha feature flags configmap: %v", err)
@@ -128,6 +129,7 @@ func getFeatureFlagsBaseOnAPIFlag(t *testing.T) *config.FeatureFlags {
128129
"results-from": "sidecar-logs",
129130
"enable-api-fields": "beta",
130131
"enable-step-actions": "true",
132+
"keep-pod-on-cancel": "true",
131133
})
132134
if err != nil {
133135
t.Fatalf("error creating beta feature flags configmap: %v", err)

0 commit comments

Comments
 (0)