@@ -17,9 +17,6 @@ limitations under the License.
1717package configgen
1818
1919import (
20- // required to make sure the controller-tools is initialized fully
21- _ "sigs.k8s.io/controller-runtime/pkg/scheme"
22-
2320 "embed"
2421 "fmt"
2522 "io/ioutil"
@@ -28,6 +25,9 @@ import (
2825 "path/filepath"
2926 "strings"
3027
28+ // required to make sure the controller-tools is initialized fully
29+ _ "sigs.k8s.io/controller-runtime/pkg/scheme"
30+
3131 "github.com/spf13/cobra"
3232 "sigs.k8s.io/kustomize/kyaml/fn/framework"
3333 "sigs.k8s.io/kustomize/kyaml/fn/framework/command"
@@ -37,6 +37,7 @@ import (
3737)
3838
3939// TemplateFS contains the templates used by config-gen
40+ //
4041//go:embed templates/resources/* templates/patches/*
4142var TemplateFS embed.FS
4243
@@ -310,12 +311,12 @@ kubebuilder alpha config-gen install-as-plugin
310311 fmt .Fprintf (cmd .OutOrStdout (), "writing kustomize plugin file at %s\n " , fullScriptPath )
311312
312313 dir , _ := filepath .Split (fullScriptPath )
313- if err = os .MkdirAll (dir , 0700 ); err != nil {
314+ if err = os .MkdirAll (dir , 0o700 ); err != nil {
314315 return err
315316 }
316317
317318 // r-x perms to prevent overwrite vulnerability since the script will be executed out-of-tree.
318- return ioutil .WriteFile (fullScriptPath , []byte (pluginScript ), 0500 )
319+ return ioutil .WriteFile (fullScriptPath , []byte (pluginScript ), 0o500 )
319320 },
320321 }
321322 c .AddCommand (install )
0 commit comments