-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
901 additions
and
1,140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 9 additions & 20 deletions
29
codegen/testing/golden_generated/go/groupbygroup/custom/v0_0/customkind_metadata_gen.go.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"` | ||
} |
5 changes: 3 additions & 2 deletions
5
codegen/testing/golden_generated/go/groupbygroup/custom/v0_0/customkind_spec_gen.go.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"` | ||
} |
68 changes: 16 additions & 52 deletions
68
codegen/testing/golden_generated/go/groupbygroup/custom/v0_0/customkind_status_gen.go.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
) |
55 changes: 26 additions & 29 deletions
55
codegen/testing/golden_generated/go/groupbygroup/custom/v1_0/customkind_metadata_gen.go.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"` | ||
} |
82 changes: 39 additions & 43 deletions
82
codegen/testing/golden_generated/go/groupbygroup/custom/v1_0/customkind_spec_gen.go.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
) |
Oops, something went wrong.