You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 26, 2025. It is now read-only.
Fix Kafka topic creation bug due to recent upgrade of AdmissionReview version (#796)
* Update admission pkg name; add API version and Kind to HTTP request
* Fix lint error
* Add deleted imports by
* Specify Kind and APIVersion when initializing admissionReview
* Make lint-fix
log.Info(fmt.Sprintf("Doing pre-admission validation of kafka topic %s", topic.Spec.Name))
42
42
@@ -54,25 +54,21 @@ func (s *webhookServer) validateKafkaTopic(topic *banzaicloudv1alpha1.KafkaTopic
54
54
ifapierrors.IsNotFound(err) {
55
55
ifk8sutil.IsMarkedForDeletion(topic.ObjectMeta) {
56
56
log.Info("Deleted as a result of a cluster deletion")
57
-
return&admissionv1beta1.AdmissionResponse{
57
+
return&admissionv1.AdmissionResponse{
58
58
Allowed: true,
59
59
}
60
60
}
61
61
log.Error(err, "Referenced kafka cluster does not exist")
62
-
returnnotAllowed(
63
-
fmt.Sprintf("KafkaCluster '%s' in the namespace '%s' does not exist", topic.Spec.ClusterRef.Name, topic.Spec.ClusterRef.Namespace),
64
-
metav1.StatusReasonNotFound,
65
-
)
62
+
returnnotAllowed(fmt.Sprintf("KafkaCluster '%s' in the namespace '%s' does not exist", topic.Spec.ClusterRef.Name, topic.Spec.ClusterRef.Namespace), metav1.StatusReasonNotFound)
66
63
}
67
64
log.Error(err, "API failure while running topic validation")
68
65
returnnotAllowed("API failure while validating topic, please try again", metav1.StatusReasonServiceUnavailable)
0 commit comments