Exclude user-defined build variables from cache archiver environment
In !2626 (comment 485886201), a user defined AZURE_STORAGE_KEY
as a CI/CD variable, and that breaks Azure cache uploads because GoCloud attempts to use that instead of the AZURE_SAS_TOKEN
.
In https://gitlab.com/gitlab-org/gitlab-runner/blob/a0d5e7bad3973fb9595cf310377d526fd0ec2481/shells/abstract.go#L521, we call b.writeExports()
, which writes all build variables into the environment: https://gitlab.com/gitlab-org/gitlab-runner/blob/a0d5e7bad3973fb9595cf310377d526fd0ec2481/shells/abstract.go#L228-230.
In !2639 (closed), I worked around a similar problem by excluding CI variables that conflicted with S3 environment variables, such as AWS_ACCESS_KEY_ID
.
Is there any reason the cache-archiver actually needs the user-defined CI/CD variables? I can see a case to be made for a subset of the variables used here, such as the TLS and secrets variables, but I don't know of a use case for the user-defined CI/CD variables. Can we exclude these from info.Build.GetAllVariables()
?
Thoughts @tmaczukin @steveazz?