Skip to content

Commit c20a48e

Browse files
authored
fix: null type of values schema (#606)
1 parent 550cade commit c20a48e

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

pkg/cmd/kubeblocks/kubeblocks_objects_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ func mockCRD() []runtime.Object {
196196
APIVersion: "apiextensions.k8s.io/v1",
197197
},
198198
ObjectMeta: metav1.ObjectMeta{
199-
Name: "clusterversions.apps.kubeblocks.io",
199+
Name: "clusterversions.apps.kubeblocks.io",
200+
Labels: label,
200201
},
201202
Spec: v1.CustomResourceDefinitionSpec{
202203
Group: types.AppsAPIGroup,

pkg/util/flags/flags.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const (
4646
)
4747

4848
const (
49+
typeNull = "null"
4950
typeString = "string"
5051
typeNumber = "number"
5152
typeInteger = "integer"
@@ -123,6 +124,8 @@ func buildOneFlag(cmd *cobra.Command, k string, s *spec.Schema, isArray bool) er
123124
}
124125
case typeArray:
125126
return fmt.Errorf("unsupported build flags for object with array nested within an array")
127+
case typeNull:
128+
return nil
126129
default:
127130
return fmt.Errorf("unsupported json schema type %s", s.Type)
128131
}
@@ -148,6 +151,8 @@ func buildOneFlag(cmd *cobra.Command, k string, s *spec.Schema, isArray bool) er
148151
if err := buildOneFlag(cmd, name, s.Items.Schema, true); err != nil {
149152
return err
150153
}
154+
case typeNull:
155+
return nil
151156
default:
152157
return fmt.Errorf("unsupported json schema type %s", s.Type)
153158
}

0 commit comments

Comments
 (0)