mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
Handle errors
This commit is contained in:
@@ -90,19 +90,25 @@ func (b *Kustomizer) Run(
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if b.options.DoLegacyResourceSort {
|
if b.options.DoLegacyResourceSort {
|
||||||
builtins.NewLegacyOrderTransformerPlugin().Transform(m)
|
err = builtins.NewLegacyOrderTransformerPlugin().Transform(m)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if b.options.AddManagedbyLabel {
|
if b.options.AddManagedbyLabel {
|
||||||
t := builtins.LabelTransformerPlugin{
|
t := builtins.LabelTransformerPlugin{
|
||||||
Labels: map[string]string{
|
Labels: map[string]string{
|
||||||
konfig.ManagedbyLabelKey: fmt.Sprintf(
|
konfig.ManagedbyLabelKey: fmt.Sprintf("kustomize-%s", provenance.GetProvenance().Semver()),
|
||||||
"kustomize-%s", provenance.GetProvenance().Semver())},
|
},
|
||||||
FieldSpecs: []types.FieldSpec{{
|
FieldSpecs: []types.FieldSpec{{
|
||||||
Path: "metadata/labels",
|
Path: "metadata/labels",
|
||||||
CreateIfNotPresent: true,
|
CreateIfNotPresent: true,
|
||||||
}},
|
}},
|
||||||
}
|
}
|
||||||
t.Transform(m)
|
err = t.Transform(m)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
m.RemoveBuildAnnotations()
|
m.RemoveBuildAnnotations()
|
||||||
return m, nil
|
return m, nil
|
||||||
|
|||||||
Reference in New Issue
Block a user