Skip to content

Commit

Permalink
Update golden test files
Browse files Browse the repository at this point in the history
  • Loading branch information
K-Phoen committed Jul 1, 2024
1 parent 1ba8e28 commit 3824744
Show file tree
Hide file tree
Showing 40 changed files with 901 additions and 1,140 deletions.
86 changes: 43 additions & 43 deletions codegen/cuekind/testing/customkind.cue
Original file line number Diff line number Diff line change
Expand Up @@ -18,49 +18,49 @@ customKind: {
}
"v1-0": {
schema: {
#InnerObject1: {
innerField1: string
innerField2: [...string]
innerField3: [...#InnerObject2]
}
#InnerObject2: {
name: string
details: {
[string]: _
}
}
#Type1: {
group: string
options?: [...string]
}
#Type2: {
group: string
details: {
[string]: _
}
}
#UnionType: #Type1 | #Type2
spec: {
field1: string
inner: #InnerObject1
union: #UnionType
map: {
[string]: #Type2
}
timestamp: string & time.Time
enum: "val1" | "val2" | "val3" | "val4" | *"default" @cuetsy(kind="enum",memberNames="val1|val2|val3|val4|default")
i32: int32 & <= 123456
i64: int64 & >= 123456
boolField: bool | *false
floatField: float64
}
status: {
statusField1: string
}
metadata: {
customMetadataField: string
otherMetadataField: string
}
spec: {
#InnerObject1: {
innerField1: string
innerField2: [...string]
innerField3: [...#InnerObject2]
}
#InnerObject2: {
name: string
details: {
[string]: _
}
}
#Type1: {
group: string
options?: [...string]
}
#Type2: {
group: string
details: {
[string]: _
}
}
#UnionType: #Type1 | #Type2
field1: string
inner: #InnerObject1
union: #UnionType
map: {
[string]: #Type2
}
timestamp: string & time.Time
enum: "val1" | "val2" | "val3" | "val4" | *"default" @cuetsy(kind="enum",memberNames="val1|val2|val3|val4|default")
i32: int32 & <= 123456
i64: int64 & >= 123456
boolField: bool | *false
floatField: float64
}
status: {
statusField1: string
}
metadata: {
customMetadataField: string
otherMetadataField: string
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
// Code generated - EDITING IS FUTILE. DO NOT EDIT.

package v0_0

import (
"time"
)
import "time"

// CustomKindMetadata defines model for CustomKindMetadata.
// metadata contains embedded CommonMetadata and can be extended with custom string fields
// TODO: use CommonMetadata instead of redefining here; currently needs to be defined here
// without external reference as using the CommonMetadata reference breaks thema codegen.
type CustomKindMetadata struct {
UpdateTimestamp time.Time `json:"updateTimestamp"`
CreatedBy string `json:"createdBy"`
CreationTimestamp time.Time `json:"creationTimestamp"`
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"`
Finalizers []string `json:"finalizers"`
Generation int64 `json:"generation"`
Labels map[string]string `json:"labels"`
ResourceVersion string `json:"resourceVersion"`
Uid string `json:"uid"`
UpdateTimestamp time.Time `json:"updateTimestamp"`
UpdatedBy string `json:"updatedBy"`
}

// _kubeObjectMetadata is metadata found in a kubernetes object's metadata field.
// It is not exhaustive and only includes fields which may be relevant to a kind's implementation,
// As it is also intended to be generic enough to function with any API Server.
type CustomKindKubeObjectMetadata struct {
CreationTimestamp time.Time `json:"creationTimestamp"`
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"`
Finalizers []string `json:"finalizers"`
ResourceVersion string `json:"resourceVersion"`
Generation int64 `json:"generation"`
UpdatedBy string `json:"updatedBy"`
Labels map[string]string `json:"labels"`
ResourceVersion string `json:"resourceVersion"`
Uid string `json:"uid"`
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Code generated - EDITING IS FUTILE. DO NOT EDIT.

package v0_0

// CustomKindSpec defines model for CustomKindSpec.
// +k8s:openapi-gen=true
type CustomKindSpec struct {
DeprecatedField string `json:"deprecatedField"`
Field1 string `json:"field1"`
DeprecatedField string `json:"deprecatedField"`
}
Original file line number Diff line number Diff line change
@@ -1,70 +1,34 @@
package v0_0
// Code generated - EDITING IS FUTILE. DO NOT EDIT.

// Defines values for CustomKindOperatorStateState.
const (
CustomKindOperatorStateStateFailed CustomKindOperatorStateState = "failed"
CustomKindOperatorStateStateInProgress CustomKindOperatorStateState = "in_progress"
CustomKindOperatorStateStateSuccess CustomKindOperatorStateState = "success"
)

// Defines values for CustomKindstatusOperatorStateState.
const (
CustomKindstatusOperatorStateStateFailed CustomKindstatusOperatorStateState = "failed"
CustomKindstatusOperatorStateStateInProgress CustomKindstatusOperatorStateState = "in_progress"
CustomKindstatusOperatorStateStateSuccess CustomKindstatusOperatorStateState = "success"
)
package v0_0

// CustomKindOperatorState defines model for CustomKindOperatorState.
// +k8s:openapi-gen=true
type CustomKindOperatorState struct {
// descriptiveState is an optional more descriptive state field which has no requirements on format
DescriptiveState *string `json:"descriptiveState,omitempty"`

// details contains any extra information that is operator-specific
Details map[string]interface{} `json:"details,omitempty"`

type CustomKindstatusOperatorState struct {
// lastEvaluation is the ResourceVersion last evaluated
LastEvaluation string `json:"lastEvaluation"`

// state describes the state of the lastEvaluation.
// It is limited to three possible states for machine evaluation.
State CustomKindOperatorStateState `json:"state"`
State CustomKindStatusOperatorStateState `json:"state"`
// descriptiveState is an optional more descriptive state field which has no requirements on format
DescriptiveState *string `json:"descriptiveState,omitempty"`
// details contains any extra information that is operator-specific
Details map[string]any `json:"details,omitempty"`
}

// CustomKindOperatorStateState state describes the state of the lastEvaluation.
// It is limited to three possible states for machine evaluation.
// +k8s:openapi-gen=true
type CustomKindOperatorStateState string

// CustomKindStatus defines model for CustomKindStatus.
// +k8s:openapi-gen=true
type CustomKindStatus struct {
// additionalFields is reserved for future use
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`

// operatorStates is a map of operator ID to operator state evaluations.
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.
OperatorStates map[string]CustomKindstatusOperatorState `json:"operatorStates,omitempty"`
// additionalFields is reserved for future use
AdditionalFields map[string]any `json:"additionalFields,omitempty"`
}

// CustomKindstatusOperatorState defines model for CustomKindstatus.#OperatorState.
// +k8s:openapi-gen=true
type CustomKindstatusOperatorState struct {
// descriptiveState is an optional more descriptive state field which has no requirements on format
DescriptiveState *string `json:"descriptiveState,omitempty"`

// details contains any extra information that is operator-specific
Details map[string]interface{} `json:"details,omitempty"`

// lastEvaluation is the ResourceVersion last evaluated
LastEvaluation string `json:"lastEvaluation"`
type CustomKindStatusOperatorStateState string

// state describes the state of the lastEvaluation.
// It is limited to three possible states for machine evaluation.
State CustomKindstatusOperatorStateState `json:"state"`
}

// CustomKindstatusOperatorStateState state describes the state of the lastEvaluation.
// It is limited to three possible states for machine evaluation.
// +k8s:openapi-gen=true
type CustomKindstatusOperatorStateState string
const (
StatusOperatorStateStateSuccess CustomKindStatusOperatorStateState = "success"
StatusOperatorStateStateInProgress CustomKindStatusOperatorStateState = "in_progress"
StatusOperatorStateStateFailed CustomKindStatusOperatorStateState = "failed"
)
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
// Code generated - EDITING IS FUTILE. DO NOT EDIT.

package v1_0

import (
"time"
)
import "time"

// CustomKindMetadata defines model for CustomKindMetadata.
// metadata contains embedded CommonMetadata and can be extended with custom string fields
// TODO: use CommonMetadata instead of redefining here; currently needs to be defined here
// without external reference as using the CommonMetadata reference breaks thema codegen.
type CustomKindMetadata struct {
CreatedBy string `json:"createdBy"`
CreationTimestamp time.Time `json:"creationTimestamp"`
CustomMetadataField string `json:"customMetadataField"`
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"`
Finalizers []string `json:"finalizers"`
Generation int64 `json:"generation"`
Labels map[string]string `json:"labels"`
OtherMetadataField string `json:"otherMetadataField"`
ResourceVersion string `json:"resourceVersion"`
Uid string `json:"uid"`
UpdateTimestamp time.Time `json:"updateTimestamp"`
UpdatedBy string `json:"updatedBy"`
}

// _kubeObjectMetadata is metadata found in a kubernetes object's metadata field.
// It is not exhaustive and only includes fields which may be relevant to a kind's implementation,
// As it is also intended to be generic enough to function with any API Server.
type CustomKindKubeObjectMetadata struct {
CreationTimestamp time.Time `json:"creationTimestamp"`
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"`
Finalizers []string `json:"finalizers"`
Generation int64 `json:"generation"`
Labels map[string]string `json:"labels"`
ResourceVersion string `json:"resourceVersion"`
Uid string `json:"uid"`
// All extensions to this metadata need to have string values (for APIServer encoding-to-annotations purposes)
// Can't use this as it's not yet enforced CUE:
// ...string
// Have to do this gnarly regex instead
CustomMetadataField string `json:"customMetadataField"`
UpdateTimestamp time.Time `json:"updateTimestamp"`
CreatedBy string `json:"createdBy"`
Uid string `json:"uid"`
CreationTimestamp time.Time `json:"creationTimestamp"`
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"`
Finalizers []string `json:"finalizers"`
ResourceVersion string `json:"resourceVersion"`
Generation int64 `json:"generation"`
// All extensions to this metadata need to have string values (for APIServer encoding-to-annotations purposes)
// Can't use this as it's not yet enforced CUE:
// ...string
// Have to do this gnarly regex instead
OtherMetadataField string `json:"otherMetadataField"`
UpdatedBy string `json:"updatedBy"`
Labels map[string]string `json:"labels"`
}
Original file line number Diff line number Diff line change
@@ -1,62 +1,58 @@
// Code generated - EDITING IS FUTILE. DO NOT EDIT.

package v1_0

import (
"time"
)
import "time"

// Defines values for CustomKindSpecEnum.
const (
CustomKindSpecEnumDefault CustomKindSpecEnum = "default"
CustomKindSpecEnumVal1 CustomKindSpecEnum = "val1"
CustomKindSpecEnumVal2 CustomKindSpecEnum = "val2"
CustomKindSpecEnumVal3 CustomKindSpecEnum = "val3"
CustomKindSpecEnumVal4 CustomKindSpecEnum = "val4"
)
// +k8s:openapi-gen=true
type CustomKindspecInnerObject1 struct {
InnerField1 string `json:"innerField1"`
InnerField2 []string `json:"innerField2"`
InnerField3 []CustomKindspecInnerObject2 `json:"innerField3"`
}

// CustomKindInnerObject1 defines model for CustomKindInnerObject1.
// +k8s:openapi-gen=true
type CustomKindInnerObject1 struct {
InnerField1 string `json:"innerField1"`
InnerField2 []string `json:"innerField2"`
InnerField3 []CustomKindInnerObject2 `json:"innerField3"`
type CustomKindspecInnerObject2 struct {
Name string `json:"name"`
Details map[string]any `json:"details"`
}

// CustomKindInnerObject2 defines model for CustomKindInnerObject2.
// +k8s:openapi-gen=true
type CustomKindInnerObject2 struct {
Details map[string]interface{} `json:"details"`
Name string `json:"name"`
type CustomKindspecType1 struct {
Group string `json:"group"`
Options []string `json:"options,omitempty"`
}

// CustomKindSpec defines model for CustomKindSpec.
// +k8s:openapi-gen=true
type CustomKindSpec struct {
BoolField bool `json:"boolField"`
Enum CustomKindSpecEnum `json:"enum"`
Field1 string `json:"field1"`
FloatField float64 `json:"floatField"`
I32 int `json:"i32"`
I64 int `json:"i64"`
Inner CustomKindInnerObject1 `json:"inner"`
Map map[string]CustomKindType2 `json:"map"`
Timestamp time.Time `json:"timestamp"`
Union interface{} `json:"union"`
type CustomKindspecType2 struct {
Group string `json:"group"`
Details map[string]any `json:"details"`
}

// CustomKindSpecEnum defines model for CustomKindSpec.Enum.
// +k8s:openapi-gen=true
type CustomKindSpecEnum string
type CustomKindspecUnionType any

// CustomKindType1 defines model for CustomKindType1.
// +k8s:openapi-gen=true
type CustomKindType1 struct {
Group string `json:"group"`
Options []string `json:"options,omitempty"`
type CustomKindSpec struct {
Field1 string `json:"field1"`
Inner CustomKindspecInnerObject1 `json:"inner"`
Union CustomKindspecUnionType `json:"union"`
Map map[string]CustomKindspecType2 `json:"map"`
Timestamp time.Time `json:"timestamp"`
Enum CustomKindSpecEnum `json:"enum"`
I32 int32 `json:"i32"`
I64 int64 `json:"i64"`
BoolField bool `json:"boolField"`
FloatField float64 `json:"floatField"`
}

// CustomKindType2 defines model for CustomKindType2.
// +k8s:openapi-gen=true
type CustomKindType2 struct {
Details map[string]interface{} `json:"details"`
Group string `json:"group"`
}
type CustomKindSpecEnum string

const (
SpecEnumVal1 CustomKindSpecEnum = "val1"
SpecEnumVal2 CustomKindSpecEnum = "val2"
SpecEnumVal3 CustomKindSpecEnum = "val3"
SpecEnumVal4 CustomKindSpecEnum = "val4"
SpecEnumDefault CustomKindSpecEnum = "default"
)
Loading

0 comments on commit 3824744

Please sign in to comment.