We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go
package main import ( "encoding/json" "os" ) type Substitute struct { Variables map[string]string Secrets map[string]string SecretsResources []string } type VersionTarget struct { Name, Kind, Namespace, Path, Version string } type SourceRef struct { Name, Kind string } type Kustomization struct { Name, Namespace, Version, Path string SourceRef SourceRef VersionTarget VersionTarget Substitute Substitute } type DefaultKustomizations struct { Defaults []Kustomization } type Cluster struct { Name, Cloud, Operator string InfraKustomization []Kustomization Ips []string } func main() { // GENERAL KUSTOMIZATION STRUCT DEFAULTS defaultKustomizations := DefaultKustomizations{ []Kustomization{Kustomization{ Name: "ingress-nginx", Namespace: "flux-system", Version: "1.2.3", Path: "./infra/ingress-nginx", SourceRef: SourceRef{Name: "flux-system", Kind: "GitRepository"}, VersionTarget: VersionTarget{Name: "ingress-nginx", Kind: "HelmRelease", Namespace: "ingress-nginx", Path: "/spec/chart/spec/version", Version: "1.2.3"}, }, Kustomization{ Name: "longhorn", Namespace: "flux-system", Version: "4.8.3", Path: "./infra/longhorn", SourceRef: SourceRef{Name: "flux-system", Kind: "GitRepository"}, VersionTarget: VersionTarget{Name: "longhorn", Kind: "HelmRelease", Namespace: "ingress-nginx", Path: "/spec/chart/spec/version", Version: "4.8.3"}, }, Kustomization{ Name: "metallb", Namespace: "flux-system", Version: "4.8.3", Path: "./infra/metallb", SourceRef: SourceRef{Name: "flux-system", Kind: "GitRepository"}, VersionTarget: VersionTarget{Name: "metallb", Kind: "HelmRelease", Namespace: "ingress-nginx", Path: "/spec/chart/spec/version", Version: "4.8.3"}, Substitute: Substitute{Variables: map[string]string{"IP_RANGE": ""}}, }, Kustomization{ Name: "cert-manager", Namespace: "flux-system", Version: "5.1.3", Path: "./infra/cert-manager", SourceRef: SourceRef{Name: "flux-system", Kind: "GitRepository"}, VersionTarget: VersionTarget{Name: "cert-manager", Kind: "HelmRelease", Namespace: "ingress-nginx", Path: "/spec/chart/spec/version", Version: "5.1.3"}, Substitute: Substitute{Variables: map[string]string{"IP_RANGE": "invokeMethod+GetVIP", "INGRESS_DOMAIN": "clusterVars+ingressDomain", "HOSTNAME": "defaultVar+cert-manager"}, Secrets: map[string]string{"APPROLE": ""}, SecretsResources: []string{"flux-vault-secrets"}}, }}} file, _ := json.MarshalIndent(defaultKustomizations, "", " ") _ = os.WriteFile("defaults.json", file, 0644) clusters := Cluster{ Name: "maverick", Cloud: "pve", Operator: "flux2", InfraKustomization: []Kustomization{ Kustomization{ Name: "metallb", Namespace: "flux-system", Version: "123", Path: "./infra/metallb", SourceRef: SourceRef{Name: "flux-system", Kind: "GitRepository"}, VersionTarget: VersionTarget{Name: "metallb", Kind: "HelmRelease", Namespace: "metallb-system", Path: "/spec/chart/spec/version", Version: "123"}, Substitute: Substitute{Variables: map[string]string{"IP_RANGE": "10.31.103.13-10.31.103.14"}}, }, Kustomization{ Name: "cert-manager", Namespace: "flux-system", Version: "123", Path: "./infra/metallb", SourceRef: SourceRef{Name: "flux-system", Kind: "GitRepository"}, VersionTarget: VersionTarget{Name: "cert-manager", Kind: "HelmRelease", Namespace: "cert-manager", Path: "/spec/chart/spec/version", Version: "123"}, Substitute: Substitute{Variables: map[string]string{"INGRESS_DOMAIN": "clusterVars+ingressDomain"}}, }, Kustomization{ Name: "ingress-nginx", Namespace: "ingress-nginx", Version: "123", Path: "./infra/ingress-nginx", SourceRef: SourceRef{Name: "flux-system", Kind: "GitRepository"}, VersionTarget: VersionTarget{Name: "ingress-nginx", Kind: "HelmRelease", Namespace: "ingress-nginx", Path: "/spec/chart/spec/version", Version: "123"}, }, }, Ips: []string{"192.124.24.12", ""}, } clusterFile, _ := json.MarshalIndent(clusters, "", " ") _ = os.WriteFile("clusters.json", clusterFile, 0644) }
The text was updated successfully, but these errors were encountered:
patrick-hermann-sva
No branches or pull requests
go
The text was updated successfully, but these errors were encountered: