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: helm app deployment failure #3060

Merged
merged 3 commits into from
Mar 2, 2023
Merged

Conversation

vishal-dt
Copy link
Contributor

@vishal-dt vishal-dt commented Mar 1, 2023

Description

If the helm install fails during CD, re-triggering the CD gives error as
cannot re-use a name that is still in use

Fixes #3068

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

Steps to reproduce the issue is mentioned in above issue.
Steps followed to test the solution:

  1. Create a CD pipeline (with Helm deployment and Manual mode)
  2. Allow Environment Override
  3. Modify Ports in Deployment Template in Environment Overrides
ContainerPort:
  - envoyPort: 0
    idleTimeout: 1800s
    name: app
    port: 0
    servicePort: 0
    supportStreaming: false
    useHTTP2: false
  1. Trigger CD pipeline
  2. 1st Failure will have a message related to invalid yaml values
  3. Re-trigger CD pipeline, it will show same error message about invalid yaml values

Screenshot 2023-03-02 at 12 39 04 AM

8. Delete the Environment Overrides 9. Re-trigger the CD pipeline and the deployment should be successful

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?

NO


anupdhiran
anupdhiran previously approved these changes Mar 1, 2023
Copy link
Contributor

@anupdhiran anupdhiran left a comment

Choose a reason for hiding this comment

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

Have provided comments to him offline about PR body and logger comment. Rest looks ok.

@@ -2176,17 +2176,27 @@ func (impl *AppServiceImpl) createHelmAppForCdPipeline(overrideRequest *bean.Val
ReleaseIdentifier: releaseIdentifier,
}
helmResponse, err := impl.helmAppClient.InstallReleaseWithCustomChart(ctx, helmInstallRequest)

//IMP: update cd pipeline to mark deployment app created, even if helm install fails
Copy link
Contributor

Choose a reason for hiding this comment

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

why we have to mark this true if app does not created

Copy link
Contributor Author

Choose a reason for hiding this comment

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

discussed

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 2, 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

@vishal-dt vishal-dt requested a review from vikramdevtron March 2, 2023 08:51
@vishal-dt vishal-dt merged commit f988595 into main Mar 2, 2023
@vishal-dt vishal-dt deleted the fix-helm-app-deployment-failed branch March 2, 2023 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: helm app cd trigger failure
3 participants