Skip to content

Commit 1f3c906

Browse files
authored
Merge pull request #749 from r2d4/kustomize-kustom-path
Add custom kustomization path
2 parents 2d1d68d + b76b1aa commit 1f3c906

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

pkg/skaffold/deploy/kustomize.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (k *KustomizeDeployer) Labels() map[string]string {
5050
}
5151

5252
func (k *KustomizeDeployer) Deploy(ctx context.Context, out io.Writer, builds []build.Artifact) ([]Artifact, error) {
53-
manifests, err := buildManifests(constants.DefaultKustomizationPath)
53+
manifests, err := buildManifests(k.KustomizePath)
5454
if err != nil {
5555
return nil, errors.Wrap(err, "kustomize")
5656
}

pkg/skaffold/schema/v1alpha2/config.go

+10-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ type HelmDeploy struct {
128128
Releases []HelmRelease `yaml:"releases,omitempty"`
129129
}
130130

131-
type KustomizeDeploy struct{}
131+
type KustomizeDeploy struct {
132+
KustomizePath string `yaml:"kustomizePath,omitempty"`
133+
}
132134

133135
type HelmRelease struct {
134136
Name string `yaml:"name"`
@@ -205,6 +207,7 @@ func (c *SkaffoldConfig) setDefaultValues() error {
205207
c.setDefaultTagger()
206208
c.setDefaultDockerfiles()
207209
c.setDefaultWorkspaces()
210+
c.setDefaultKustomizePath()
208211
if err := c.setDefaultKanikoNamespace(); err != nil {
209212
return err
210213
}
@@ -240,6 +243,12 @@ func (c *SkaffoldConfig) setDefaultTagger() {
240243
c.Build.TagPolicy = TagPolicy{GitTagger: &GitTagger{}}
241244
}
242245

246+
func (c *SkaffoldConfig) setDefaultKustomizePath() {
247+
if c.Deploy.KustomizeDeploy != nil && c.Deploy.KustomizeDeploy.KustomizePath == "" {
248+
c.Deploy.KustomizeDeploy.KustomizePath = constants.DefaultKustomizationPath
249+
}
250+
}
251+
243252
func (c *SkaffoldConfig) setDefaultDockerfiles() {
244253
for _, artifact := range c.Build.Artifacts {
245254
if artifact.DockerArtifact != nil && artifact.DockerArtifact.DockerfilePath == "" {

0 commit comments

Comments
 (0)