Created
March 18, 2022 14:37
-
-
Save stevehenderson/5cee6be4aec81db130c718bf0c3c74aa to your computer and use it in GitHub Desktop.
Get K8s StatefulSet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
appsv1 "k8s.io/api/apps/v1" | |
) | |
// StatefulSetGetAll returns all STS for the managed cluster | |
func (mgr *manager) StatefulSetGetAll() *appsv1.StatefulSetList { | |
stslister, err := mgr.k8sclient.AppsV1().StatefulSets("").List(context.TODO(), metav1.ListOptions{}) | |
if err != nil { | |
fmt.Println("error getting StatefulSetGetAll: ", err) | |
} | |
return stslister | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment