Skip to content

Commit 71ca1f8

Browse files
committed
fix: rename helm scafolld
as helm init got removed, renamed pkg/plugins/optional/helm/v1alpha/scaffolds/init.go -> pkg/plugins/optional/helm/v1alpha/scaffolds/edit.go also the NewInitHelmScaffolder func got renamed to NewHelmScaffolder Signed-off-by: Mario Constanti <[email protected]>
1 parent f796762 commit 71ca1f8

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

pkg/plugins/optional/helm/v1alpha/edit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (p *editSubcommand) InjectConfig(c config.Config) error {
7474
}
7575

7676
func (p *editSubcommand) Scaffold(fs machinery.Filesystem) error {
77-
scaffolder := scaffolds.NewInitHelmScaffolder(p.config, p.force)
77+
scaffolder := scaffolds.NewHelmScaffolder(p.config, p.force)
7878
scaffolder.InjectFS(fs)
7979
err := scaffolder.Scaffold()
8080
if err != nil {

pkg/plugins/optional/helm/v1alpha/scaffolds/init.go renamed to pkg/plugins/optional/helm/v1alpha/scaffolds/edit.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,31 +42,31 @@ import (
4242
"sigs.k8s.io/kubebuilder/v4/pkg/plugins/optional/helm/v1alpha/scaffolds/internal/templates/github"
4343
)
4444

45-
var _ plugins.Scaffolder = &initScaffolder{}
45+
var _ plugins.Scaffolder = &editScaffolder{}
4646

47-
type initScaffolder struct {
47+
type editScaffolder struct {
4848
config config.Config
4949

5050
fs machinery.Filesystem
5151

5252
force bool
5353
}
5454

55-
// NewInitHelmScaffolder returns a new Scaffolder for HelmPlugin
56-
func NewInitHelmScaffolder(cfg config.Config, force bool) plugins.Scaffolder {
57-
return &initScaffolder{
55+
// NewHelmScaffolder returns a new Scaffolder for HelmPlugin
56+
func NewHelmScaffolder(cfg config.Config, force bool) plugins.Scaffolder {
57+
return &editScaffolder{
5858
config: cfg,
5959
force: force,
6060
}
6161
}
6262

6363
// InjectFS implements cmdutil.Scaffolder
64-
func (s *initScaffolder) InjectFS(fs machinery.Filesystem) {
64+
func (s *editScaffolder) InjectFS(fs machinery.Filesystem) {
6565
s.fs = fs
6666
}
6767

6868
// Scaffold scaffolds the Helm chart with the necessary files.
69-
func (s *initScaffolder) Scaffold() error {
69+
func (s *editScaffolder) Scaffold() error {
7070
log.Println("Generating Helm Chart to distribute project")
7171

7272
imagesEnvVars := s.getDeployImagesEnvVars()
@@ -132,7 +132,7 @@ func (s *initScaffolder) Scaffold() error {
132132

133133
// getDeployImagesEnvVars will return the values to append the envvars for projects
134134
// which has the APIs scaffolded with DeployImage plugin
135-
func (s *initScaffolder) getDeployImagesEnvVars() map[string]string {
135+
func (s *editScaffolder) getDeployImagesEnvVars() map[string]string {
136136
deployImages := make(map[string]string)
137137

138138
pluginConfig := struct {
@@ -157,7 +157,7 @@ func (s *initScaffolder) getDeployImagesEnvVars() map[string]string {
157157
// extractWebhooksFromGeneratedFiles parses the files generated by controller-gen under
158158
// config/webhooks and created Mutating and Validating helper structures to
159159
// generate the webhook manifest for the helm-chart
160-
func (s *initScaffolder) extractWebhooksFromGeneratedFiles() (mutatingWebhooks []templateswebhooks.DataWebhook,
160+
func (s *editScaffolder) extractWebhooksFromGeneratedFiles() (mutatingWebhooks []templateswebhooks.DataWebhook,
161161
validatingWebhooks []templateswebhooks.DataWebhook, err error,
162162
) {
163163
manifestFile := "config/webhook/manifests.yaml"
@@ -227,7 +227,7 @@ func (s *initScaffolder) extractWebhooksFromGeneratedFiles() (mutatingWebhooks [
227227
}
228228

229229
// Helper function to copy files from config/ to dist/chart/templates/
230-
func (s *initScaffolder) copyConfigFiles() error {
230+
func (s *editScaffolder) copyConfigFiles() error {
231231
configDirs := []struct {
232232
SrcDir string
233233
DestDir string

0 commit comments

Comments
 (0)