func()

in gke-deploy/services/kubectl.go [59:78]


func (k *Kubectl) Get(ctx context.Context, kind, name, namespace, format string, ignoreNotFound bool) (string, error) {
	args := []string{"get", kind}
	if name != "" {
		args = append(args, name)
	}
	if namespace != "" {
		args = append(args, "-n", namespace)
	}
	if format != "" {
		args = append(args, fmt.Sprintf("--output=%s", format))
	}
	if ignoreNotFound {
		args = append(args, "--ignore-not-found=true")
	}
	out, err := runCommand(ctx, k.printCommands, "kubectl", args...)
	if err != nil {
		return "", fmt.Errorf("command to get kubernetes config: %v", err)
	}
	return out, nil
}