Documentation ¶
Index ¶
- func GetPDBLabelSelector(pdbLabels map[string]string) string
- type Kubeclient
- func (k *Kubeclient) Create(pdb *policy.PodDisruptionBudget) (*policy.PodDisruptionBudget, error)
- func (k *Kubeclient) Delete(name string, options *metav1.DeleteOptions) error
- func (k *Kubeclient) Get(name string, opts metav1.GetOptions) (*policy.PodDisruptionBudget, error)
- func (k *Kubeclient) List(opts metav1.ListOptions) (*policy.PodDisruptionBudgetList, error)
- func (k *Kubeclient) WithNamespace(namespace string) *Kubeclient
- type KubeclientBuildOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPDBLabelSelector ¶
GetPDBLabelSelector returns the labelSelector to list the PDB
Types ¶
type Kubeclient ¶
type Kubeclient struct {
// contains filtered or unexported fields
}
Kubeclient enables kubernetes API operations on upgrade result instance
func KubeClient ¶
func KubeClient(opts ...KubeclientBuildOption) *Kubeclient
KubeClient returns a new instance of kubeclient meant for admission webhook related operations
func (*Kubeclient) Create ¶
func (k *Kubeclient) Create(pdb *policy.PodDisruptionBudget) (*policy.PodDisruptionBudget, error)
Create creates poddisruptionbudget, and returns the corresponding poddisruptionbudget object, and an error if there is any.
func (*Kubeclient) Delete ¶
func (k *Kubeclient) Delete(name string, options *metav1.DeleteOptions) error
Delete deletes poddisruptionbudget object for given name in corresponding namespace
func (*Kubeclient) Get ¶
func (k *Kubeclient) Get(name string, opts metav1.GetOptions) (*policy.PodDisruptionBudget, error)
Get takes name of the poddisruptionbudget, and returns the corresponding poddisruptionbudget object, and an error if there is any.
func (*Kubeclient) List ¶
func (k *Kubeclient) List(opts metav1.ListOptions) (*policy.PodDisruptionBudgetList, error)
List takes label and field selectors, and returns the list of PodDisruptionBudget instances that match those selectors.
func (*Kubeclient) WithNamespace ¶
func (k *Kubeclient) WithNamespace(namespace string) *Kubeclient
WithNamespace sets namespace that should be used during kuberenets API calls against namespaced resource
type KubeclientBuildOption ¶
type KubeclientBuildOption func(*Kubeclient)
KubeclientBuildOption defines the abstraction to build a kubeclient instance
func WithClientset ¶
func WithClientset(c *kubernetes.Clientset) KubeclientBuildOption
WithClientset sets the kubernetes clientset against the kubeclient instance