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 a bug that causes piped crashes while rolling back #617

Merged
merged 3 commits into from
Aug 13, 2020
Merged

Conversation

nghialv
Copy link
Member

@nghialv nghialv commented Aug 13, 2020

What this PR does / why we need it:

Scenario:

  • A deployment is triggered
  • The first stage (e.g. K8S_SYNC) is cancelled from web UI while ensurePreparing is running
  • So prepareOnce is marked as executed but s.deploymentConfig = cfg is still not configured
  • The rollback stage starts running
  • Because the prepareOnce was marked as executed so s.deploymentConfig is still nil
  • That causes a panic when accessing s.deploymentConfig in rollback execution

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

/cc @nakabonne

Copy link
Collaborator

@pipecd-bot pipecd-bot left a comment

Choose a reason for hiding this comment

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

GO_LINTER

Some issues were detected while linting go source files in your changes.

pkg/app/piped/controller/scheduler.go Outdated Show resolved Hide resolved
@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 21.50%. This pull request decreases coverage by -0.01%.

File Function Base Head Diff
pkg/app/piped/controller/scheduler.go scheduler.ensurePreparing 0.00% 0.00% +0.00%

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 21.50%. This pull request decreases coverage by -0.01%.

File Function Base Head Diff
pkg/app/piped/controller/scheduler.go scheduler.ensurePreparing 0.00% 0.00% +0.00%

@nakabonne
Copy link
Member

Other than some nits, looks good to me.

Co-authored-by: Ryo Nakao <ryo@nakao.dev>
@nakabonne
Copy link
Member

/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by nakabonne.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

@pipecd-bot pipecd-bot merged commit 8582e3c into master Aug 13, 2020
@pipecd-bot pipecd-bot deleted the scheduler branch August 13, 2020 07:52
@pipecd-bot
Copy link
Collaborator

TEMPLATE

failed to handle template rule examples

Details
Error: unabled to push rendered files to destination

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.

3 participants