@@ -46,7 +46,7 @@ type Generate struct {
46
46
47
47
// Generate handles the migration and scaffolding process.
48
48
func (opts * Generate ) Generate () error {
49
- config , err := loadProjectConfig (opts .InputDir )
49
+ projectConfig , err := loadProjectConfig (opts .InputDir )
50
50
if err != nil {
51
51
return err
52
52
}
@@ -82,28 +82,28 @@ func (opts *Generate) Generate() error {
82
82
return err
83
83
}
84
84
85
- if err := kubebuilderInit (config ); err != nil {
85
+ if err := kubebuilderInit (projectConfig ); err != nil {
86
86
return err
87
87
}
88
88
89
- if err := kubebuilderEdit (config ); err != nil {
89
+ if err := kubebuilderEdit (projectConfig ); err != nil {
90
90
return err
91
91
}
92
92
93
- if err := kubebuilderCreate (config ); err != nil {
93
+ if err := kubebuilderCreate (projectConfig ); err != nil {
94
94
return err
95
95
}
96
96
97
- if err := migrateGrafanaPlugin (config , opts .InputDir , opts .OutputDir ); err != nil {
97
+ if err := migrateGrafanaPlugin (projectConfig , opts .InputDir , opts .OutputDir ); err != nil {
98
98
return err
99
99
}
100
100
101
- if hasHelmPlugin (config ) {
101
+ if hasHelmPlugin (projectConfig ) {
102
102
if err := kubebuilderHelmEdit (); err != nil {
103
103
return err
104
104
}
105
105
}
106
- return migrateDeployImagePlugin (config )
106
+ return migrateDeployImagePlugin (projectConfig )
107
107
}
108
108
109
109
// Validate ensures the options are valid and kubebuilder is installed.
@@ -124,11 +124,11 @@ func (opts *Generate) Validate() error {
124
124
125
125
// Helper function to load the project configuration.
126
126
func loadProjectConfig (inputDir string ) (store.Store , error ) {
127
- config := yaml .New (machinery.Filesystem {FS : afero .NewOsFs ()})
128
- if err := config .LoadFrom (fmt .Sprintf ("%s/%s" , inputDir , yaml .DefaultPath )); err != nil {
127
+ projectConfig := yaml .New (machinery.Filesystem {FS : afero .NewOsFs ()})
128
+ if err := projectConfig .LoadFrom (fmt .Sprintf ("%s/%s" , inputDir , yaml .DefaultPath )); err != nil {
129
129
return nil , fmt .Errorf ("failed to load PROJECT file: %w" , err )
130
130
}
131
- return config , nil
131
+ return projectConfig , nil
132
132
}
133
133
134
134
// Helper function to create the output directory.
0 commit comments