Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions configuration-ignore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,9 @@
- group: infrastructure.cluster.x-k8s.io
kind: dockermachinetemplate
version: .*
- description: |
Appears to be an CRD that does not exist (yet) - see https://github.com/linkerd/linkerd2/tree/0f5145118b59190cce1998bdb3a1396a0f270599/controller/gen/apis/policy and https://github.com/datreeio/CRDs-catalog/pull/425
items:
- group: policy\.linkerd\.io
kind: httproute
version: v1
25 changes: 18 additions & 7 deletions configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,11 @@
valuesFile: |
crds:
enabled: true
- entries:
- cert-manager-approver-policy
kind: helm
name: cert-manager-approver-policy
repository: https://charts.jetstack.io
- kind: git
name: cert-manager-aws-privateca-issuer
kustomizationPaths:
Expand Down Expand Up @@ -792,6 +797,13 @@
name: kubeflow-training-operator
repository: https://github.com/kubeflow/training-operator
versionPrefix: v
- kind: git
name: kuberlogic-presslabs-mysql-operator
repository: https://github.com/kuberlogic/presslabs-mysql-operator
searchPaths:
- config/crds
- deploy
versionPrefix: v
- kind: git
name: kubernetes-autoscaler
repository: https://github.com/kubernetes/autoscaler
Expand Down Expand Up @@ -1041,14 +1053,12 @@
kind: helm
name: kubevela
repository: https://kubevela.github.io/charts
- kind: git
- entries:
- kyverno
kind: helm
name: kyverno
repository: https://github.com/kyverno/kyverno
genPaths:
- ./api
- ./pkg/api
- ./pkg/apis
versionPrefix: v
namespace: linkerd-buoyant
repository: https://kyverno.github.io/kyverno/
- entries:
- linkerd-crds
kind: helm
Expand Down Expand Up @@ -1197,6 +1207,7 @@
repository: https://opensource.zalando.com/postgres-operator/charts/postgres-operator
- entries:
- db-operator
- mysql-operator
- wp-operator
kind: helm
name: presslabs
Expand Down
1 change: 1 addition & 0 deletions internal/configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type Configuration struct {
Kind Kind `yaml:"kind"`
KustomizePaths []string `yaml:"kustomizationPaths"`
Name string `yaml:"name"`
Namespace string `yaml:"namespace"`
Repository string `yaml:"repository"`
SearchPaths []string `yaml:"searchPaths"`
Values []ConfigurationValues `yaml:"valuesFiles"`
Expand Down
5 changes: 5 additions & 0 deletions internal/configuration/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
"type": "string",
"minLength": 1
},
"namespace": {
"description": "A namespace to use when generating templates",
"type": "string",
"minLength": 1
},
"apiGroups": {
"description": "The API groups that should be present to indicate this is not its first run",
"type": "array",
Expand Down
5 changes: 5 additions & 0 deletions internal/generator/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ func NewBuilder(config configuration.Configuration, reader crd.CrdReader, genera
config.VersionSuffix = "$"
}

if len(config.Namespace) == 0 {
config.Namespace = "namespace"
}

pattern := fmt.Sprintf(`^%s([0-9]{1,}\.[0-9]{1,}\.[0-9]{1,})%s`, config.VersionPrefix, config.VersionSuffix)
re, err := regexp.Compile(pattern)
if err != nil {
Expand Down Expand Up @@ -78,6 +82,7 @@ func (builder Builder) Build() error {
fmt.Fprintf(logger, " - checking version %s for completeness.\n", version)
metadata, err := builder.generator.MetaData(version)
if err != nil {
fmt.Fprintf(logger, " ! failed: %s\n", err.Error())
return err
}

Expand Down
2 changes: 1 addition & 1 deletion internal/generator/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (generator *HelmGenerator) Schemas(version string) ([]crd.CrdSchema, error)
return nil, err
}

rendered, err := renderChart(filename, "release", "namespace", values)
rendered, err := renderChart(filename, "release", generator.config.Namespace, values)
if err != nil {
return nil, err
}
Expand Down