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

feat(cli): make kamel delete command aware of KameletBindings #2332

Merged
merged 1 commit into from
Jun 1, 2021

Conversation

tadayosi
Copy link
Member

Kamelet Binding controller now attaches "created.by" labels to integrations which a kamelet binding creates, and kamel delete
uses these labels to identify bindings to delete together if there is any.

Fix #2305

Copy link
Member

@nicolaferraro nicolaferraro left a comment

Choose a reason for hiding this comment

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

Just a few changes.. Thanks a lot!

fmt.Println("KameletBinding " + binding + " deleted")
return nil
}
return c.Delete(ctx, integration)
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 skip this when the KameletBinding is deleted? Deletion of integration is done in cascade, otherwise there might be temporary recreations.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, the code already relies on the cascading delete. In this code, when the KameletBinding is deleted it early returns in the previous block so c.Delete(ctx, integration) won't be executed. Isn't it what you suggest?

pkg/cmd/delete.go Outdated Show resolved Hide resolved
pkg/controller/kameletbinding/common.go Outdated Show resolved Hide resolved
Kamelet Binding controller now attaches "created.by" labels to
integrations which a kamelet binding creates, and `kamel delete`
uses these labels to identify bindings to delete together if there is
any.

Fix apache#2305
@tadayosi
Copy link
Member Author

tadayosi commented Jun 1, 2021

@nicolaferraro Changed. Can you have a look? Thanks!

@nicolaferraro nicolaferraro merged commit 0e2423f into apache:main Jun 1, 2021
@nicolaferraro nicolaferraro mentioned this pull request Jul 2, 2021
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.

Kamel delete should consider KameletBindings
4 participants