Skip to content

Commit 8a688a5

Browse files
rsrchboyarttor
authored andcommitted
Stop trimming "controller-manager-" from PDB name
...though it will be there for kubebuilder projects, and will make things inconsistent with other objects.
1 parent 9245541 commit 8a688a5

File tree

1 file changed

+5
-7
lines changed
  • pkg/processor/poddisruptionbudget

1 file changed

+5
-7
lines changed

pkg/processor/poddisruptionbudget/pdb.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"bytes"
55
"fmt"
66
"io"
7-
"strings"
87

98
"github.com/arttor/helmify/pkg/processor"
109

@@ -60,30 +59,29 @@ func (r pdb) Process(appMeta helmify.AppMetadata, obj *unstructured.Unstructured
6059
}
6160

6261
name := appMeta.TrimName(obj.GetName())
63-
shortName := strings.TrimPrefix(name, "controller-manager-")
64-
shortNameCamel := strcase.ToLowerCamel(shortName)
62+
nameCamel := strcase.ToLowerCamel(name)
6563

6664
selector, _ := yaml.Marshal(pdb.Spec.Selector)
6765
selector = yamlformat.Indent(selector, 4)
6866
selector = bytes.TrimRight(selector, "\n ")
6967

7068
if spec.MaxUnavailable != nil {
71-
_, err := values.Add(spec.MaxUnavailable.IntValue(), shortNameCamel, "maxUnavailable")
69+
_, err := values.Add(spec.MaxUnavailable.IntValue(), nameCamel, "maxUnavailable")
7270
if err != nil {
7371
return true, nil, err
7472
}
7573
}
7674

7775
if spec.MinAvailable != nil {
78-
_, err := values.Add(spec.MinAvailable.IntValue(), shortNameCamel, "minAvailable")
76+
_, err := values.Add(spec.MinAvailable.IntValue(), nameCamel, "minAvailable")
7977
if err != nil {
8078
return true, nil, err
8179
}
8280
}
8381

84-
res := meta + fmt.Sprintf(pdbTempSpec, shortNameCamel, selector, appMeta.ChartName())
82+
res := meta + fmt.Sprintf(pdbTempSpec, nameCamel, selector, appMeta.ChartName())
8583
return true, &result{
86-
name: shortName,
84+
name: name,
8785
data: res,
8886
values: values,
8987
}, nil

0 commit comments

Comments
 (0)