Skip to content

Commit

Permalink
Bug Fix: Init YAML Generation (#813)
Browse files Browse the repository at this point in the history
* fix serialization bug and test to confirm correct format
* removing template tags from CRD property description
  • Loading branch information
kensipe committed Sep 12, 2019
1 parent dd83ad0 commit 81fe390
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/kudoctl/cmd/init/crds.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func generateOperatorVersion() *apiextv1beta1.CustomResourceDefinition {
"default": apiextv1beta1.JSONSchemaProps{Type: "string", Description: "Default is a default value if no paramter is provided by the instance"},
"description": apiextv1beta1.JSONSchemaProps{Type: "string", Description: "Description captures a longer description of how the variable will be used"},
"displayName": apiextv1beta1.JSONSchemaProps{Type: "string", Description: "Human friendly crdVersion of the parameter name"},
"name": apiextv1beta1.JSONSchemaProps{Type: "string", Description: "Name is the string that should be used in the template file for example, if `name: COUNT` then using the variable in a spec like: spec: replicas: {{ .Params.COUNT }}"},
"name": apiextv1beta1.JSONSchemaProps{Type: "string", Description: "Name is the string that should be used in the template file for example, if `name: COUNT` then using the variable `.Params.COUNT`"},
"required": apiextv1beta1.JSONSchemaProps{Type: "boolean", Description: "Required specifies if the parameter is required to be provided by all instances, or whether a default can suffice"},
"trigger": apiextv1beta1.JSONSchemaProps{Type: "string", Description: "Trigger identifies the plan that gets executed when this parameter changes in the Instance object. Default is `update` if present, or `deploy` if not present"},
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/kudoctl/cmd/init/prereqs.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func webhookSecret(opts Options) *v1.Secret {
func serviceAccount(opts Options) *v1.ServiceAccount {
sa := generateServiceAccount(opts)
sa.TypeMeta = metav1.TypeMeta{
Kind: "serviceAccount",
Kind: "ServiceAccount",
APIVersion: "v1",
}
return sa
Expand All @@ -178,7 +178,7 @@ func serviceAccount(opts Options) *v1.ServiceAccount {
func namespace(namespace string) *v1.Namespace {
ns := generateSysNamespace(namespace)
ns.TypeMeta = metav1.TypeMeta{
Kind: "namespace",
Kind: "Namespace",
APIVersion: "v1",
}
return ns
Expand Down
7 changes: 3 additions & 4 deletions pkg/kudoctl/cmd/testdata/deploy-kudo.yaml.golden
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
apiVersion: v1
kind: namespace
kind: Namespace
metadata:
creationTimestamp: null
labels:
Expand All @@ -12,7 +12,7 @@ status: {}

---
apiVersion: v1
kind: serviceAccount
kind: ServiceAccount
metadata:
creationTimestamp: null
labels:
Expand Down Expand Up @@ -160,8 +160,7 @@ spec:
type: string
name:
description: 'Name is the string that should be used in the template
file for example, if `name: COUNT` then using the variable in
a spec like: spec: replicas: {{ .Params.COUNT }}'
file for example, if `name: COUNT` then using the variable `.Params.COUNT`'
type: string
required:
description: Required specifies if the parameter is required to
Expand Down

0 comments on commit 81fe390

Please sign in to comment.