@@ -191,7 +191,11 @@ func (r *ConfigReconciler) reconcileConfigTypes(inst *api.HNCConfiguration, allR
191191 // If the type is not found, log error and write conditions but don't
192192 // early exit since the other types can still be reconciled.
193193 r .Log .Error (err , "while trying to reconcile the configuration" , "type" , gr , "mode" , rsc .Mode )
194- r .writeCondition (inst , api .ConditionBadTypeConfiguration , api .ReasonResourceNotFound , err .Error ())
194+ if strings .Contains (err .Error (), "not found" ) {
195+ r .writeCondition (inst , api .ConditionBadTypeConfiguration , api .ReasonResourceNotFound , err .Error ())
196+ } else {
197+ r .writeCondition (inst , api .ConditionBadTypeConfiguration , api .ReasonResourceNotNamespaced , err .Error ())
198+ }
195199 continue
196200 }
197201 r .activeGVKMode [gr ] = gvkMode {gvk , rsc .Mode }
@@ -599,6 +603,9 @@ func GVKFor(gr schema.GroupResource, allRes []*restmapper.APIGroupResources) (sc
599603 for _ , version := range group .Versions {
600604 for _ , resource := range groupedResources .VersionedResources [version .Version ] {
601605 if resource .Name == gr .Resource {
606+ if ! resource .Namespaced {
607+ return schema.GroupVersionKind {}, fmt .Errorf ("Resource %q is not namespaced" , gr )
608+ }
602609 // Please note that we cannot use resource.group or resource.version
603610 // here because they are preferred group/version and they are default
604611 // to empty to imply this current containing group/version. Therefore,
0 commit comments