CRD v1: drop spec.scope default

This commit is contained in:
Jordan Liggitt 2019-06-29 12:40:16 -07:00
parent 27360db1da
commit 05d8b448d2
3 changed files with 1 additions and 5 deletions

View File

@ -40,9 +40,6 @@ func SetDefaults_CustomResourceDefinition(obj *CustomResourceDefinition) {
}
func SetDefaults_CustomResourceDefinitionSpec(obj *CustomResourceDefinitionSpec) {
if len(obj.Scope) == 0 {
obj.Scope = NamespaceScoped
}
if len(obj.Names.Singular) == 0 {
obj.Names.Singular = strings.ToLower(obj.Names.Kind)
}

View File

@ -39,7 +39,6 @@ func TestDefaults(t *testing.T) {
original: &CustomResourceDefinition{},
expected: &CustomResourceDefinition{
Spec: CustomResourceDefinitionSpec{
Scope: NamespaceScoped,
Conversion: &CustomResourceConversion{Strategy: NoneConverter},
PreserveUnknownFields: utilpointer.BoolPtr(true),
},

View File

@ -38,7 +38,7 @@ type CustomResourceDefinitionSpec struct {
Group string `json:"group" protobuf:"bytes,1,opt,name=group"`
// Names are the names used to describe this custom resource
Names CustomResourceDefinitionNames `json:"names" protobuf:"bytes,3,opt,name=names"`
// Scope indicates whether this resource is cluster or namespace scoped. Default is namespaced
// Scope indicates whether this resource is cluster or namespace scoped.
Scope ResourceScope `json:"scope" protobuf:"bytes,4,opt,name=scope,casttype=ResourceScope"`
// Versions is the list of all supported versions for this resource.
// Order: The version name will be used to compute the order.