-
Notifications
You must be signed in to change notification settings - Fork 242
/
supported_resources.go
56 lines (52 loc) · 1.96 KB
/
supported_resources.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package bundle
const (
CSVKind = "ClusterServiceVersion"
CRDKind = "CustomResourceDefinition"
SecretKind = "Secret"
ClusterRoleKind = "ClusterRole"
ClusterRoleBindingKind = "ClusterRoleBinding"
ConfigMapKind = "ConfigMap"
ServiceAccountKind = "ServiceAccount"
ServiceKind = "Service"
RoleKind = "Role"
RoleBindingKind = "RoleBinding"
PrometheusRuleKind = "PrometheusRule"
ServiceMonitorKind = "ServiceMonitor"
PodDisruptionBudgetKind = "PodDisruptionBudget"
PriorityClassKind = "PriorityClass"
VerticalPodAutoscalerKind = "VerticalPodAutoscaler"
ConsoleYAMLSampleKind = "ConsoleYAMLSample"
ConsoleQuickStartKind = "ConsoleQuickStart"
ConsoleCLIDownloadKind = "ConsoleCLIDownload"
ConsoleLinkKind = "ConsoleLink"
)
// Namespaced indicates whether the resource is namespace scoped (true) or cluster-scoped (false).
type Namespaced bool
// Key: Kind name
// Value: If namespaced kind, true. Otherwise, false
var supportedResources = map[string]Namespaced{
CSVKind: true,
CRDKind: false,
ClusterRoleKind: false,
ClusterRoleBindingKind: false,
ServiceKind: true,
ServiceAccountKind: true,
RoleKind: true,
RoleBindingKind: true,
PrometheusRuleKind: true,
ServiceMonitorKind: true,
SecretKind: true,
ConfigMapKind: true,
PodDisruptionBudgetKind: true,
PriorityClassKind: false,
VerticalPodAutoscalerKind: false,
ConsoleYAMLSampleKind: false,
ConsoleQuickStartKind: false,
ConsoleCLIDownloadKind: false,
ConsoleLinkKind: false,
}
// IsSupported checks if the object kind is OLM-supported and if it is namespaced
func IsSupported(kind string) (bool, Namespaced) {
namespaced, ok := supportedResources[kind]
return ok, namespaced
}