Skip to content

Commit

Permalink
Fix artifacts bucket env value in job constants (#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
sp1999 authored Nov 5, 2024
1 parent 34df51b commit 09b3304
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/lint_prowjobs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ func EnvVarsCheck(jc *JobConstants) presubmitCheck {
for _, env := range container.Env {
if index, exists := jc.envVarExist(env.Name); exists {
// check deepequal in case we decide to support EnvVarSource values in the future
if jobs.IsCuratedPackagesPresubmit(presubmitConfig.JobBase.Name) {
jc.EnvVars[index].Value = "s3://codebuildprojectstack-be-pipelineoutputartifactsb-jvwhrzx05xwq"
jcEnvVar := jc.EnvVars[index]
// update the artifacts bucket env value if it is a curated packages presubmit job
if env.Name == "ARTIFACTS_BUCKET" && jobs.IsCuratedPackagesPresubmit(presubmitConfig.JobBase.Name) {
jcEnvVar.Value = "s3://codebuildprojectstack-be-pipelineoutputartifactsb-jvwhrzx05xwq"
}
if env != jc.EnvVars[index] {
if env != jcEnvVar {
lineToFind := fmt.Sprintf("name: %s", env.Name)
correctiveAction := fmt.Sprintf("Incorrect env var declared for %s in the %s container, update it to %s", env.Name, container.Name, env)
return false, findLineNumber(fileContentsString, lineToFind), correctiveAction
Expand Down

0 comments on commit 09b3304

Please sign in to comment.