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: inducing overridden DockerRegistryId in case docker registry is overridden #4178

Merged
merged 2 commits into from
Oct 30, 2023

Conversation

prakash100198
Copy link
Contributor

@prakash100198 prakash100198 commented Oct 30, 2023

Description

When we override the base build config (docker registry), at the time of inducing the image pull secret in the manifest we only checked for base build config, and not the overridden docker registry config. This pr aims at fixing the same issue.

Fixes #4179

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Tested multiple scenarios such as:-
    1. without ci template override.
    2. with template override and with same creds and container registry.
    3. base had ecr setup and override had docker setup.
    4. base had docker container registry and override had ecr.
    5. in case of auto and manual cd trigger

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?


@prakash100198 prakash100198 changed the title fix: bug fix for fetching dockerRegistryId of docker config if ci pipeline… fix: inducing overridden DockerRegistryId in case docker registry is overridden Oct 30, 2023
}

if ciPipeline.CiTemplate == nil {
impl.logger.Warn("returning as ciPipeline.CiTemplate is found nil")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is response in this case

dockerRegistryId := ciPipeline.CiTemplate.DockerRegistryId
if len(*dockerRegistryId) == 0 {
impl.logger.Warn("returning as dockerRegistryId is found empty")
return nil, nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throw custom error

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This custom error was not being thrown earlier also, so don't know it may impact other flows also outside this function which will increase the scope of this maybe

vikramdevtron
vikramdevtron previously approved these changes Oct 30, 2023
@sonarcloud
Copy link

sonarcloud bot commented Oct 30, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@prakash100198 prakash100198 merged commit 6822926 into main Oct 30, 2023
6 checks passed
@prakash100198 prakash100198 deleted the docker-registry-override-in-ips-fix branch October 30, 2023 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants