Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wrong registry creds is used in CD stage (PRE/POST) #4717

Merged
merged 6 commits into from
Mar 5, 2024

Conversation

Ash-exp
Copy link
Contributor

@Ash-exp Ash-exp commented Feb 27, 2024

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?

  • CI Build
  • Linked CI
  • Linked CD
  • Webhook
  • CI Job
  • Skopeo plugin
  • Devtron Jobs

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR requires documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have tested it for all user roles.
  • I have added all the required unit/api test cases.

Does this PR introduce a user-facing change?


Copy link

sonarcloud bot commented Mar 1, 2024

Quality Gate Passed Quality Gate passed

Issues
5 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@Ash-exp Ash-exp self-assigned this Mar 4, 2024
@Ash-exp Ash-exp merged commit 29467e3 into main Mar 5, 2024
5 checks passed
@Ash-exp Ash-exp deleted the fix-cd-stage-docker-creds branch March 5, 2024 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Picking wrong container registry during docker login in post Deployment pod
2 participants