Skip to content

Commit

Permalink
feat: detoknize ORIGIN_ISSUER_IS_ENABLED for metaphor (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
muse-sisay authored Dec 13, 2024
1 parent e8a977b commit 86e1c48
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/controller/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ func (clctrl *ClusterController) CreateTokens(kind string) interface{} {
MetaphorDevelopmentIngressURL: fmt.Sprintf("metaphor-development.%s", fullDomainName),
MetaphorStagingIngressURL: fmt.Sprintf("metaphor-staging.%s", fullDomainName),
MetaphorProductionIngressURL: fmt.Sprintf("metaphor-production.%s", fullDomainName),
OriginIssuerIsEnabled: cl.CloudflareAuth.OriginCaIssuerKey != "",
}
return metaphorTemplateTokens
}
Expand Down
1 change: 1 addition & 0 deletions internal/router/api/v1/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ func PostCreateCluster(c *gin.Context) {
clusterDefinition.GoogleAuth = cluster.GoogleAuth
clusterDefinition.K3sAuth = cluster.K3sAuth
clusterDefinition.GitAuth = cluster.GitAuth
clusterDefinition.CloudflareAuth = cluster.CloudflareAuth
}
}

Expand Down
1 change: 1 addition & 0 deletions pkg/providerConfigs/detokenize.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ func detokenizeGitopsMetaphor(tokens *MetaphorTokenValues) filepath.WalkFunc {
newContents = strings.ReplaceAll(newContents, "<METAPHOR_DEVELOPMENT_INGRESS_URL>", tokens.MetaphorDevelopmentIngressURL)
newContents = strings.ReplaceAll(newContents, "<METAPHOR_PRODUCTION_INGRESS_URL>", tokens.MetaphorProductionIngressURL)
newContents = strings.ReplaceAll(newContents, "<METAPHOR_STAGING_INGRESS_URL>", tokens.MetaphorStagingIngressURL)
newContents = strings.ReplaceAll(newContents, "<ORIGIN_ISSUER_IS_ENABLED>", fmt.Sprintf("%t", tokens.OriginIssuerIsEnabled))

err = os.WriteFile(path, []byte(newContents), 0)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/providerConfigs/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,5 @@ type MetaphorTokenValues struct {
MetaphorDevelopmentIngressURL string
MetaphorProductionIngressURL string
MetaphorStagingIngressURL string
OriginIssuerIsEnabled bool
}

0 comments on commit 86e1c48

Please sign in to comment.