Skip to content

Commit 3eb664f

Browse files
committed
review fixes
1 parent d6a4821 commit 3eb664f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pkg/customresourcestate/generate/cmd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 The Kubernetes Authors All rights reserved.
2+
Copyright 2023 The Kubernetes Authors All rights reserved.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@ var GenerateCommand = &cobra.Command{
5353
}
5454

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

5959
// Register the metric generator itself as marker so genall.FromOptions is able to initialize the runtime properly.

pkg/customresourcestate/generate/generator/generator.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ func (g CustomResourceConfigGenerator) Generate(ctx *genall.GenerationContext) e
113113
})
114114

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

121121
return nil

0 commit comments

Comments
 (0)