Add revision support to XR and XRC schemas

Signed-off-by: Nic Cope <negz@rk0n.org>
This commit is contained in:
Nic Cope 2021-07-21 19:35:30 +00:00
parent 6df22f1c48
commit deb1866064
2 changed files with 60 additions and 0 deletions

View File

@ -237,6 +237,21 @@ func TestForCompositeResource(t *testing.T) {
},
},
},
"compositionRevisionRef": {
Type: "object",
Required: []string{"name"},
Properties: map[string]extv1.JSONSchemaProps{
"name": {Type: "string"},
},
},
"compositionUpdatePolicy": {
Type: "string",
Enum: []extv1.JSON{
{Raw: []byte(`"Automatic"`)},
{Raw: []byte(`"Manual"`)},
},
Default: &extv1.JSON{Raw: []byte(`"Automatic"`)},
},
"claimRef": {
Type: "object",
Required: []string{"apiVersion", "kind", "namespace", "name"},
@ -596,6 +611,21 @@ func TestForCompositeResourceClaim(t *testing.T) {
},
},
},
"compositionRevisionRef": {
Type: "object",
Required: []string{"name"},
Properties: map[string]extv1.JSONSchemaProps{
"name": {Type: "string"},
},
},
"compositionUpdatePolicy": {
Type: "string",
Enum: []extv1.JSON{
{Raw: []byte(`"Automatic"`)},
{Raw: []byte(`"Manual"`)},
},
Default: &extv1.JSON{Raw: []byte(`"Automatic"`)},
},
"resourceRef": {
Type: "object",
Required: []string{"apiVersion", "kind", "name"},

View File

@ -86,6 +86,21 @@ func CompositeResourceSpecProps() map[string]extv1.JSONSchemaProps {
},
},
},
"compositionRevisionRef": {
Type: "object",
Required: []string{"name"},
Properties: map[string]extv1.JSONSchemaProps{
"name": {Type: "string"},
},
},
"compositionUpdatePolicy": {
Type: "string",
Enum: []extv1.JSON{
{Raw: []byte(`"Automatic"`)},
{Raw: []byte(`"Manual"`)},
},
Default: &extv1.JSON{Raw: []byte(`"Automatic"`)},
},
"claimRef": {
Type: "object",
Required: []string{"apiVersion", "kind", "namespace", "name"},
@ -146,6 +161,21 @@ func CompositeResourceClaimSpecProps() map[string]extv1.JSONSchemaProps {
},
},
},
"compositionRevisionRef": {
Type: "object",
Required: []string{"name"},
Properties: map[string]extv1.JSONSchemaProps{
"name": {Type: "string"},
},
},
"compositionUpdatePolicy": {
Type: "string",
Enum: []extv1.JSON{
{Raw: []byte(`"Automatic"`)},
{Raw: []byte(`"Manual"`)},
},
Default: &extv1.JSON{Raw: []byte(`"Automatic"`)},
},
"resourceRef": {
Type: "object",
Required: []string{"apiVersion", "kind", "name"},