Skip to content

Commit

Permalink
fix: allow init without render and deploy (#7936)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsquared94 authored Oct 11, 2022
1 parent 39666c9 commit fb4ba5f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pkg/skaffold/initializer/render/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,30 @@ func (c *cliManifestsInit) Validate() error {

func (c *cliManifestsInit) AddManifestForImage(string, string) {}

type emptyRenderInit struct {
}

func (e *emptyRenderInit) RenderConfig() (latest.RenderConfig, []latest.Profile) {
return latest.RenderConfig{}, nil
}

func (e *emptyRenderInit) GetImages() []string {
return nil
}

func (e *emptyRenderInit) Validate() error {
return nil
}

func (e *emptyRenderInit) AddManifestForImage(string, string) {}

// if any CLI manifests are provided, we always use those as part of a kubectl render first
// if not, then if a kustomization yaml is found, we use that next
// otherwise, default to a kubectl render.
func NewInitializer(manifests, bases, kustomizations []string, h analyze.HelmChartInfo, c config.Config) Initializer {
switch {
case c.SkipDeploy:
return &emptyRenderInit{}
case len(c.CliKubernetesManifests) > 0:
return &cliManifestsInit{c.CliKubernetesManifests}
case len(kustomizations) > 0:
Expand Down

0 comments on commit fb4ba5f

Please sign in to comment.