refactor(yaml): globalize fixups

The ToK8SYaml() function makes the job, it's now simpler to manage fixes
This commit is contained in:
2024-11-09 14:18:27 +01:00
parent 9b392a1f64
commit b09316b416
9 changed files with 34 additions and 34 deletions

View File

@@ -8,7 +8,6 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/yaml"
)
const persistenceKey = "persistence"
@@ -66,17 +65,17 @@ func (v *VolumeClaim) Filename() string {
// Yaml marshals a VolumeClaim into yaml.
func (v *VolumeClaim) Yaml() ([]byte, error) {
var out []byte
var err error
if out, err = ToK8SYaml(v); err != nil {
return nil, err
}
serviceName := v.service.Name
if v.nameOverride != "" {
serviceName = v.nameOverride
}
volumeName := v.volumeName
out, err := yaml.Marshal(v)
if err != nil {
return nil, err
}
out = UnWrapTPL(out)
// replace 1Gi to {{ .Values.serviceName.volume.size }}
out = []byte(