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
3 changes: 2 additions & 1 deletion pkg/cmd/kubeblocks/kubeblocks_objects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ func mockCRD() []runtime.Object {
APIVersion: "apiextensions.k8s.io/v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: "clusterversions.apps.kubeblocks.io",
Name: "clusterversions.apps.kubeblocks.io",
Labels: label,
},
Spec: v1.CustomResourceDefinitionSpec{
Group: types.AppsAPIGroup,
Expand Down
5 changes: 5 additions & 0 deletions pkg/util/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const (
)

const (
typeNull = "null"
typeString = "string"
typeNumber = "number"
typeInteger = "integer"
Expand Down Expand Up @@ -123,6 +124,8 @@ func buildOneFlag(cmd *cobra.Command, k string, s *spec.Schema, isArray bool) er
}
case typeArray:
return fmt.Errorf("unsupported build flags for object with array nested within an array")
case typeNull:
return nil
default:
return fmt.Errorf("unsupported json schema type %s", s.Type)
}
Expand All @@ -148,6 +151,8 @@ func buildOneFlag(cmd *cobra.Command, k string, s *spec.Schema, isArray bool) er
if err := buildOneFlag(cmd, name, s.Items.Schema, true); err != nil {
return err
}
case typeNull:
return nil
default:
return fmt.Errorf("unsupported json schema type %s", s.Type)
}
Expand Down