Missed deprecation (#2047)

in the refactoring we did move from CI_SYSTEM_ARCH to CI_SYSTEM_PLATFORM

but we missed to set the var in the agent pipeline tracer, so the
Kubernetes backend did not work with it.

this fix it and also make it  deprecated as intended
This commit is contained in:
6543 2023-07-28 13:32:30 +02:00 committed by GitHub
parent 9fdb5d9400
commit 7635b5d1f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 4 deletions

View file

@ -76,7 +76,7 @@ func (r *Runner) createTracer(ctxmeta context.Context, logger zerolog.Logger, wo
state.Pipeline.Step.Environment["CI_STEP_STARTED"] = strconv.FormatInt(state.Pipeline.Time, 10)
state.Pipeline.Step.Environment["CI_STEP_FINISHED"] = strconv.FormatInt(time.Now().Unix(), 10)
state.Pipeline.Step.Environment["CI_SYSTEM_ARCH"] = runtime.GOOS + "/" + runtime.GOARCH
state.Pipeline.Step.Environment["CI_SYSTEM_PLATFORM"] = runtime.GOOS + "/" + runtime.GOARCH
// DEPRECATED
state.Pipeline.Step.Environment["CI_BUILD_STATUS"] = "success"
@ -85,6 +85,7 @@ func (r *Runner) createTracer(ctxmeta context.Context, logger zerolog.Logger, wo
state.Pipeline.Step.Environment["CI_JOB_STATUS"] = "success"
state.Pipeline.Step.Environment["CI_JOB_STARTED"] = strconv.FormatInt(state.Pipeline.Time, 10)
state.Pipeline.Step.Environment["CI_JOB_FINISHED"] = strconv.FormatInt(time.Now().Unix(), 10)
state.Pipeline.Step.Environment["CI_SYSTEM_ARCH"] = runtime.GOOS + "/" + runtime.GOARCH
if state.Pipeline.Error != nil {
state.Pipeline.Step.Environment["CI_PIPELINE_STATUS"] = "failure"

View file

@ -55,7 +55,7 @@ See the [kubernetes documentation](https://kubernetes.io/docs/concepts/security/
### nodeSelector
Specify the label which is used to select the node where the job should be executed. Labels defined here will be appended to a list already containing "kubernetes.io/arch".
By default the pod will use "kubernetes.io/arch" inferred from top-level "platform" setting which is deducted from the agents' environment variable CI_SYSTEM_ARCH. To overwrite this, you need to specify this label in the nodeSelector section.
By default the pod will use "kubernetes.io/arch" inferred from top-level "platform" setting which is deducted from the agents' environment variable CI_SYSTEM_PLATFORM. To overwrite this, you need to specify this label in the nodeSelector section.
See the [kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) for more information on using nodeSelector.
Example pipeline configuration:

View file

@ -55,7 +55,7 @@ See the [kubernetes documentation](https://kubernetes.io/docs/concepts/security/
### nodeSelector
Specify the label which is used to select the node where the job should be executed. Labels defined here will be appended to a list already containing "kubernetes.io/arch".
By default the pod will use "kubernetes.io/arch" inferred from top-level "platform" setting which is deducted from the agents' environment variable CI_SYSTEM_ARCH. To overwrite this, you need to specify this label in the nodeSelector section.
By default the pod will use "kubernetes.io/arch" inferred from top-level "platform" setting which is deducted from the agents' environment variable CI_SYSTEM_PLATFORM. To overwrite this, you need to specify this label in the nodeSelector section.
See the [kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) for more information on using nodeSelector.
Example pipeline configuration:

View file

@ -95,7 +95,7 @@ func Pod(namespace string, step *types.Step, labels, annotations map[string]stri
labels["step"] = podName
var nodeSelector map[string]string
platform, exist := step.Environment["CI_SYSTEM_ARCH"]
platform, exist := step.Environment["CI_SYSTEM_PLATFORM"]
if exist && platform != "" {
arch := strings.Split(platform, "/")[1]
nodeSelector = map[string]string{v1.LabelArchStable: arch}