allow statefulset controller type

This commit is contained in:
Wen Xu 2023-03-21 11:21:21 -04:00
parent 9261f26bfe
commit 281269fd45

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{})
case "DaemonSet":
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:
return nil, fmt.Errorf("unsupported controller kind %s", kind)
}