// Restart a DaemonSet rollout.
Restart a DaemonSet rollout.
// Restart a DaemonSet rollout .
func (d *DaemonSet) Restart(ctx context.Context, path string) error {
	ds, err := d.GetInstance(path)
	if err != nil {
		return err
	}
	auth, err := d.Client().CanI(ds.Namespace, "apps/v1/daemonsets", []string{client.PatchVerb})
	if err != nil {
		return err
	}
	if !auth {
		return fmt.Errorf("user is not authorized to restart a daemonset")
	}
	update, err := polymorphichelpers.ObjectRestarterFn(ds)
	if err != nil {
		return err
	}
	dial, err := d.Client().Dial()
	if err != nil {
		return err
	}
	_, err = dial.AppsV1().DaemonSets(ds.Namespace).Patch(
		ctx,
		ds.Name,
		types.StrategicMergePatchType,
		update,
		metav1.PatchOptions{},
	)
	return err
}
func ( d * DaemonSet ) Restart ( ctx context . Context , path string ) error { ds , err := d . GetInstance ( path ) if err != nil { return err } auth , err := d . Client ( ) . CanI ( ds . Namespace , " " , [ ] string { client . PatchVerb } ) if err != nil { return err } if ! auth { return fmt . Errorf ( " " ) } update , err := polymorphichelpers . ObjectRestarterFn ( ds ) if err != nil { return err } dial , err := d . Client ( ) . Dial ( ) if err != nil { return err } _ , err = dial . AppsV1 ( ) . DaemonSets ( ds . Namespace ) . Patch ( ctx , ds . Name , types . StrategicMergePatchType , update , metav1 . PatchOptions { } , ) return err }
Restart a DaemonSet rollout.
Restart a DaemonSet rollout .