Skip to content
This repository has been archived by the owner on Apr 8, 2021. It is now read-only.

Use architect 0.8.1 #37

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from 7 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
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@0.5.3
architect: giantswarm/architect@0.8.1

workflows:
build:
Expand Down
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ func mainE(ctx context.Context) error {
daemonCommand.PersistentFlags().String(f.Service.Kubernetes.TLS.CrtFile, "", "Certificate file path to use to authenticate with Kubernetes.")
daemonCommand.PersistentFlags().String(f.Service.Kubernetes.TLS.KeyFile, "", "Key file path to use to authenticate with Kubernetes.")

newCommand.CobraCommand().Execute()
err = newCommand.CobraCommand().Execute()
if err != nil {
return microerror.Mask(err)
}

return nil
}
5 changes: 1 addition & 4 deletions service/controller/ignition.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ func newIgnitionResourceSets(config IgnitionConfig) ([]*controller.ResourceSet,

var resourceSet *controller.ResourceSet
{
c := ignitionResourceSetConfig{
K8sClient: config.K8sClient,
Logger: config.Logger,
}
c := ignitionResourceSetConfig(config)

resourceSet, err = newIgnitionResourceSet(c)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion service/controller/internal/unittest/file_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "unicode"
// dash ('-'). Coalesces multiple dashes into one.
func NormalizeFileName(s string) string {
var result []rune
for _, r := range []rune(s) {
for _, r := range s {
if unicode.IsDigit(r) || unicode.IsLetter(r) {
result = append(result, r)
} else {
Expand Down
17 changes: 13 additions & 4 deletions service/controller/key/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ func OperatorVersion(getter LabelsGetter) string {
func Render(values interface{}, filesdir string, b64 bool) (map[string]string, error) {
files := make(map[string]string)

err := vfsutil.WalkFiles(asset.Assets, filesdir, func(path string, f os.FileInfo, rs io.ReadSeeker, err error) error {
walkFunction := func(path string, f os.FileInfo, rs io.ReadSeeker, err error) error {
if err != nil {
return microerror.Mask(err)
}

if !f.Mode().IsRegular() {
return nil
}
Expand All @@ -48,7 +52,10 @@ func Render(values interface{}, filesdir string, b64 bool) (map[string]string, e
return microerror.Mask(err)
}
var data bytes.Buffer
tmpl.Execute(&data, values)
err = tmpl.Execute(&data, values)
if err != nil {
return microerror.Mask(err)
}

relativePath, err := filepath.Rel(filesdir, path)
if err != nil {
Expand All @@ -57,11 +64,13 @@ func Render(values interface{}, filesdir string, b64 bool) (map[string]string, e
if b64 {
files[relativePath] = base64.StdEncoding.EncodeToString(data.Bytes())
} else {
files[relativePath] = string(data.Bytes())
files[relativePath] = data.String()
}

return nil
})
}

err := vfsutil.WalkFiles(asset.Assets, filesdir, walkFunction)
if err != nil {
return nil, microerror.Mask(err)
}
Expand Down