Skip to content

Commit f520134

Browse files
committed
remove validating webhook
Signed-off-by: odubajDT <[email protected]>
1 parent 7b4fac7 commit f520134

File tree

2 files changed

+1
-34
lines changed

2 files changed

+1
-34
lines changed

apis/core/v1beta2/featureflagsource_webhook.go

-33
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,8 @@ limitations under the License.
1717
package v1beta2
1818

1919
import (
20-
"fmt"
21-
22-
"k8s.io/apimachinery/pkg/runtime"
2320
ctrl "sigs.k8s.io/controller-runtime"
2421
logf "sigs.k8s.io/controller-runtime/pkg/log"
25-
"sigs.k8s.io/controller-runtime/pkg/webhook"
2622
)
2723

2824
// log is for logging in this package.
@@ -33,32 +29,3 @@ func (r *FeatureFlagSource) SetupWebhookWithManager(mgr ctrl.Manager) error {
3329
For(r).
3430
Complete()
3531
}
36-
37-
//+kubebuilder:webhook:path=/validate-core-openfeature-dev-v1beta2-featureflagsource,mutating=false,failurePolicy=fail,sideEffects=None,groups=core.openfeature.dev,resources=featureflagsources,verbs=create;update,versions=v1beta2,name=vfeatureflagsource.kb.io,admissionReviewVersions=v1
38-
39-
var _ webhook.Validator = &FeatureFlagSource{}
40-
41-
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
42-
func (r *FeatureFlagSource) ValidateCreate() error {
43-
featureflagsourcelog.Info("validate create", "name", r.Name)
44-
return validateFFS(r)
45-
}
46-
47-
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
48-
func (r *FeatureFlagSource) ValidateUpdate(old runtime.Object) error {
49-
featureflagsourcelog.Info("validate update", "name", r.Name)
50-
return validateFFS(r)
51-
}
52-
53-
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
54-
func (r *FeatureFlagSource) ValidateDelete() error {
55-
featureflagsourcelog.Info("validate delete", "name", r.Name)
56-
return nil
57-
}
58-
59-
func validateFFS(ffs *FeatureFlagSource) error {
60-
if ffs.Spec.InProces != nil && ffs.Spec.RPC != nil {
61-
return fmt.Errorf("rpc and in-process evaluation cannot be set together")
62-
}
63-
return nil
64-
}

apis/core/v1beta2/zz_generated.deepcopy.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)