Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischdi committed Jan 30, 2024
1 parent 7b6eea4 commit a523a3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/customresourcestate/generate/cmd.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2022 The Kubernetes Authors All rights reserved.
Copyright 2023 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -53,7 +53,7 @@ var GenerateCommand = &cobra.Command{
}

if len(args) == 0 {
return fmt.Errorf("requires at least 1 arg(s), only received %d", len(args))
return fmt.Errorf("requires at least 1 package argument")
}

// Register the metric generator itself as marker so genall.FromOptions is able to initialize the runtime properly.
Expand Down
6 changes: 3 additions & 3 deletions pkg/customresourcestate/generate/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ func (g CustomResourceConfigGenerator) Generate(ctx *genall.GenerationContext) e
})

// Write the rendered yaml to the context which will result in stdout.
filePath := "metrics.yaml"
if err := ctx.WriteYAML(filePath, "", []interface{}{metrics}, genall.WithTransform(addCustomResourceStateKind)); err != nil {
return fmt.Errorf("WriteYAML to %s: %w", filePath, err)
virtualFilePath := "metrics.yaml"
if err := ctx.WriteYAML(virtualFilePath, "", []interface{}{metrics}, genall.WithTransform(addCustomResourceStateKind)); err != nil {
return fmt.Errorf("WriteYAML to %s: %w", virtualFilePath, err)
}

return nil
Expand Down

0 comments on commit a523a3d

Please sign in to comment.