@@ -398,7 +398,7 @@ func (cfg *Config) validateReconcileConfigResources(supportedGVKs []schema.Group
398
398
}
399
399
400
400
// Also validate the resource filter settings
401
- if err := cfg .validateReconcileResources (supportedGVKs ); err != nil {
401
+ if err := cfg .validateReconcileResources (validResourceNames ); err != nil {
402
402
return err
403
403
}
404
404
@@ -609,7 +609,7 @@ func parseReconcileResourcesString(resources string) ([]string, error) {
609
609
}
610
610
611
611
// validateReconcileResources validates that the specified resource kinds are supported by the controller.
612
- func (cfg * Config ) validateReconcileResources (supportedGVKs []schema. GroupVersionKind ) error {
612
+ func (cfg * Config ) validateReconcileResources (validResourceNames []string ) error {
613
613
resources , err := cfg .GetReconcileResources ()
614
614
if err != nil {
615
615
return fmt .Errorf ("invalid value for flag '%s': %v" , flagReconcileResources , err )
@@ -618,18 +618,13 @@ func (cfg *Config) validateReconcileResources(supportedGVKs []schema.GroupVersio
618
618
return nil
619
619
}
620
620
621
- validResourceKinds := make ([]string , 0 , len (supportedGVKs ))
622
- for _ , gvk := range supportedGVKs {
623
- validResourceKinds = append (validResourceKinds , gvk .Kind )
624
- }
625
-
626
621
for _ , resource := range resources {
627
- if ! ackutil .InStrings (resource , validResourceKinds ) {
622
+ if ! ackutil .InStrings (resource , validResourceNames ) {
628
623
return fmt .Errorf (
629
624
"invalid value for flag '%s': resource kind '%s' is not supported by this controller. Valid resource kinds are: %s" ,
630
625
flagReconcileResources ,
631
626
resource ,
632
- strings .Join (validResourceKinds , ", " ),
627
+ strings .Join (validResourceNames , ", " ),
633
628
)
634
629
}
635
630
}
0 commit comments