-
Notifications
You must be signed in to change notification settings - Fork 152
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 kafka E2E test uninstall function #1025
Conversation
pkg/app/kafka.go
Outdated
deleteConfig := []string{"delete", "-n", kc.namespace, "configmap", configMapName} | ||
out, err := helm.RunCmdWithTimeout(ctx, "kubectl", deleteConfig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use client-go methods instead of calling binary?
pkg/app/kafka.go
Outdated
@@ -184,6 +184,11 @@ func (kc *KafkaCluster) Uninstall(ctx context.Context) error { | |||
return errors.Wrap(err, "failed to create helm client") | |||
} | |||
|
|||
err = kc.cli.CoreV1().ConfigMaps(kc.namespace).Delete(ctx, configMapName, metav1.DeleteOptions{}) | |||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if err != nil { | |
if err != nil && !apierrors.IsNotFound(err) { |
Please add an exception for IsNotFound
https://pkg.go.dev/k8s.io/apimachinery/pkg/api/errors#IsNotFound
Change Overview
Add functionality to delete an annotated object {i.e Configmap } of Kafka application in uninstall function.
Pull request type
Please check the type of change your PR introduces:
Issues
Test Plan
./build/integration-test.sh Kafka
Test log: https://gist.github.com/A-kanksh-a/c635b96f90dc67a479c8ce2d0026a6c7