@@ -17,22 +17,23 @@ import (
1717)
1818
1919var Filemap = map [string ]string {
20- "Deployment " : constants .CLUSTER_RESOURCES_DEPLOYMENTS ,
21- "StatefulSet " : constants .CLUSTER_RESOURCES_STATEFULSETS ,
22- "NetworkPolicy " : constants .CLUSTER_RESOURCES_NETWORK_POLICY ,
23- "Pod " : constants .CLUSTER_RESOURCES_PODS ,
24- "Ingress " : constants .CLUSTER_RESOURCES_INGRESS ,
25- "Service " : constants .CLUSTER_RESOURCES_SERVICES ,
26- "ResourceQuota " : constants .CLUSTER_RESOURCES_RESOURCE_QUOTA ,
27- "Job " : constants .CLUSTER_RESOURCES_JOBS ,
28- "PersistentVolumeClaim " : constants .CLUSTER_RESOURCES_PVCS ,
20+ "deployment " : constants .CLUSTER_RESOURCES_DEPLOYMENTS ,
21+ "statefulset " : constants .CLUSTER_RESOURCES_STATEFULSETS ,
22+ "networkpolicy " : constants .CLUSTER_RESOURCES_NETWORK_POLICY ,
23+ "pod " : constants .CLUSTER_RESOURCES_PODS ,
24+ "ingress " : constants .CLUSTER_RESOURCES_INGRESS ,
25+ "service " : constants .CLUSTER_RESOURCES_SERVICES ,
26+ "resourcequota " : constants .CLUSTER_RESOURCES_RESOURCE_QUOTA ,
27+ "job " : constants .CLUSTER_RESOURCES_JOBS ,
28+ "persistentvolumeclaim " : constants .CLUSTER_RESOURCES_PVCS ,
2929 "pvc" : constants .CLUSTER_RESOURCES_PVCS ,
30- "ReplicaSet" : constants .CLUSTER_RESOURCES_REPLICASETS ,
31- "Namespace" : fmt .Sprintf ("%s.json" , constants .CLUSTER_RESOURCES_NAMESPACES ),
32- "PersistentVolume" : fmt .Sprintf ("%s.json" , constants .CLUSTER_RESOURCES_PVS ),
30+ "replicaset" : constants .CLUSTER_RESOURCES_REPLICASETS ,
31+ "configmap" : constants .CLUSTER_RESOURCES_CONFIGMAPS ,
32+ "namespace" : fmt .Sprintf ("%s.json" , constants .CLUSTER_RESOURCES_NAMESPACES ),
33+ "persistentvolume" : fmt .Sprintf ("%s.json" , constants .CLUSTER_RESOURCES_PVS ),
3334 "pv" : fmt .Sprintf ("%s.json" , constants .CLUSTER_RESOURCES_PVS ),
34- "Node " : fmt .Sprintf ("%s.json" , constants .CLUSTER_RESOURCES_NODES ),
35- "StorageClass " : fmt .Sprintf ("%s.json" , constants .CLUSTER_RESOURCES_STORAGE_CLASS ),
35+ "node " : fmt .Sprintf ("%s.json" , constants .CLUSTER_RESOURCES_NODES ),
36+ "storageclass " : fmt .Sprintf ("%s.json" , constants .CLUSTER_RESOURCES_STORAGE_CLASS ),
3637}
3738
3839type AnalyzeClusterResource struct {
@@ -66,6 +67,9 @@ func FindResource(kind string, clusterScoped bool, namespace string, name string
6667
6768 var datapath string
6869
70+ // lowercase the kind to avoid case sensitivity
71+ kind = strings .ToLower (kind )
72+
6973 resourceLocation , ok := Filemap [kind ]
7074
7175 if ! ok {
0 commit comments