Skip to content
New issue

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

Api convention #1795

Merged
merged 4 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/aws/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,7 @@ func createAws(cmd *cobra.Command, args []string) error {
}

if viper.GetString("flags.dns-provider") == "cloudflare" {
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", gitopsDirectoryTokens.ExternalDNSProviderName)] = config.CloudflareApiToken
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", gitopsDirectoryTokens.ExternalDNSProviderName)] = config.CloudflareAPIToken
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", gitopsDirectoryTokens.ExternalDNSProviderName)] = config.CloudflareOriginCaIssuerAPIToken
} else {
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", gitopsDirectoryTokens.ExternalDNSProviderName)] = "AWS_Placeholder"
Expand All @@ -1395,7 +1395,7 @@ func createAws(cmd *cobra.Command, args []string) error {
//dns provider secret to be stored in vault for external dns lifecycle
switch dnsProviderFlag {
case "cloudflare":
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", strings.ToLower(dnsProviderFlag))] = config.CloudflareApiToken
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", strings.ToLower(dnsProviderFlag))] = config.CloudflareAPIToken
default:
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", strings.ToLower(dnsProviderFlag))] = "This is not used, role used instead" //Not strictly used. We use a role in GCP but keeping this here for consistency
}
Expand Down
13 changes: 10 additions & 3 deletions cmd/civo/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,14 @@ func createCivo(cmd *cobra.Command, args []string) error {
}

log.Info().Msg("applying the registry application to argocd")
registryApplicationObject := argocd.GetArgoCDApplicationObject(gitopsRepoURL, fmt.Sprintf("registry/%s", clusterNameFlag))

var registryApplicationObject string
if gitProviderFlag == "github" {
registryApplicationObject = argocd.GetArgoCDApplicationObject(gitopsRepoURL, fmt.Sprintf("registry/clusters/%s", clusterNameFlag))
} else {
registryApplicationObject = argocd.GetArgoCDApplicationObject(gitopsRepoURL, fmt.Sprintf("registry/%s", clusterNameFlag))
}

_, _ = argocdClient.ArgoprojV1alpha1().Applications("argocd").Create(context.Background(), registryApplicationObject, metav1.CreateOptions{})
viper.Set("kubefirst-checks.argocd-create-registry", true)
viper.WriteConfig()
Expand Down Expand Up @@ -1250,7 +1257,7 @@ func createCivo(cmd *cobra.Command, args []string) error {
}

if viper.GetString("flags.dns-provider") == "cloudflare" {
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", gitopsDirectoryTokens.ExternalDNSProviderName)] = config.CloudflareApiToken
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", gitopsDirectoryTokens.ExternalDNSProviderName)] = config.CloudflareAPIToken
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", gitopsDirectoryTokens.ExternalDNSProviderName)] = config.CloudflareOriginCaIssuerAPIToken
} else {
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", gitopsDirectoryTokens.ExternalDNSProviderName)] = config.CivoToken
Expand All @@ -1263,7 +1270,7 @@ func createCivo(cmd *cobra.Command, args []string) error {
//dns provider secret to be stored in vault for external dns lifecycle
switch dnsProviderFlag {
case "cloudflare":
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", strings.ToLower(dnsProviderFlag))] = config.CloudflareApiToken
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", strings.ToLower(dnsProviderFlag))] = config.CloudflareAPIToken
default:
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", strings.ToLower(dnsProviderFlag))] = config.CivoToken
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/digitalocean/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ func createDigitalocean(cmd *cobra.Command, args []string) error {
}

if viper.GetString("flags.dns-provider") == "cloudflare" {
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", gitopsDirectoryTokens.ExternalDNSProviderName)] = config.CloudflareApiToken
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", gitopsDirectoryTokens.ExternalDNSProviderName)] = config.CloudflareAPIToken
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", gitopsDirectoryTokens.ExternalDNSProviderName)] = config.CloudflareOriginCaIssuerAPIToken
} else {
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", gitopsDirectoryTokens.ExternalDNSProviderName)] = "AWS_Placeholder"
Expand All @@ -1249,7 +1249,7 @@ func createDigitalocean(cmd *cobra.Command, args []string) error {
//dns provider secret to be stored in vault for external dns lifecycle
switch dnsProviderFlag {
case "cloudflare":
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", strings.ToLower(dnsProviderFlag))] = config.CloudflareApiToken
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", strings.ToLower(dnsProviderFlag))] = config.CloudflareAPIToken
default:
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", strings.ToLower(dnsProviderFlag))] = config.DigitaloceanToken
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/gcp/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ func createGCP(cmd *cobra.Command, args []string) error {
//dns provider secret to be stored in vault for external dns lifecycle
switch dnsProviderFlag {
case "cloudflare":
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", strings.ToLower(dnsProviderFlag))] = config.CloudflareApiToken
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", strings.ToLower(dnsProviderFlag))] = config.CloudflareAPIToken
default:
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", strings.ToLower(dnsProviderFlag))] = string(a) //Not strictly used. We use a role in GCP but keeping this here for consistency
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/vultr/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ func createVultr(cmd *cobra.Command, args []string) error {

if viper.GetString("flags.dns-provider") == "cloudflare" {
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", gitopsDirectoryTokens.ExternalDNSProviderName)] = config.CloudflareOriginCaIssuerAPIToken
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", gitopsDirectoryTokens.ExternalDNSProviderName)] = config.CloudflareApiToken
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", gitopsDirectoryTokens.ExternalDNSProviderName)] = config.CloudflareAPIToken
} else {
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", gitopsDirectoryTokens.ExternalDNSProviderName)] = "AWS_Placeholder"
}
Expand All @@ -1248,7 +1248,7 @@ func createVultr(cmd *cobra.Command, args []string) error {
//dns provider secret to be stored in vault for external dns lifecycle
switch dnsProviderFlag {
case "cloudflare":
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", strings.ToLower(dnsProviderFlag))] = config.CloudflareApiToken
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", strings.ToLower(dnsProviderFlag))] = config.CloudflareAPIToken
default:
tfEnvs[fmt.Sprintf("TF_VAR_%s_secret", strings.ToLower(dnsProviderFlag))] = config.VultrToken
}
Expand Down
Loading