Do not add any labels to Docker images if addPipelineData is false #416
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First of all, many thanks to @Parsa2820 for the PR on the original repository: microsoft/azure-pipelines-tasks#16604. All I'm doing here is making sure these changes can go ahead and be merged even after it was closed on the original repo.
Currently, even when setting both the
addPipelineData
andaddBaseImageData
tofalse
in theDocker@2
task, the resulting docker command still includes 2 default labels:When running the task inside a release it also includes the label
release.releaseid
.This PR changes the behavior of the
Docker@2
task so that adding labels with the values ofsystem.teamfoundationcollectionuri
andbuild.sourceversion
can be enabled/disabled with theaddPipelineData
boolean variable, which can be set in the pipeline.Task name:
DockerV2
Description: Control the mentioned docker image labels. Previously these labels were always added, and there was no option to remove them. This behavior caused the private repository URI to be exposed in the docker image.
Documentation changes required: (Y/N) N
Added unit tests: (Y/N) N
Attached related issue: (Y/N) microsoft/azure-pipelines-tasks#13268 (Not sure if the issues on the old repository are still relevant, I'd gladly open one in here if necessary).
Checklist: