github.com/jenkins-x/jx/v2@v2.1.155/pkg/kube/daemonsets.go (about)

     1  package kube
     2  
     3  import (
     4  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
     5  	"k8s.io/client-go/kubernetes"
     6  )
     7  
     8  //IsDaemonSetExists checks if a daemonset exists in the namespace
     9  func IsDaemonSetExists(client kubernetes.Interface, name, namespace string) (bool, error) {
    10  	options := metav1.GetOptions{}
    11  
    12  	_, err := client.AppsV1().DaemonSets(namespace).Get(name, options)
    13  	if err != nil {
    14  		return false, err
    15  	}
    16  	return true, nil
    17  }