refactor(controller): stop auto-setting RUNNER_FEATURE_FLAG_EPHEMERAL (#1385)
This feature flag was provided from ARC to runner container automatically to let it use `--ephemeral` instead of `--once` by default. As the support for `--once` is being dropped from the runner image via #1384, we no longer need that. Ref #1196
This commit is contained in:
		
							parent
							
								
									d01595cfbc
								
							
						
					
					
						commit
						dabbc99c78
					
				
							
								
								
									
										2
									
								
								Makefile
								
								
								
								
							
							
						
						
									
										2
									
								
								Makefile
								
								
								
								
							|  | @ -15,7 +15,6 @@ TEST_ORG_REPO ?= | ||||||
| TEST_EPHEMERAL ?= false | TEST_EPHEMERAL ?= false | ||||||
| SYNC_PERIOD ?= 1m | SYNC_PERIOD ?= 1m | ||||||
| USE_RUNNERSET ?= | USE_RUNNERSET ?= | ||||||
| RUNNER_FEATURE_FLAG_EPHEMERAL ?= |  | ||||||
| KUBECONTEXT ?= kind-acceptance | KUBECONTEXT ?= kind-acceptance | ||||||
| CLUSTER ?= acceptance | CLUSTER ?= acceptance | ||||||
| CERT_MANAGER_VERSION ?= v1.1.1 | CERT_MANAGER_VERSION ?= v1.1.1 | ||||||
|  | @ -188,7 +187,6 @@ acceptance/deploy: | ||||||
| 	TEST_ORG=${TEST_ORG} TEST_ORG_REPO=${TEST_ORG_REPO} SYNC_PERIOD=${SYNC_PERIOD} \
 | 	TEST_ORG=${TEST_ORG} TEST_ORG_REPO=${TEST_ORG_REPO} SYNC_PERIOD=${SYNC_PERIOD} \
 | ||||||
| 	USE_RUNNERSET=${USE_RUNNERSET} \
 | 	USE_RUNNERSET=${USE_RUNNERSET} \
 | ||||||
| 	TEST_EPHEMERAL=${TEST_EPHEMERAL} \
 | 	TEST_EPHEMERAL=${TEST_EPHEMERAL} \
 | ||||||
| 	RUNNER_FEATURE_FLAG_EPHEMERAL=${RUNNER_FEATURE_FLAG_EPHEMERAL} \
 |  | ||||||
| 	acceptance/deploy.sh | 	acceptance/deploy.sh | ||||||
| 
 | 
 | ||||||
| acceptance/tests: | acceptance/tests: | ||||||
|  |  | ||||||
|  | @ -19,11 +19,6 @@ spec: | ||||||
| 
 | 
 | ||||||
|       ephemeral: ${TEST_EPHEMERAL} |       ephemeral: ${TEST_EPHEMERAL} | ||||||
| 
 | 
 | ||||||
|       # Whether to pass --ephemeral (true) or --once (false, deprecated) |  | ||||||
|       env: |  | ||||||
|       - name: RUNNER_FEATURE_FLAG_EPHEMERAL |  | ||||||
|         value: "${RUNNER_FEATURE_FLAG_EPHEMERAL}" |  | ||||||
| 
 |  | ||||||
|       # |       # | ||||||
|       # dockerd within runner container |       # dockerd within runner container | ||||||
|       # |       # | ||||||
|  |  | ||||||
|  | @ -59,9 +59,6 @@ spec: | ||||||
|       containers: |       containers: | ||||||
|       - name: runner |       - name: runner | ||||||
|         imagePullPolicy: IfNotPresent |         imagePullPolicy: IfNotPresent | ||||||
|         env: |  | ||||||
|         - name: RUNNER_FEATURE_FLAG_EPHEMERAL |  | ||||||
|           value: "${RUNNER_FEATURE_FLAG_EPHEMERAL}" |  | ||||||
|       #- name: docker |       #- name: docker | ||||||
|       #  #image: mumoshu/actions-runner-dind:dev |       #  #image: mumoshu/actions-runner-dind:dev | ||||||
| --- | --- | ||||||
|  |  | ||||||
|  | @ -106,10 +106,6 @@ func TestNewRunnerPod(t *testing.T) { | ||||||
| 							Name:  "DOCKER_CERT_PATH", | 							Name:  "DOCKER_CERT_PATH", | ||||||
| 							Value: "/certs/client", | 							Value: "/certs/client", | ||||||
| 						}, | 						}, | ||||||
| 						{ |  | ||||||
| 							Name:  "RUNNER_FEATURE_FLAG_EPHEMERAL", |  | ||||||
| 							Value: "true", |  | ||||||
| 						}, |  | ||||||
| 					}, | 					}, | ||||||
| 					VolumeMounts: []corev1.VolumeMount{ | 					VolumeMounts: []corev1.VolumeMount{ | ||||||
| 						{ | 						{ | ||||||
|  | @ -228,10 +224,6 @@ func TestNewRunnerPod(t *testing.T) { | ||||||
| 							Name:  "RUNNER_EPHEMERAL", | 							Name:  "RUNNER_EPHEMERAL", | ||||||
| 							Value: "true", | 							Value: "true", | ||||||
| 						}, | 						}, | ||||||
| 						{ |  | ||||||
| 							Name:  "RUNNER_FEATURE_FLAG_EPHEMERAL", |  | ||||||
| 							Value: "true", |  | ||||||
| 						}, |  | ||||||
| 					}, | 					}, | ||||||
| 					VolumeMounts: []corev1.VolumeMount{ | 					VolumeMounts: []corev1.VolumeMount{ | ||||||
| 						{ | 						{ | ||||||
|  | @ -310,10 +302,6 @@ func TestNewRunnerPod(t *testing.T) { | ||||||
| 							Name:  "RUNNER_EPHEMERAL", | 							Name:  "RUNNER_EPHEMERAL", | ||||||
| 							Value: "true", | 							Value: "true", | ||||||
| 						}, | 						}, | ||||||
| 						{ |  | ||||||
| 							Name:  "RUNNER_FEATURE_FLAG_EPHEMERAL", |  | ||||||
| 							Value: "true", |  | ||||||
| 						}, |  | ||||||
| 					}, | 					}, | ||||||
| 					VolumeMounts: []corev1.VolumeMount{ | 					VolumeMounts: []corev1.VolumeMount{ | ||||||
| 						{ | 						{ | ||||||
|  | @ -532,10 +520,6 @@ func TestNewRunnerPodFromRunnerController(t *testing.T) { | ||||||
| 							Name:  "DOCKER_CERT_PATH", | 							Name:  "DOCKER_CERT_PATH", | ||||||
| 							Value: "/certs/client", | 							Value: "/certs/client", | ||||||
| 						}, | 						}, | ||||||
| 						{ |  | ||||||
| 							Name:  "RUNNER_FEATURE_FLAG_EPHEMERAL", |  | ||||||
| 							Value: "true", |  | ||||||
| 						}, |  | ||||||
| 						{ | 						{ | ||||||
| 							Name:  "RUNNER_NAME", | 							Name:  "RUNNER_NAME", | ||||||
| 							Value: "runner", | 							Value: "runner", | ||||||
|  | @ -669,10 +653,6 @@ func TestNewRunnerPodFromRunnerController(t *testing.T) { | ||||||
| 							Name:  "RUNNER_EPHEMERAL", | 							Name:  "RUNNER_EPHEMERAL", | ||||||
| 							Value: "true", | 							Value: "true", | ||||||
| 						}, | 						}, | ||||||
| 						{ |  | ||||||
| 							Name:  "RUNNER_FEATURE_FLAG_EPHEMERAL", |  | ||||||
| 							Value: "true", |  | ||||||
| 						}, |  | ||||||
| 						{ | 						{ | ||||||
| 							Name:  "RUNNER_NAME", | 							Name:  "RUNNER_NAME", | ||||||
| 							Value: "runner", | 							Value: "runner", | ||||||
|  | @ -770,10 +750,6 @@ func TestNewRunnerPodFromRunnerController(t *testing.T) { | ||||||
| 							Name:  "RUNNER_EPHEMERAL", | 							Name:  "RUNNER_EPHEMERAL", | ||||||
| 							Value: "true", | 							Value: "true", | ||||||
| 						}, | 						}, | ||||||
| 						{ |  | ||||||
| 							Name:  "RUNNER_FEATURE_FLAG_EPHEMERAL", |  | ||||||
| 							Value: "true", |  | ||||||
| 						}, |  | ||||||
| 						{ | 						{ | ||||||
| 							Name:  "RUNNER_NAME", | 							Name:  "RUNNER_NAME", | ||||||
| 							Value: "runner", | 							Value: "runner", | ||||||
|  |  | ||||||
|  | @ -54,7 +54,6 @@ const ( | ||||||
| 	EnvVarRepo       = "RUNNER_REPO" | 	EnvVarRepo       = "RUNNER_REPO" | ||||||
| 	EnvVarEnterprise = "RUNNER_ENTERPRISE" | 	EnvVarEnterprise = "RUNNER_ENTERPRISE" | ||||||
| 	EnvVarEphemeral  = "RUNNER_EPHEMERAL" | 	EnvVarEphemeral  = "RUNNER_EPHEMERAL" | ||||||
| 	EnvVarRunnerFeatureFlagEphemeral = "RUNNER_FEATURE_FLAG_EPHEMERAL" |  | ||||||
| 	EnvVarTrue       = "true" | 	EnvVarTrue       = "true" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
|  | @ -830,12 +829,6 @@ func newRunnerPod(runnerName string, template corev1.Pod, runnerSpec v1alpha1.Ru | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	// TODO Remove this once we remove RUNNER_FEATURE_FLAG_EPHEMERAL from runner's entrypoint.sh
 |  | ||||||
| 	// and make --ephemeral the default option.
 |  | ||||||
| 	if getRunnerEnv(pod, EnvVarRunnerFeatureFlagEphemeral) == "" { |  | ||||||
| 		setRunnerEnv(pod, EnvVarRunnerFeatureFlagEphemeral, EnvVarTrue) |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	return *pod, nil | 	return *pod, nil | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -198,7 +198,6 @@ type env struct { | ||||||
| 	githubTokenWebhook                                       string | 	githubTokenWebhook                                       string | ||||||
| 	testEnterprise                                           string | 	testEnterprise                                           string | ||||||
| 	testEphemeral                                            string | 	testEphemeral                                            string | ||||||
| 	featureFlagEphemeral                                     *bool |  | ||||||
| 	scaleDownDelaySecondsAfterScaleOut                       int64 | 	scaleDownDelaySecondsAfterScaleOut                       int64 | ||||||
| 	minReplicas                                              int64 | 	minReplicas                                              int64 | ||||||
| 	dockerdWithinRunnerContainer                             bool | 	dockerdWithinRunnerContainer                             bool | ||||||
|  | @ -234,10 +233,6 @@ func initTestEnv(t *testing.T) *env { | ||||||
| 	e.testEphemeral = testing.Getenv(t, "TEST_EPHEMERAL", "") | 	e.testEphemeral = testing.Getenv(t, "TEST_EPHEMERAL", "") | ||||||
| 	e.testJobs = createTestJobs(id, testResultCMNamePrefix, 20) | 	e.testJobs = createTestJobs(id, testResultCMNamePrefix, 20) | ||||||
| 
 | 
 | ||||||
| 	if ephemeral, err := strconv.ParseBool(testing.Getenv(t, "TEST_FEATURE_FLAG_EPHEMERAL", "")); err == nil { |  | ||||||
| 		e.featureFlagEphemeral = &ephemeral |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	e.scaleDownDelaySecondsAfterScaleOut, _ = strconv.ParseInt(testing.Getenv(t, "TEST_RUNNER_SCALE_DOWN_DELAY_SECONDS_AFTER_SCALE_OUT", "10"), 10, 32) | 	e.scaleDownDelaySecondsAfterScaleOut, _ = strconv.ParseInt(testing.Getenv(t, "TEST_RUNNER_SCALE_DOWN_DELAY_SECONDS_AFTER_SCALE_OUT", "10"), 10, 32) | ||||||
| 	e.minReplicas, _ = strconv.ParseInt(testing.Getenv(t, "TEST_RUNNER_MIN_REPLICAS", "1"), 10, 32) | 	e.minReplicas, _ = strconv.ParseInt(testing.Getenv(t, "TEST_RUNNER_MIN_REPLICAS", "1"), 10, 32) | ||||||
| 
 | 
 | ||||||
|  | @ -308,10 +303,6 @@ func (e *env) installActionsRunnerController(t *testing.T) { | ||||||
| 		fmt.Sprintf("ENTERPRISE_RUNNER_MIN_REPLICAS=%d", e.minReplicas), | 		fmt.Sprintf("ENTERPRISE_RUNNER_MIN_REPLICAS=%d", e.minReplicas), | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if e.featureFlagEphemeral != nil { |  | ||||||
| 		varEnv = append(varEnv, fmt.Sprintf("RUNNER_FEATURE_FLAG_EPHEMERAL=%v", *e.featureFlagEphemeral)) |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	if e.useApp { | 	if e.useApp { | ||||||
| 		varEnv = append(varEnv, | 		varEnv = append(varEnv, | ||||||
| 			"ACCEPTANCE_TEST_SECRET_TYPE=app", | 			"ACCEPTANCE_TEST_SECRET_TYPE=app", | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue