Skip to content

Commit

Permalink
update to crds for require schema elements. required for kube ver 1.1…
Browse files Browse the repository at this point in the history
…6 or crd v1
  • Loading branch information
kensipe committed Oct 3, 2019
1 parent c341195 commit f6a9ac1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/kudoctl/cmd/init/crds.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func generateOperator() *apiextv1beta1.CustomResourceDefinition {
"description": apiextv1beta1.JSONSchemaProps{Type: "string"},
"kubernetesVersion": apiextv1beta1.JSONSchemaProps{Type: "string"},
"kudoVersion": apiextv1beta1.JSONSchemaProps{Type: "string"},
"maintainers": apiextv1beta1.JSONSchemaProps{
"maintainers": apiextv1beta1.JSONSchemaProps{Type: "object",
Items: &apiextv1beta1.JSONSchemaPropsOrArray{Schema: &apiextv1beta1.JSONSchemaProps{
Type: "object",
Properties: maintainers,
Expand All @@ -109,9 +109,10 @@ func generateOperator() *apiextv1beta1.CustomResourceDefinition {
"spec": apiextv1beta1.JSONSchemaProps{Properties: specProps, Type: "object"},
"status": apiextv1beta1.JSONSchemaProps{Type: "object"},
}

// preserveFields := false
// crd.Spec.PreserveUnknownFields = &preserveFields
crd.Spec.Validation = &apiextv1beta1.CustomResourceValidation{
OpenAPIV3Schema: &apiextv1beta1.JSONSchemaProps{
OpenAPIV3Schema: &apiextv1beta1.JSONSchemaProps{Type: "object",
Properties: validationProps,
},
}
Expand Down Expand Up @@ -180,7 +181,7 @@ func generateOperatorVersion() *apiextv1beta1.CustomResourceDefinition {
}

crd.Spec.Validation = &apiextv1beta1.CustomResourceValidation{
OpenAPIV3Schema: &apiextv1beta1.JSONSchemaProps{
OpenAPIV3Schema: &apiextv1beta1.JSONSchemaProps{Type: "object",
Properties: validationProps,
},
}
Expand Down Expand Up @@ -233,7 +234,7 @@ func generateInstance() *apiextv1beta1.CustomResourceDefinition {
}

crd.Spec.Validation = &apiextv1beta1.CustomResourceValidation{
OpenAPIV3Schema: &apiextv1beta1.JSONSchemaProps{
OpenAPIV3Schema: &apiextv1beta1.JSONSchemaProps{Type: "object",
Properties: validationProps,
},
}
Expand Down

0 comments on commit f6a9ac1

Please sign in to comment.