Fix for failed to fetch controller: unsupported controller kind StatefulSet

This commit is contained in:
Nanthini Muniapan 2023-09-14 15:26:57 +08:00
parent 9261f26bfe
commit 678fbbbaca

View File

@ -73,6 +73,8 @@ func FetchControllerObj(kind, name, namespace string, clientset *kubernetes.Clie
return clientset.AppsV1().ReplicaSets(namespace).Get(context.TODO(), name, metav1.GetOptions{}) return clientset.AppsV1().ReplicaSets(namespace).Get(context.TODO(), name, metav1.GetOptions{})
case "DaemonSet": case "DaemonSet":
return clientset.AppsV1().DaemonSets(namespace).Get(context.TODO(), name, metav1.GetOptions{}) return clientset.AppsV1().DaemonSets(namespace).Get(context.TODO(), name, metav1.GetOptions{})
case "StatefulSet":
return clientset.AppsV1().StatefulSets(namespace).Get(context.TODO(), name, metav1.GetOptions{})
default: default:
return nil, fmt.Errorf("unsupported controller kind %s", kind) return nil, fmt.Errorf("unsupported controller kind %s", kind)
} }