fix: wrong registry creds is used in CD stage (PRE/POST) #4717
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.
Description
Wrong registry credential is supplied to CD stage (Pre-CD/ Post-CD). This PR will fix that issue.
Pre/ Post CD Registry Credentials:
CI Build :
It will use the overridden credentials (if any) OR the base application level credentials.
Link CI :
It will fetch the parent CI pipeline first.
Then will use the CI Build overridden credentials (if any) OR the Source application (App that contains CI Build) level credentials.
Sync CD :
It will fetch the parent CD pipeline first.
CASE CD Pipeline has CI Build as artifact provider :
Then will use the CI Build overridden credentials (if any) OR the Source application (App that contains CI Build) level credentials.
CASE CD Pipeline has Link CI as artifact provider :
It will fetch the parent CI pipeline of the Link CI first.
Then will use the CI Build overridden credentials (if any) OR the Source application (App that contains CI Build) level credentials.
Skopeo Plugin :
If any artifact has information about :
credentials_source_type(global_container_registry) credentials_source_value(registry_id)
Then we will use the credentials_source_value to derive the credentials.
Polling plugin :
If the ci_pipeline_type type is CI_JOB
We will always fetch the registry credentials from the ci_template_override table
Fixes #4665
How Has This Been Tested?
Checklist:
Does this PR introduce a user-facing change?