Skip to content

Commit

Permalink
Align files (#328)
Browse files Browse the repository at this point in the history
* Align files

* Replace strings with constant

---------

Co-authored-by: github-actions <[email protected]>
Co-authored-by: Marian Steinbach <[email protected]>
  • Loading branch information
3 people authored Nov 10, 2023
1 parent 3903f9f commit e752a9e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
architect: giantswarm/architect@4.33.1
architect: giantswarm/architect@4.34.1

workflows:
build:
Expand Down
10 changes: 6 additions & 4 deletions pkg/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ import (
secret-values.yaml.patch
*/

const installationsPath = "installations/"

type Config struct {
Fs Filesystem
DecryptTraverser DecryptTraverser
Expand Down Expand Up @@ -102,7 +104,7 @@ func (g Generator) generateRawConfig(ctx context.Context, app string) (configmap
configmapContext, err := g.getWithPatchIfExists(
ctx,
"default/config.yaml",
"installations/"+g.installation+"/config.yaml.patch",
installationsPath+g.installation+"/config.yaml.patch",
)
if err != nil {
return "", "", microerror.Mask(err)
Expand All @@ -125,7 +127,7 @@ func (g Generator) generateRawConfig(ctx context.Context, app string) (configmap
var configmapPatch string
{
g.logMessage(ctx, "rendering configmap-values patch (if it exists)")
filepath := "installations/" + g.installation + "/apps/" + app + "/configmap-values.yaml.patch"
filepath := installationsPath + g.installation + "/apps/" + app + "/configmap-values.yaml.patch"
patch, err := g.getRenderedTemplate(ctx, filepath, configmapContext)
if IsNotFound(err) {
configmapPatch = ""
Expand Down Expand Up @@ -153,7 +155,7 @@ func (g Generator) generateRawConfig(ctx context.Context, app string) (configmap
// 5.
secretContext, err := g.getWithPatchIfExists(
ctx,
"installations/"+g.installation+"/secret.yaml",
installationsPath+g.installation+"/secret.yaml",
"",
)
if err != nil {
Expand Down Expand Up @@ -191,7 +193,7 @@ func (g Generator) generateRawConfig(ctx context.Context, app string) (configmap
// 7.
var secretPatch string
{
filepath := "installations/" + g.installation + "/apps/" + app + "/secret-values.yaml.patch"
filepath := installationsPath + g.installation + "/apps/" + app + "/secret-values.yaml.patch"
patch, err := g.getRenderedTemplate(ctx, filepath, secretContext)
if IsNotFound(err) {
secretPatch = ""
Expand Down

0 comments on commit e752a9e

Please sign in to comment.