chore(fixes): Unwrap yaml before converting and fix volume name variable
2 fixes: - the first problem to resolve is that some volume names can have "-" in the name. We now replace them by "_" - the second problem is that k8s.io library truncates the lines and so we cannot split the files by lines. We now "unwrap" the result. TODO: globalize the `yaml.Marshal()` code to our own specific function
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
package generator
|
||||
|
||||
import (
|
||||
"katenary/utils"
|
||||
|
||||
"github.com/compose-spec/compose-go/types"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
rbacv1 "k8s.io/api/rbac/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
"katenary/utils"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -121,7 +121,11 @@ func (r *Role) Filename() string {
|
||||
}
|
||||
|
||||
func (r *Role) Yaml() ([]byte, error) {
|
||||
return yaml.Marshal(r)
|
||||
if o, err := yaml.Marshal(r); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return UnWrapTPL(o), nil
|
||||
}
|
||||
}
|
||||
|
||||
// ServiceAccount is a kubernetes ServiceAccount.
|
||||
|
Reference in New Issue
Block a user