66 SecretKind = "Secret"
77 ClusterRoleKind = "ClusterRole"
88 ClusterRoleBindingKind = "ClusterRoleBinding"
9+ ConfigMapKind = "ConfigMap"
910 ServiceAccountKind = "ServiceAccount"
1011 ServiceKind = "Service"
1112 RoleKind = "Role"
@@ -14,28 +15,28 @@ const (
1415 ServiceMonitorKind = "ServiceMonitor"
1516)
1617
17- var supportedResources map [string ]bool
18+ // Namespaced indicates whether the resource is namespace scoped (true) or cluster-scoped (false).
19+ type Namespaced bool
1820
19- // Add a list of supported resources to the map
2021// Key: Kind name
21- // Value: If namaspaced kind, true. Otherwise, false
22- func init () {
23- supportedResources = make ( map [ string ] bool , 11 )
24-
25- supportedResources [ CSVKind ] = true
26- supportedResources [ CRDKind ] = false
27- supportedResources [ ClusterRoleKind ] = false
28- supportedResources [ ClusterRoleBindingKind ] = false
29- supportedResources [ ServiceKind ] = true
30- supportedResources [ ServiceAccountKind ] = true
31- supportedResources [ RoleKind ] = true
32- supportedResources [ RoleBindingKind ] = true
33- supportedResources [ PrometheusRuleKind ] = true
34- supportedResources [ ServiceMonitorKind ] = true
22+ // Value: If namespaced kind, true. Otherwise, false
23+ var supportedResources = map [ string ] Namespaced {
24+ CSVKind : true ,
25+ CRDKind : false ,
26+ ClusterRoleKind : false ,
27+ ClusterRoleBindingKind : false ,
28+ ServiceKind : true ,
29+ ServiceAccountKind : true ,
30+ RoleKind : true ,
31+ RoleBindingKind : true ,
32+ PrometheusRuleKind : true ,
33+ ServiceMonitorKind : true ,
34+ SecretKind : true ,
35+ ConfigMapKind : true ,
3536}
3637
3738// IsSupported checks if the object kind is OLM-supported and if it is namespaced
38- func IsSupported (kind string ) (bool , bool ) {
39+ func IsSupported (kind string ) (bool , Namespaced ) {
3940 namespaced , ok := supportedResources [kind ]
4041 return ok , namespaced
4142}
0 commit comments