prow/cmd/tackle/main.go
func applyCreate(ctx string, args ...string) error {
	create := exec.Command("kubectl", append([]string{"--dry-run=true", "--output=yaml", "create"}, args...)...)
	create.Stderr = os.Stderr
	obj, err := create.StdoutPipe()
	if err != nil {
		return fmt.Errorf("rolebinding pipe: %v", err)
	}

	if err := create.Start(); err != nil {
		return fmt.Errorf("start create: %v", err)
	}
	if err := apply(ctx, obj); err != nil {
		return fmt.Errorf("apply: %v", err)
	}
	if err := create.Wait(); err != nil {
		return fmt.Errorf("create: %v", err)
	}
	return nil
}
func applyCreate(ctx string, args ...string) error {
	create := exec.Command("kubectl", append([]string{"--dry-run=true", "--output=yaml", "create"}, args...)...)
	create.Stderr = os.Stderr
	obj, err := create.StdoutPipe()
	if err != nil {
		return fmt.Errorf("rolebinding pipe: %v", err)
	}

	if err := create.Start(); err != nil {
		return fmt.Errorf("start create: %v", err)
	}
	if err := apply(ctx, obj); err != nil {
		return fmt.Errorf("apply: %v", err)
	}
	if err := create.Wait(); err != nil {
		return fmt.Errorf("create: %v", err)
	}
	return nil
}
func applyCreate ( ctx string , args ... string ) error { create := exec . Command ( " " , append ( [ ] string { " " , " " , " " } , args ... ) ... ) create . Stderr = os . Stderr obj , err := create . StdoutPipe ( ) if err != nil { return fmt . Errorf ( " " , err ) } if err := create . Start ( ) ; err != nil { return fmt . Errorf ( " " , err ) } if err := apply ( ctx , obj ) ; err != nil { return fmt . Errorf ( " " , err ) } if err := create . Wait ( ) ; err != nil { return fmt . Errorf ( " " , err ) } return nil }
// applyCreate will dry-run create and then pipe this to kubectl apply.
//
// If we use the create verb it will fail if the secret already exists.
// And kubectl will reject the apply verb with a secret.
applyCreate will dry - run create and then pipe this to kubectl apply . If we use the create verb it will fail if the secret already exists . And kubectl will reject the apply verb with a secret .