INNER CODE UNIT · Go

helmGetArgs

databus23/helm-diff · cmd/helm.go:141

func helmGetArgs(what, release string, revision int, namespace, kubeContext string) []string {
	args := []string{helmGetSubcmd, what, release}
	if revision > 0 {
		args = append(args, "--revision", strconv.Itoa(revision))
	}
	if namespace != "" {
		args = append(args, "--namespace", namespace)
	}
	if kubeContext != "" {
		args = append(args, "--kube-context", kubeContext)
	}
	return args
}

// getRelease returns the manifest of the given release revision.
// A revision of 0 means the newest revision.
func getRelease(release string, revision int, namespace, kubeContext string) ([]byte, error) {
	cmd := exec.Command(os.Getenv("HELM_BIN"), helmGetArgs("manifest", release, revision, namespace, kubeContext)...)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…