Skip to content

Commit

Permalink
Handle errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ash2k committed May 21, 2021
1 parent 0f614e9 commit dbc11ed
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions api/krusty/kustomizer.go
Expand Up @@ -90,19 +90,25 @@ func (b *Kustomizer) Run(
return nil, err
}
if b.options.DoLegacyResourceSort {
builtins.NewLegacyOrderTransformerPlugin().Transform(m)
err = builtins.NewLegacyOrderTransformerPlugin().Transform(m)
if err != nil {
return nil, err
}
}
if b.options.AddManagedbyLabel {
t := builtins.LabelTransformerPlugin{
Labels: map[string]string{
konfig.ManagedbyLabelKey: fmt.Sprintf(
"kustomize-%s", provenance.GetProvenance().Semver())},
konfig.ManagedbyLabelKey: fmt.Sprintf("kustomize-%s", provenance.GetProvenance().Semver()),
},
FieldSpecs: []types.FieldSpec{{
Path: "metadata/labels",
CreateIfNotPresent: true,
}},
}
t.Transform(m)
err = t.Transform(m)
if err != nil {
return nil, err
}
}
m.RemoveBuildAnnotations()
return m, nil
Expand Down

0 comments on commit dbc11ed

Please sign in to comment.