@@ -32,7 +32,6 @@ type FeatureFlagConfigurationValidator struct {
3232
3333// FeatureFlagConfigurationValidator adds an annotation to every incoming pods.
3434func (m * FeatureFlagConfigurationValidator ) Handle (ctx context.Context , req admission.Request ) admission.Response {
35-
3635 config := corev1alpha1.FeatureFlagConfiguration {}
3736 err := m .decoder .Decode (req , & config )
3837 if err != nil {
@@ -51,8 +50,10 @@ func (m *FeatureFlagConfigurationValidator) Handle(ctx context.Context, req admi
5150 if config .Spec .ServiceProvider != nil && config .Spec .ServiceProvider .Credentials != nil {
5251 // Check the provider and whether it has an existing secret
5352 providerKeySecret := corev1.Secret {}
54- if err := m .Client .Get (ctx , client.ObjectKey {Name : config .Spec .ServiceProvider .Credentials .Name ,
55- Namespace : config .Spec .ServiceProvider .Credentials .Namespace }, & providerKeySecret ); errors .IsNotFound (err ) {
53+ if err := m .Client .Get (ctx , client.ObjectKey {
54+ Name : config .Spec .ServiceProvider .Credentials .Name ,
55+ Namespace : config .Spec .ServiceProvider .Credentials .Namespace ,
56+ }, & providerKeySecret ); errors .IsNotFound (err ) {
5657 return admission .Denied ("credentials secret not found" )
5758 }
5859 }
@@ -75,7 +76,6 @@ func (m *FeatureFlagConfigurationValidator) isJSON(str string) bool {
7576}
7677
7778func (m * FeatureFlagConfigurationValidator ) validateJSONSchema (schemaJSON string , inputJSON string ) error {
78-
7979 schemaLoader := gojsonschema .NewBytesLoader ([]byte (schemaJSON ))
8080 valuesLoader := gojsonschema .NewBytesLoader ([]byte (inputJSON ))
8181 result , err := gojsonschema .Validate (schemaLoader , valuesLoader )
0 commit comments