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 to check all canary resources are deleted #484

Merged
merged 2 commits into from Jul 20, 2020
Merged

Fix to check all canary resources are deleted #484

merged 2 commits into from Jul 20, 2020

Conversation

nakabonne
Copy link
Member

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #478

Does this PR introduce a user-facing change?:

NONE

@pipecd-bot
Copy link
Collaborator

COVERAGE

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

File Function Base Head Diff
pkg/app/piped/executor/kubernetes/canary.go Executor.ensureCanaryClean 0.00% 0.00% +0.00%
pkg/app/piped/executor/kubernetes/kubernetes.go Executor.deleteResources 0.00% 0.00% +0.00%

@@ -94,6 +94,7 @@ func (e *Executor) ensureCanaryClean(ctx context.Context) model.StageStatus {

resources := strings.Split(value, ",")
if err := e.removeCanaryResources(ctx, resources); err != nil {
e.LogPersister.AppendErrorf("Unable to remove canary resources: %v", err)
Copy link
Member

Choose a reason for hiding this comment

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

Can you add this log for baseline too?

return fmt.Errorf("unable to delete %d resources", len(resources)-deletedCount)
if deletedCount < resourcesLen {
e.LogPersister.AppendInfof("Deleted %d/%d resources", deletedCount, resourcesLen)
return fmt.Errorf("unable to delete %d resources", resourcesLen-deletedCount)
Copy link
Member

Choose a reason for hiding this comment

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

Nice.

@pipecd-bot
Copy link
Collaborator

COVERAGE

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

File Function Base Head Diff
pkg/app/piped/executor/kubernetes/baseline.go Executor.ensureBaselineClean 0.00% 0.00% +0.00%
pkg/app/piped/executor/kubernetes/canary.go Executor.ensureCanaryClean 0.00% 0.00% +0.00%
pkg/app/piped/executor/kubernetes/kubernetes.go Executor.deleteResources 0.00% 0.00% +0.00%

@nakabonne
Copy link
Member Author

Fixed

@nghialv
Copy link
Member

nghialv commented Jul 20, 2020

/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by nghialv.

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 4405e49 into master Jul 20, 2020
@pipecd-bot pipecd-bot deleted the fix-check branch July 20, 2020 05:05
@pipecd-bot pipecd-bot mentioned this pull request Jul 20, 2020
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.

CANARY_CLEAN stage ends with a failure for unknown reasons
3 participants