From 3824744b94b19878545f86b99347d02d01fa4bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Gomez?= Date: Thu, 27 Jun 2024 16:07:47 +0200 Subject: [PATCH] Update golden test files --- codegen/cuekind/testing/customkind.cue | 86 +++---- .../v0_0/customkind_metadata_gen.go.txt | 29 +-- .../custom/v0_0/customkind_spec_gen.go.txt | 5 +- .../custom/v0_0/customkind_status_gen.go.txt | 68 ++---- .../v1_0/customkind_metadata_gen.go.txt | 55 +++-- .../custom/v1_0/customkind_spec_gen.go.txt | 82 ++++--- .../custom/v1_0/customkind_status_gen.go.txt | 70 ++---- .../test/v1/testkind2_metadata_gen.go.txt | 29 +-- .../test/v1/testkind2_spec_gen.go.txt | 3 +- .../test/v1/testkind2_status_gen.go.txt | 68 ++---- .../test/v1/testkind_metadata_gen.go.txt | 29 +-- .../test/v1/testkind_spec_gen.go.txt | 3 +- .../test/v1/testkind_status_gen.go.txt | 68 ++---- .../test/v2/testkind_metadata_gen.go.txt | 29 +-- .../test/v2/testkind_spec_gen.go.txt | 9 +- .../test/v2/testkind_status_gen.go.txt | 68 ++---- .../v0_0/customkind_metadata_gen.go.txt | 29 +-- .../v0_0/customkind_spec_gen.go.txt | 5 +- .../v0_0/customkind_status_gen.go.txt | 68 ++---- .../v1_0/customkind_metadata_gen.go.txt | 55 +++-- .../v1_0/customkind_spec_gen.go.txt | 82 ++++--- .../v1_0/customkind_status_gen.go.txt | 70 ++---- .../customkind/customkind_lineage.cue.txt | 50 ++-- .../customkind/customkind_metadata_gen.go.txt | 55 +++-- .../customkind/customkind_spec_gen.go.txt | 82 ++++--- .../customkind/customkind_status_gen.go.txt | 70 ++---- .../customkind2/customkind2_gen.go.txt | 69 +++--- .../unversioned/customkind2_types.gen.ts.txt | 92 ++++---- .../unversioned/customkind_types.gen.ts.txt | 216 ++++++++++-------- .../customkind/v0-0/types.metadata.gen.ts.txt | 45 ++-- .../customkind/v0-0/types.spec.gen.ts.txt | 12 +- .../customkind/v0-0/types.status.gen.ts.txt | 55 ++--- .../customkind/v1-0/types.metadata.gen.ts.txt | 71 +++--- .../customkind/v1-0/types.spec.gen.ts.txt | 88 +++++-- .../customkind/v1-0/types.status.gen.ts.txt | 58 ++--- codegen/thema/generators_test.go | 2 +- codegen/thema/testing/customkind.cue | 57 ++--- go.mod | 2 +- go.sum | 4 +- go.work.sum | 3 + 40 files changed, 901 insertions(+), 1140 deletions(-) diff --git a/codegen/cuekind/testing/customkind.cue b/codegen/cuekind/testing/customkind.cue index edcee59b..5f3a5ec4 100644 --- a/codegen/cuekind/testing/customkind.cue +++ b/codegen/cuekind/testing/customkind.cue @@ -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 + } } } } diff --git a/codegen/testing/golden_generated/go/groupbygroup/custom/v0_0/customkind_metadata_gen.go.txt b/codegen/testing/golden_generated/go/groupbygroup/custom/v0_0/customkind_metadata_gen.go.txt index 803f3951..5550e6c3 100644 --- a/codegen/testing/golden_generated/go/groupbygroup/custom/v0_0/customkind_metadata_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbygroup/custom/v0_0/customkind_metadata_gen.go.txt @@ -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"` } diff --git a/codegen/testing/golden_generated/go/groupbygroup/custom/v0_0/customkind_spec_gen.go.txt b/codegen/testing/golden_generated/go/groupbygroup/custom/v0_0/customkind_spec_gen.go.txt index ac3c5845..19ee6960 100644 --- a/codegen/testing/golden_generated/go/groupbygroup/custom/v0_0/customkind_spec_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbygroup/custom/v0_0/customkind_spec_gen.go.txt @@ -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"` } diff --git a/codegen/testing/golden_generated/go/groupbygroup/custom/v0_0/customkind_status_gen.go.txt b/codegen/testing/golden_generated/go/groupbygroup/custom/v0_0/customkind_status_gen.go.txt index 34deb349..5e86ae3d 100644 --- a/codegen/testing/golden_generated/go/groupbygroup/custom/v0_0/customkind_status_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbygroup/custom/v0_0/customkind_status_gen.go.txt @@ -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" +) diff --git a/codegen/testing/golden_generated/go/groupbygroup/custom/v1_0/customkind_metadata_gen.go.txt b/codegen/testing/golden_generated/go/groupbygroup/custom/v1_0/customkind_metadata_gen.go.txt index 3340bea4..c577526c 100644 --- a/codegen/testing/golden_generated/go/groupbygroup/custom/v1_0/customkind_metadata_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbygroup/custom/v1_0/customkind_metadata_gen.go.txt @@ -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"` } diff --git a/codegen/testing/golden_generated/go/groupbygroup/custom/v1_0/customkind_spec_gen.go.txt b/codegen/testing/golden_generated/go/groupbygroup/custom/v1_0/customkind_spec_gen.go.txt index 4b325887..16443dd6 100644 --- a/codegen/testing/golden_generated/go/groupbygroup/custom/v1_0/customkind_spec_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbygroup/custom/v1_0/customkind_spec_gen.go.txt @@ -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" +) diff --git a/codegen/testing/golden_generated/go/groupbygroup/custom/v1_0/customkind_status_gen.go.txt b/codegen/testing/golden_generated/go/groupbygroup/custom/v1_0/customkind_status_gen.go.txt index 0d4bec6a..fbc73e71 100644 --- a/codegen/testing/golden_generated/go/groupbygroup/custom/v1_0/customkind_status_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbygroup/custom/v1_0/customkind_status_gen.go.txt @@ -1,71 +1,35 @@ -package v1_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 v1_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"` - + StatusField1 string `json:"statusField1"` // 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"` - StatusField1 string `json:"statusField1"` + // 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" +) diff --git a/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind2_metadata_gen.go.txt b/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind2_metadata_gen.go.txt index fdeb96e0..17618399 100644 --- a/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind2_metadata_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind2_metadata_gen.go.txt @@ -1,32 +1,21 @@ +// Code generated - EDITING IS FUTILE. DO NOT EDIT. + package v1 -import ( - "time" -) +import "time" -// TestKind2Metadata defines model for TestKind2Metadata. +// 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 TestKind2Metadata 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 TestKind2KubeObjectMetadata 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"` } diff --git a/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind2_spec_gen.go.txt b/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind2_spec_gen.go.txt index 82d5c11a..96b41945 100644 --- a/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind2_spec_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind2_spec_gen.go.txt @@ -1,6 +1,7 @@ +// Code generated - EDITING IS FUTILE. DO NOT EDIT. + package v1 -// TestKind2Spec defines model for TestKind2Spec. // +k8s:openapi-gen=true type TestKind2Spec struct { TestField string `json:"testField"` diff --git a/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind2_status_gen.go.txt b/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind2_status_gen.go.txt index b46b4285..3971b79e 100644 --- a/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind2_status_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind2_status_gen.go.txt @@ -1,70 +1,34 @@ -package v1 +// Code generated - EDITING IS FUTILE. DO NOT EDIT. -// Defines values for TestKind2OperatorStateState. -const ( - TestKind2OperatorStateStateFailed TestKind2OperatorStateState = "failed" - TestKind2OperatorStateStateInProgress TestKind2OperatorStateState = "in_progress" - TestKind2OperatorStateStateSuccess TestKind2OperatorStateState = "success" -) - -// Defines values for TestKind2statusOperatorStateState. -const ( - TestKind2statusOperatorStateStateFailed TestKind2statusOperatorStateState = "failed" - TestKind2statusOperatorStateStateInProgress TestKind2statusOperatorStateState = "in_progress" - TestKind2statusOperatorStateStateSuccess TestKind2statusOperatorStateState = "success" -) +package v1 -// TestKind2OperatorState defines model for TestKind2OperatorState. // +k8s:openapi-gen=true -type TestKind2OperatorState 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 TestKind2statusOperatorState 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 TestKind2OperatorStateState `json:"state"` + State TestKind2StatusOperatorStateState `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"` } -// TestKind2OperatorStateState state describes the state of the lastEvaluation. -// It is limited to three possible states for machine evaluation. -// +k8s:openapi-gen=true -type TestKind2OperatorStateState string - -// TestKind2Status defines model for TestKind2Status. // +k8s:openapi-gen=true type TestKind2Status 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]TestKind2statusOperatorState `json:"operatorStates,omitempty"` + // additionalFields is reserved for future use + AdditionalFields map[string]any `json:"additionalFields,omitempty"` } -// TestKind2statusOperatorState defines model for TestKind2status.#OperatorState. // +k8s:openapi-gen=true -type TestKind2statusOperatorState 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 TestKind2StatusOperatorStateState string - // state describes the state of the lastEvaluation. - // It is limited to three possible states for machine evaluation. - State TestKind2statusOperatorStateState `json:"state"` -} - -// TestKind2statusOperatorStateState state describes the state of the lastEvaluation. -// It is limited to three possible states for machine evaluation. -// +k8s:openapi-gen=true -type TestKind2statusOperatorStateState string +const ( + StatusOperatorStateStateSuccess TestKind2StatusOperatorStateState = "success" + StatusOperatorStateStateInProgress TestKind2StatusOperatorStateState = "in_progress" + StatusOperatorStateStateFailed TestKind2StatusOperatorStateState = "failed" +) diff --git a/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind_metadata_gen.go.txt b/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind_metadata_gen.go.txt index 031668d0..2d002acd 100644 --- a/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind_metadata_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind_metadata_gen.go.txt @@ -1,32 +1,21 @@ +// Code generated - EDITING IS FUTILE. DO NOT EDIT. + package v1 -import ( - "time" -) +import "time" -// TestKindMetadata defines model for TestKindMetadata. +// 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 TestKindMetadata 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 TestKindKubeObjectMetadata 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"` } diff --git a/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind_spec_gen.go.txt b/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind_spec_gen.go.txt index dbfd2f90..22630a18 100644 --- a/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind_spec_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind_spec_gen.go.txt @@ -1,6 +1,7 @@ +// Code generated - EDITING IS FUTILE. DO NOT EDIT. + package v1 -// TestKindSpec defines model for TestKindSpec. // +k8s:openapi-gen=true type TestKindSpec struct { StringField string `json:"stringField"` diff --git a/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind_status_gen.go.txt b/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind_status_gen.go.txt index 05d157e4..3673d15d 100644 --- a/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind_status_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind_status_gen.go.txt @@ -1,70 +1,34 @@ -package v1 +// Code generated - EDITING IS FUTILE. DO NOT EDIT. -// Defines values for TestKindOperatorStateState. -const ( - TestKindOperatorStateStateFailed TestKindOperatorStateState = "failed" - TestKindOperatorStateStateInProgress TestKindOperatorStateState = "in_progress" - TestKindOperatorStateStateSuccess TestKindOperatorStateState = "success" -) - -// Defines values for TestKindstatusOperatorStateState. -const ( - TestKindstatusOperatorStateStateFailed TestKindstatusOperatorStateState = "failed" - TestKindstatusOperatorStateStateInProgress TestKindstatusOperatorStateState = "in_progress" - TestKindstatusOperatorStateStateSuccess TestKindstatusOperatorStateState = "success" -) +package v1 -// TestKindOperatorState defines model for TestKindOperatorState. // +k8s:openapi-gen=true -type TestKindOperatorState 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 TestKindstatusOperatorState 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 TestKindOperatorStateState `json:"state"` + State TestKindStatusOperatorStateState `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"` } -// TestKindOperatorStateState state describes the state of the lastEvaluation. -// It is limited to three possible states for machine evaluation. -// +k8s:openapi-gen=true -type TestKindOperatorStateState string - -// TestKindStatus defines model for TestKindStatus. // +k8s:openapi-gen=true type TestKindStatus 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]TestKindstatusOperatorState `json:"operatorStates,omitempty"` + // additionalFields is reserved for future use + AdditionalFields map[string]any `json:"additionalFields,omitempty"` } -// TestKindstatusOperatorState defines model for TestKindstatus.#OperatorState. // +k8s:openapi-gen=true -type TestKindstatusOperatorState 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 TestKindStatusOperatorStateState string - // state describes the state of the lastEvaluation. - // It is limited to three possible states for machine evaluation. - State TestKindstatusOperatorStateState `json:"state"` -} - -// TestKindstatusOperatorStateState state describes the state of the lastEvaluation. -// It is limited to three possible states for machine evaluation. -// +k8s:openapi-gen=true -type TestKindstatusOperatorStateState string +const ( + StatusOperatorStateStateSuccess TestKindStatusOperatorStateState = "success" + StatusOperatorStateStateInProgress TestKindStatusOperatorStateState = "in_progress" + StatusOperatorStateStateFailed TestKindStatusOperatorStateState = "failed" +) diff --git a/codegen/testing/golden_generated/go/groupbygroup/test/v2/testkind_metadata_gen.go.txt b/codegen/testing/golden_generated/go/groupbygroup/test/v2/testkind_metadata_gen.go.txt index c212dfc2..daf14e3d 100644 --- a/codegen/testing/golden_generated/go/groupbygroup/test/v2/testkind_metadata_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbygroup/test/v2/testkind_metadata_gen.go.txt @@ -1,32 +1,21 @@ +// Code generated - EDITING IS FUTILE. DO NOT EDIT. + package v2 -import ( - "time" -) +import "time" -// TestKindMetadata defines model for TestKindMetadata. +// 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 TestKindMetadata 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 TestKindKubeObjectMetadata 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"` } diff --git a/codegen/testing/golden_generated/go/groupbygroup/test/v2/testkind_spec_gen.go.txt b/codegen/testing/golden_generated/go/groupbygroup/test/v2/testkind_spec_gen.go.txt index 702bda53..a130a3bd 100644 --- a/codegen/testing/golden_generated/go/groupbygroup/test/v2/testkind_spec_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbygroup/test/v2/testkind_spec_gen.go.txt @@ -1,13 +1,12 @@ +// Code generated - EDITING IS FUTILE. DO NOT EDIT. + package v2 -import ( - "time" -) +import "time" -// TestKindSpec defines model for TestKindSpec. // +k8s:openapi-gen=true type TestKindSpec struct { - IntField int64 `json:"intField"` StringField string `json:"stringField"` + IntField int64 `json:"intField"` TimeField time.Time `json:"timeField"` } diff --git a/codegen/testing/golden_generated/go/groupbygroup/test/v2/testkind_status_gen.go.txt b/codegen/testing/golden_generated/go/groupbygroup/test/v2/testkind_status_gen.go.txt index 72ffbfe5..d4c482dd 100644 --- a/codegen/testing/golden_generated/go/groupbygroup/test/v2/testkind_status_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbygroup/test/v2/testkind_status_gen.go.txt @@ -1,70 +1,34 @@ -package v2 +// Code generated - EDITING IS FUTILE. DO NOT EDIT. -// Defines values for TestKindOperatorStateState. -const ( - TestKindOperatorStateStateFailed TestKindOperatorStateState = "failed" - TestKindOperatorStateStateInProgress TestKindOperatorStateState = "in_progress" - TestKindOperatorStateStateSuccess TestKindOperatorStateState = "success" -) - -// Defines values for TestKindstatusOperatorStateState. -const ( - TestKindstatusOperatorStateStateFailed TestKindstatusOperatorStateState = "failed" - TestKindstatusOperatorStateStateInProgress TestKindstatusOperatorStateState = "in_progress" - TestKindstatusOperatorStateStateSuccess TestKindstatusOperatorStateState = "success" -) +package v2 -// TestKindOperatorState defines model for TestKindOperatorState. // +k8s:openapi-gen=true -type TestKindOperatorState 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 TestKindstatusOperatorState 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 TestKindOperatorStateState `json:"state"` + State TestKindStatusOperatorStateState `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"` } -// TestKindOperatorStateState state describes the state of the lastEvaluation. -// It is limited to three possible states for machine evaluation. -// +k8s:openapi-gen=true -type TestKindOperatorStateState string - -// TestKindStatus defines model for TestKindStatus. // +k8s:openapi-gen=true type TestKindStatus 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]TestKindstatusOperatorState `json:"operatorStates,omitempty"` + // additionalFields is reserved for future use + AdditionalFields map[string]any `json:"additionalFields,omitempty"` } -// TestKindstatusOperatorState defines model for TestKindstatus.#OperatorState. // +k8s:openapi-gen=true -type TestKindstatusOperatorState 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 TestKindStatusOperatorStateState string - // state describes the state of the lastEvaluation. - // It is limited to three possible states for machine evaluation. - State TestKindstatusOperatorStateState `json:"state"` -} - -// TestKindstatusOperatorStateState state describes the state of the lastEvaluation. -// It is limited to three possible states for machine evaluation. -// +k8s:openapi-gen=true -type TestKindstatusOperatorStateState string +const ( + StatusOperatorStateStateSuccess TestKindStatusOperatorStateState = "success" + StatusOperatorStateStateInProgress TestKindStatusOperatorStateState = "in_progress" + StatusOperatorStateStateFailed TestKindStatusOperatorStateState = "failed" +) diff --git a/codegen/testing/golden_generated/go/groupbykind/customkind/v0_0/customkind_metadata_gen.go.txt b/codegen/testing/golden_generated/go/groupbykind/customkind/v0_0/customkind_metadata_gen.go.txt index f940065f..fc7d327b 100644 --- a/codegen/testing/golden_generated/go/groupbykind/customkind/v0_0/customkind_metadata_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbykind/customkind/v0_0/customkind_metadata_gen.go.txt @@ -1,32 +1,21 @@ +// Code generated - EDITING IS FUTILE. DO NOT EDIT. + package v0_0 -import ( - "time" -) +import "time" -// Metadata defines model for Metadata. +// 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 Metadata 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 KubeObjectMetadata 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"` } diff --git a/codegen/testing/golden_generated/go/groupbykind/customkind/v0_0/customkind_spec_gen.go.txt b/codegen/testing/golden_generated/go/groupbykind/customkind/v0_0/customkind_spec_gen.go.txt index 94ffb92c..17c9f963 100644 --- a/codegen/testing/golden_generated/go/groupbykind/customkind/v0_0/customkind_spec_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbykind/customkind/v0_0/customkind_spec_gen.go.txt @@ -1,8 +1,9 @@ +// Code generated - EDITING IS FUTILE. DO NOT EDIT. + package v0_0 -// Spec defines model for Spec. // +k8s:openapi-gen=true type Spec struct { - DeprecatedField string `json:"deprecatedField"` Field1 string `json:"field1"` + DeprecatedField string `json:"deprecatedField"` } diff --git a/codegen/testing/golden_generated/go/groupbykind/customkind/v0_0/customkind_status_gen.go.txt b/codegen/testing/golden_generated/go/groupbykind/customkind/v0_0/customkind_status_gen.go.txt index 54ca37c2..fefa2456 100644 --- a/codegen/testing/golden_generated/go/groupbykind/customkind/v0_0/customkind_status_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbykind/customkind/v0_0/customkind_status_gen.go.txt @@ -1,70 +1,34 @@ -package v0_0 - -// Defines values for OperatorStateState. -const ( - OperatorStateStateFailed OperatorStateState = "failed" - OperatorStateStateInProgress OperatorStateState = "in_progress" - OperatorStateStateSuccess OperatorStateState = "success" -) +// Code generated - EDITING IS FUTILE. DO NOT EDIT. -// Defines values for StatusOperatorStateState. -const ( - StatusOperatorStateStateFailed StatusOperatorStateState = "failed" - StatusOperatorStateStateInProgress StatusOperatorStateState = "in_progress" - StatusOperatorStateStateSuccess StatusOperatorStateState = "success" -) +package v0_0 -// OperatorState defines model for OperatorState. // +k8s:openapi-gen=true -type OperatorState 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 StatusOperatorState 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 OperatorStateState `json:"state"` + State StatusOperatorStateState `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"` } -// OperatorStateState state describes the state of the lastEvaluation. -// It is limited to three possible states for machine evaluation. -// +k8s:openapi-gen=true -type OperatorStateState string - -// Status defines model for Status. // +k8s:openapi-gen=true type Status 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]StatusOperatorState `json:"operatorStates,omitempty"` + // additionalFields is reserved for future use + AdditionalFields map[string]any `json:"additionalFields,omitempty"` } -// StatusOperatorState defines model for status.#OperatorState. -// +k8s:openapi-gen=true -type StatusOperatorState 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"` - - // state describes the state of the lastEvaluation. - // It is limited to three possible states for machine evaluation. - State StatusOperatorStateState `json:"state"` -} - -// StatusOperatorStateState state describes the state of the lastEvaluation. -// It is limited to three possible states for machine evaluation. // +k8s:openapi-gen=true type StatusOperatorStateState string + +const ( + StatusOperatorStateStateSuccess StatusOperatorStateState = "success" + StatusOperatorStateStateInProgress StatusOperatorStateState = "in_progress" + StatusOperatorStateStateFailed StatusOperatorStateState = "failed" +) diff --git a/codegen/testing/golden_generated/go/groupbykind/customkind/v1_0/customkind_metadata_gen.go.txt b/codegen/testing/golden_generated/go/groupbykind/customkind/v1_0/customkind_metadata_gen.go.txt index 8d79a86e..99ce7744 100644 --- a/codegen/testing/golden_generated/go/groupbykind/customkind/v1_0/customkind_metadata_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbykind/customkind/v1_0/customkind_metadata_gen.go.txt @@ -1,34 +1,31 @@ +// Code generated - EDITING IS FUTILE. DO NOT EDIT. + package v1_0 -import ( - "time" -) +import "time" -// Metadata defines model for Metadata. +// 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 Metadata 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 KubeObjectMetadata 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"` } diff --git a/codegen/testing/golden_generated/go/groupbykind/customkind/v1_0/customkind_spec_gen.go.txt b/codegen/testing/golden_generated/go/groupbykind/customkind/v1_0/customkind_spec_gen.go.txt index 21fce2d0..af884ea0 100644 --- a/codegen/testing/golden_generated/go/groupbykind/customkind/v1_0/customkind_spec_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbykind/customkind/v1_0/customkind_spec_gen.go.txt @@ -1,62 +1,58 @@ +// Code generated - EDITING IS FUTILE. DO NOT EDIT. + package v1_0 -import ( - "time" -) +import "time" -// Defines values for SpecEnum. -const ( - SpecEnumDefault SpecEnum = "default" - SpecEnumVal1 SpecEnum = "val1" - SpecEnumVal2 SpecEnum = "val2" - SpecEnumVal3 SpecEnum = "val3" - SpecEnumVal4 SpecEnum = "val4" -) +// +k8s:openapi-gen=true +type SpecInnerObject1 struct { + InnerField1 string `json:"innerField1"` + InnerField2 []string `json:"innerField2"` + InnerField3 []SpecInnerObject2 `json:"innerField3"` +} -// InnerObject1 defines model for InnerObject1. // +k8s:openapi-gen=true -type InnerObject1 struct { - InnerField1 string `json:"innerField1"` - InnerField2 []string `json:"innerField2"` - InnerField3 []InnerObject2 `json:"innerField3"` +type SpecInnerObject2 struct { + Name string `json:"name"` + Details map[string]any `json:"details"` } -// InnerObject2 defines model for InnerObject2. // +k8s:openapi-gen=true -type InnerObject2 struct { - Details map[string]interface{} `json:"details"` - Name string `json:"name"` +type SpecType1 struct { + Group string `json:"group"` + Options []string `json:"options,omitempty"` } -// Spec defines model for Spec. // +k8s:openapi-gen=true -type Spec struct { - BoolField bool `json:"boolField"` - Enum SpecEnum `json:"enum"` - Field1 string `json:"field1"` - FloatField float64 `json:"floatField"` - I32 int `json:"i32"` - I64 int `json:"i64"` - Inner InnerObject1 `json:"inner"` - Map map[string]Type2 `json:"map"` - Timestamp time.Time `json:"timestamp"` - Union interface{} `json:"union"` +type SpecType2 struct { + Group string `json:"group"` + Details map[string]any `json:"details"` } -// SpecEnum defines model for Spec.Enum. // +k8s:openapi-gen=true -type SpecEnum string +type SpecUnionType any -// Type1 defines model for Type1. // +k8s:openapi-gen=true -type Type1 struct { - Group string `json:"group"` - Options []string `json:"options,omitempty"` +type Spec struct { + Field1 string `json:"field1"` + Inner SpecInnerObject1 `json:"inner"` + Union SpecUnionType `json:"union"` + Map map[string]SpecType2 `json:"map"` + Timestamp time.Time `json:"timestamp"` + Enum SpecEnum `json:"enum"` + I32 int32 `json:"i32"` + I64 int64 `json:"i64"` + BoolField bool `json:"boolField"` + FloatField float64 `json:"floatField"` } -// Type2 defines model for Type2. // +k8s:openapi-gen=true -type Type2 struct { - Details map[string]interface{} `json:"details"` - Group string `json:"group"` -} +type SpecEnum string + +const ( + SpecEnumVal1 SpecEnum = "val1" + SpecEnumVal2 SpecEnum = "val2" + SpecEnumVal3 SpecEnum = "val3" + SpecEnumVal4 SpecEnum = "val4" + SpecEnumDefault SpecEnum = "default" +) diff --git a/codegen/testing/golden_generated/go/groupbykind/customkind/v1_0/customkind_status_gen.go.txt b/codegen/testing/golden_generated/go/groupbykind/customkind/v1_0/customkind_status_gen.go.txt index 39c90cf7..ddc0659a 100644 --- a/codegen/testing/golden_generated/go/groupbykind/customkind/v1_0/customkind_status_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbykind/customkind/v1_0/customkind_status_gen.go.txt @@ -1,71 +1,35 @@ -package v1_0 - -// Defines values for OperatorStateState. -const ( - OperatorStateStateFailed OperatorStateState = "failed" - OperatorStateStateInProgress OperatorStateState = "in_progress" - OperatorStateStateSuccess OperatorStateState = "success" -) +// Code generated - EDITING IS FUTILE. DO NOT EDIT. -// Defines values for StatusOperatorStateState. -const ( - StatusOperatorStateStateFailed StatusOperatorStateState = "failed" - StatusOperatorStateStateInProgress StatusOperatorStateState = "in_progress" - StatusOperatorStateStateSuccess StatusOperatorStateState = "success" -) +package v1_0 -// OperatorState defines model for OperatorState. // +k8s:openapi-gen=true -type OperatorState 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 StatusOperatorState 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 OperatorStateState `json:"state"` + State StatusOperatorStateState `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"` } -// OperatorStateState state describes the state of the lastEvaluation. -// It is limited to three possible states for machine evaluation. -// +k8s:openapi-gen=true -type OperatorStateState string - -// Status defines model for Status. // +k8s:openapi-gen=true type Status struct { - // additionalFields is reserved for future use - AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"` - + StatusField1 string `json:"statusField1"` // 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]StatusOperatorState `json:"operatorStates,omitempty"` - StatusField1 string `json:"statusField1"` -} - -// StatusOperatorState defines model for status.#OperatorState. -// +k8s:openapi-gen=true -type StatusOperatorState 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"` - - // state describes the state of the lastEvaluation. - // It is limited to three possible states for machine evaluation. - State StatusOperatorStateState `json:"state"` + // additionalFields is reserved for future use + AdditionalFields map[string]any `json:"additionalFields,omitempty"` } -// StatusOperatorStateState state describes the state of the lastEvaluation. -// It is limited to three possible states for machine evaluation. // +k8s:openapi-gen=true type StatusOperatorStateState string + +const ( + StatusOperatorStateStateSuccess StatusOperatorStateState = "success" + StatusOperatorStateStateInProgress StatusOperatorStateState = "in_progress" + StatusOperatorStateStateFailed StatusOperatorStateState = "failed" +) diff --git a/codegen/testing/golden_generated/go/unversioned/customkind/customkind_lineage.cue.txt b/codegen/testing/golden_generated/go/unversioned/customkind/customkind_lineage.cue.txt index adef7feb..34885a08 100644 --- a/codegen/testing/golden_generated/go/unversioned/customkind/customkind_lineage.cue.txt +++ b/codegen/testing/golden_generated/go/unversioned/customkind/customkind_lineage.cue.txt @@ -11,7 +11,7 @@ customkind: thema.#Lineage & { joinSchema: { metadata: { { - uid: string + uid: string creationTimestamp: time.Time & { string } @@ -71,32 +71,32 @@ customkind: thema.#Lineage & { }, { version: [1, 0] schema: { - #InnerObject1: { - innerField1: string - innerField2: [...string] - innerField3: [...#InnerObject2] - } - #InnerObject2: { - name: string - details: { - [string]: _ + spec: { + #InnerObject1: { + innerField1: string + innerField2: [...string] + innerField3: [...#InnerObject2] } - } - #Type1: { - group: string - options?: [...string] - } - #Type2: { - group: string - details: { - [string]: _ + #InnerObject2: { + name: string + details: { + [string]: _ + } } - } - #UnionType: #Type1 | #Type2 - spec: { - field1: string - inner: #InnerObject1 - union: #UnionType + #Type1: { + group: string + options?: [...string] + } + #Type2: { + group: string + details: { + [string]: _ + } + } + #UnionType: #Type1 | #Type2 + field1: string + inner: #InnerObject1 + union: #UnionType map: { [string]: #Type2 } diff --git a/codegen/testing/golden_generated/go/unversioned/customkind/customkind_metadata_gen.go.txt b/codegen/testing/golden_generated/go/unversioned/customkind/customkind_metadata_gen.go.txt index ecf7eec6..c6981291 100644 --- a/codegen/testing/golden_generated/go/unversioned/customkind/customkind_metadata_gen.go.txt +++ b/codegen/testing/golden_generated/go/unversioned/customkind/customkind_metadata_gen.go.txt @@ -1,34 +1,31 @@ +// Code generated - EDITING IS FUTILE. DO NOT EDIT. + package customkind -import ( - "time" -) +import "time" -// Metadata defines model for Metadata. +// 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 Metadata 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 KubeObjectMetadata 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"` } diff --git a/codegen/testing/golden_generated/go/unversioned/customkind/customkind_spec_gen.go.txt b/codegen/testing/golden_generated/go/unversioned/customkind/customkind_spec_gen.go.txt index ba4600df..14eecda6 100644 --- a/codegen/testing/golden_generated/go/unversioned/customkind/customkind_spec_gen.go.txt +++ b/codegen/testing/golden_generated/go/unversioned/customkind/customkind_spec_gen.go.txt @@ -1,62 +1,58 @@ +// Code generated - EDITING IS FUTILE. DO NOT EDIT. + package customkind -import ( - "time" -) +import "time" -// Defines values for SpecEnum. -const ( - SpecEnumDefault SpecEnum = "default" - SpecEnumVal1 SpecEnum = "val1" - SpecEnumVal2 SpecEnum = "val2" - SpecEnumVal3 SpecEnum = "val3" - SpecEnumVal4 SpecEnum = "val4" -) +// +k8s:openapi-gen=true +type SpecInnerObject1 struct { + InnerField1 string `json:"innerField1"` + InnerField2 []string `json:"innerField2"` + InnerField3 []SpecInnerObject2 `json:"innerField3"` +} -// InnerObject1 defines model for InnerObject1. // +k8s:openapi-gen=true -type InnerObject1 struct { - InnerField1 string `json:"innerField1"` - InnerField2 []string `json:"innerField2"` - InnerField3 []InnerObject2 `json:"innerField3"` +type SpecInnerObject2 struct { + Name string `json:"name"` + Details map[string]any `json:"details"` } -// InnerObject2 defines model for InnerObject2. // +k8s:openapi-gen=true -type InnerObject2 struct { - Details map[string]interface{} `json:"details"` - Name string `json:"name"` +type SpecType1 struct { + Group string `json:"group"` + Options []string `json:"options,omitempty"` } -// Spec defines model for Spec. // +k8s:openapi-gen=true -type Spec struct { - BoolField bool `json:"boolField"` - Enum SpecEnum `json:"enum"` - Field1 string `json:"field1"` - FloatField float64 `json:"floatField"` - I32 int `json:"i32"` - I64 int `json:"i64"` - Inner InnerObject1 `json:"inner"` - Map map[string]Type2 `json:"map"` - Timestamp time.Time `json:"timestamp"` - Union interface{} `json:"union"` +type SpecType2 struct { + Group string `json:"group"` + Details map[string]any `json:"details"` } -// SpecEnum defines model for Spec.Enum. // +k8s:openapi-gen=true -type SpecEnum string +type SpecUnionType any -// Type1 defines model for Type1. // +k8s:openapi-gen=true -type Type1 struct { - Group string `json:"group"` - Options []string `json:"options,omitempty"` +type Spec struct { + Field1 string `json:"field1"` + Inner SpecInnerObject1 `json:"inner"` + Union SpecUnionType `json:"union"` + Map map[string]SpecType2 `json:"map"` + Timestamp time.Time `json:"timestamp"` + Enum SpecEnum `json:"enum"` + I32 int32 `json:"i32"` + I64 int64 `json:"i64"` + BoolField bool `json:"boolField"` + FloatField float64 `json:"floatField"` } -// Type2 defines model for Type2. // +k8s:openapi-gen=true -type Type2 struct { - Details map[string]interface{} `json:"details"` - Group string `json:"group"` -} +type SpecEnum string + +const ( + SpecEnumVal1 SpecEnum = "val1" + SpecEnumVal2 SpecEnum = "val2" + SpecEnumVal3 SpecEnum = "val3" + SpecEnumVal4 SpecEnum = "val4" + SpecEnumDefault SpecEnum = "default" +) diff --git a/codegen/testing/golden_generated/go/unversioned/customkind/customkind_status_gen.go.txt b/codegen/testing/golden_generated/go/unversioned/customkind/customkind_status_gen.go.txt index 4b88db09..f5d0af5f 100644 --- a/codegen/testing/golden_generated/go/unversioned/customkind/customkind_status_gen.go.txt +++ b/codegen/testing/golden_generated/go/unversioned/customkind/customkind_status_gen.go.txt @@ -1,71 +1,35 @@ -package customkind - -// Defines values for OperatorStateState. -const ( - OperatorStateStateFailed OperatorStateState = "failed" - OperatorStateStateInProgress OperatorStateState = "in_progress" - OperatorStateStateSuccess OperatorStateState = "success" -) +// Code generated - EDITING IS FUTILE. DO NOT EDIT. -// Defines values for StatusOperatorStateState. -const ( - StatusOperatorStateStateFailed StatusOperatorStateState = "failed" - StatusOperatorStateStateInProgress StatusOperatorStateState = "in_progress" - StatusOperatorStateStateSuccess StatusOperatorStateState = "success" -) +package customkind -// OperatorState defines model for OperatorState. // +k8s:openapi-gen=true -type OperatorState 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 StatusOperatorState 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 OperatorStateState `json:"state"` + State StatusOperatorStateState `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"` } -// OperatorStateState state describes the state of the lastEvaluation. -// It is limited to three possible states for machine evaluation. -// +k8s:openapi-gen=true -type OperatorStateState string - -// Status defines model for Status. // +k8s:openapi-gen=true type Status struct { - // additionalFields is reserved for future use - AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"` - + StatusField1 string `json:"statusField1"` // 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]StatusOperatorState `json:"operatorStates,omitempty"` - StatusField1 string `json:"statusField1"` -} - -// StatusOperatorState defines model for status.#OperatorState. -// +k8s:openapi-gen=true -type StatusOperatorState 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"` - - // state describes the state of the lastEvaluation. - // It is limited to three possible states for machine evaluation. - State StatusOperatorStateState `json:"state"` + // additionalFields is reserved for future use + AdditionalFields map[string]any `json:"additionalFields,omitempty"` } -// StatusOperatorStateState state describes the state of the lastEvaluation. -// It is limited to three possible states for machine evaluation. // +k8s:openapi-gen=true type StatusOperatorStateState string + +const ( + StatusOperatorStateStateSuccess StatusOperatorStateState = "success" + StatusOperatorStateStateInProgress StatusOperatorStateState = "in_progress" + StatusOperatorStateStateFailed StatusOperatorStateState = "failed" +) diff --git a/codegen/testing/golden_generated/go/unversioned/customkind2/customkind2_gen.go.txt b/codegen/testing/golden_generated/go/unversioned/customkind2/customkind2_gen.go.txt index 4469d842..376a1abd 100644 --- a/codegen/testing/golden_generated/go/unversioned/customkind2/customkind2_gen.go.txt +++ b/codegen/testing/golden_generated/go/unversioned/customkind2/customkind2_gen.go.txt @@ -1,56 +1,51 @@ -package customkind2 - -import ( - "time" -) - -// Defines values for CustomKind2Enum. -const ( - CustomKind2EnumDefault CustomKind2Enum = "default" - CustomKind2EnumVal1 CustomKind2Enum = "val1" - CustomKind2EnumVal2 CustomKind2Enum = "val2" - CustomKind2EnumVal3 CustomKind2Enum = "val3" - CustomKind2EnumVal4 CustomKind2Enum = "val4" -) +// Code generated - EDITING IS FUTILE. DO NOT EDIT. -// CustomKind2 defines model for CustomKind2. -type CustomKind2 struct { - BoolField bool `json:"boolField"` - Enum CustomKind2Enum `json:"enum"` - Field1 string `json:"field1"` - FloatField float64 `json:"floatField"` - I32 int `json:"i32"` - I64 int `json:"i64"` - Inner InnerObject1 `json:"inner"` - Map map[string]Type2 `json:"map"` - Timestamp time.Time `json:"timestamp"` - Union interface{} `json:"union"` -} +package customkind2 -// CustomKind2Enum defines model for CustomKind2.Enum. -type CustomKind2Enum string +import "time" -// InnerObject1 defines model for InnerObject1. type InnerObject1 struct { InnerField1 string `json:"innerField1"` InnerField2 []string `json:"innerField2"` InnerField3 []InnerObject2 `json:"innerField3"` } -// InnerObject2 defines model for InnerObject2. type InnerObject2 struct { - Details map[string]interface{} `json:"details"` - Name string `json:"name"` + Name string `json:"name"` + Details map[string]any `json:"details"` } -// Type1 defines model for Type1. type Type1 struct { Group string `json:"group"` Options []string `json:"options,omitempty"` } -// Type2 defines model for Type2. type Type2 struct { - Details map[string]interface{} `json:"details"` - Group string `json:"group"` + Group string `json:"group"` + Details map[string]any `json:"details"` } + +type UnionType any + +type CustomKind2 struct { + Field1 string `json:"field1"` + Inner InnerObject1 `json:"inner"` + Union UnionType `json:"union"` + Map map[string]Type2 `json:"map"` + Timestamp time.Time `json:"timestamp"` + Enum CustomKind2Enum `json:"enum"` + I32 int32 `json:"i32"` + I64 int64 `json:"i64"` + BoolField bool `json:"boolField"` + FloatField float64 `json:"floatField"` +} + +type CustomKind2Enum string + +const ( + CustomKind2EnumVal1 CustomKind2Enum = "val1" + CustomKind2EnumVal2 CustomKind2Enum = "val2" + CustomKind2EnumVal3 CustomKind2Enum = "val3" + CustomKind2EnumVal4 CustomKind2Enum = "val4" + CustomKind2EnumDefault CustomKind2Enum = "default" +) diff --git a/codegen/testing/golden_generated/typescript/unversioned/customkind2_types.gen.ts.txt b/codegen/testing/golden_generated/typescript/unversioned/customkind2_types.gen.ts.txt index db8f9220..a5af1fed 100644 --- a/codegen/testing/golden_generated/typescript/unversioned/customkind2_types.gen.ts.txt +++ b/codegen/testing/golden_generated/typescript/unversioned/customkind2_types.gen.ts.txt @@ -1,59 +1,73 @@ +// Code generated - EDITING IS FUTILE. DO NOT EDIT. + export interface InnerObject1 { - innerField1: string; - innerField2: string[]; - innerField3: Array; + innerField1: string; + innerField2: string[]; + innerField3: InnerObject2[]; } -export const defaultInnerObject1: Partial = { - innerField2: [], - innerField3: [], -}; +export const defaultInnerObject1 = (): InnerObject1 => ({ + innerField1: "", + innerField2: [], + innerField3: [], +}); export interface InnerObject2 { - details: Record; - name: string; + name: string; + details: Record; } +export const defaultInnerObject2 = (): InnerObject2 => ({ + name: "", + details: {}, +}); + export interface Type1 { - group: string; - options?: string[]; + group: string; + options?: string[]; } -export const defaultType1: Partial = { - options: [], -}; +export const defaultType1 = (): Type1 => ({ + group: "", +}); export interface Type2 { - details: Record; - group: string; + group: string; + details: Record; } -export type UnionType = (Type1 | Type2); +export const defaultType2 = (): Type2 => ({ + group: "", + details: {}, +}); -export enum enum { - Default = 'default', - Val1 = 'val1', - Val2 = 'val2', - Val3 = 'val3', - Val4 = 'val4', -} +export type UnionType = Type1 | Type2; -export const defaultenum: enum = enum.Default; +export const defaultUnionType = (): UnionType => (defaultType1()); export interface CustomKind2 { - boolField: boolean; - enum: ('val1' | 'val2' | 'val3' | 'val4' | 'default'); - field1: string; - floatField: number; - i32: number; - i64: number; - inner: InnerObject1; - map: Record; - timestamp: string; - union: UnionType; + field1: string; + inner: InnerObject1; + union: UnionType; + map: Record; + timestamp: string; + enum: "val1" | "val2" | "val3" | "val4" | "default"; + i32: number; + i64: number; + boolField: boolean; + floatField: number; } -export const defaultCustomKind2: Partial = { - boolField: false, - enum: 'default', -}; +export const defaultCustomKind2 = (): CustomKind2 => ({ + field1: "", + inner: defaultInnerObject1(), + union: defaultUnionType(), + map: {}, + timestamp: "", + enum: "default", + i32: 0, + i64: 0, + boolField: false, + floatField: 0, +}); + diff --git a/codegen/testing/golden_generated/typescript/unversioned/customkind_types.gen.ts.txt b/codegen/testing/golden_generated/typescript/unversioned/customkind_types.gen.ts.txt index 8c34cf15..d6eee7a0 100644 --- a/codegen/testing/golden_generated/typescript/unversioned/customkind_types.gen.ts.txt +++ b/codegen/testing/golden_generated/typescript/unversioned/customkind_types.gen.ts.txt @@ -1,107 +1,143 @@ +// Code generated - EDITING IS FUTILE. DO NOT EDIT. + export interface InnerObject1 { - innerField1: string; - innerField2: string[]; - innerField3: Array; + innerField1: string; + innerField2: string[]; + innerField3: InnerObject2[]; } -export const defaultInnerObject1: Partial = { - innerField2: [], - innerField3: [], -}; +export const defaultInnerObject1 = (): InnerObject1 => ({ + innerField1: "", + innerField2: [], + innerField3: [], +}); export interface InnerObject2 { - details: Record; - name: string; + name: string; + details: Record; } +export const defaultInnerObject2 = (): InnerObject2 => ({ + name: "", + details: {}, +}); + export interface Type1 { - group: string; - options?: string[]; + group: string; + options?: string[]; } -export const defaultType1: Partial = { - options: [], -}; +export const defaultType1 = (): Type1 => ({ + group: "", +}); export interface Type2 { - details: Record; - group: string; + group: string; + details: Record; } -export type UnionType = (Type1 | Type2); +export const defaultType2 = (): Type2 => ({ + group: "", + details: {}, +}); + +export type UnionType = Type1 | Type2; + +export const defaultUnionType = (): UnionType => (defaultType1()); + +export interface OperatorState { + // lastEvaluation is the ResourceVersion last evaluated + lastEvaluation: string; + // state describes the state of the lastEvaluation. + // It is limited to three possible states for machine evaluation. + state: "success" | "in_progress" | "failed"; + // descriptiveState is an optional more descriptive state field which has no requirements on format + descriptiveState?: string; + // details contains any extra information that is operator-specific + details?: Record; +} + +export const defaultOperatorState = (): OperatorState => ({ + lastEvaluation: "", + state: "success", +}); export interface CustomKind { - /** - * 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. - */ - metadata: { - /** - * 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; - updateTimestamp: string; - createdBy: string; - uid: string; - creationTimestamp: string; - deletionTimestamp?: string; - finalizers: string[]; - resourceVersion: string; - generation: number; - /** - * 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; - updatedBy: string; - labels: Record; - }; - spec: { - field1: string; - inner: InnerObject1; - union: UnionType; - map: Record; - timestamp: string; - enum: ('val1' | 'val2' | 'val3' | 'val4' | 'default'); - i32: number; - i64: number; - boolField: boolean; - floatField: number; - }; - status: { - statusField1: string; - /** - * 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?: Record, -}>; - /** - * additionalFields is reserved for future use - */ - additionalFields?: Record; - }; + spec: { + field1: string; + inner: InnerObject1; + union: UnionType; + map: Record; + timestamp: string; + enum: "val1" | "val2" | "val3" | "val4" | "default"; + i32: number; + i64: number; + boolField: boolean; + floatField: number; + }; + status: { + statusField1: string; + // 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?: Record; + // additionalFields is reserved for future use + additionalFields?: Record; + }; + // 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. + metadata: { + // 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; + updateTimestamp: string; + createdBy: string; + uid: string; + creationTimestamp: string; + deletionTimestamp?: string; + finalizers: string[]; + resourceVersion: string; + generation: number; + // 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; + updatedBy: string; + labels: Record; + }; } + +export const defaultCustomKind = (): CustomKind => ({ + spec: { + field1: "", + inner: defaultInnerObject1(), + union: defaultUnionType(), + map: {}, + timestamp: "", + enum: "default", + i32: 0, + i64: 0, + boolField: false, + floatField: 0, +}, + status: { + statusField1: "", +}, + metadata: { + customMetadataField: "", + updateTimestamp: "", + createdBy: "", + uid: "", + creationTimestamp: "", + finalizers: [], + resourceVersion: "", + generation: 0, + otherMetadataField: "", + updatedBy: "", + labels: {}, +}, +}); + diff --git a/codegen/testing/golden_generated/typescript/versioned/customkind/v0-0/types.metadata.gen.ts.txt b/codegen/testing/golden_generated/typescript/versioned/customkind/v0-0/types.metadata.gen.ts.txt index 313c6558..4377f3c1 100644 --- a/codegen/testing/golden_generated/typescript/versioned/customkind/v0-0/types.metadata.gen.ts.txt +++ b/codegen/testing/golden_generated/typescript/versioned/customkind/v0-0/types.metadata.gen.ts.txt @@ -1,21 +1,30 @@ -/** - * 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. - */ +// Code generated - EDITING IS FUTILE. DO NOT EDIT. + +// 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. export interface Metadata { - createdBy: string; - creationTimestamp: string; - deletionTimestamp?: string; - finalizers: string[]; - generation: number; - labels: Record; - resourceVersion: string; - uid: string; - updateTimestamp: string; - updatedBy: string; + updateTimestamp: string; + createdBy: string; + uid: string; + creationTimestamp: string; + deletionTimestamp?: string; + finalizers: string[]; + resourceVersion: string; + generation: number; + updatedBy: string; + labels: Record; } -export const defaultMetadata: Partial = { - finalizers: [], -}; +export const defaultMetadata = (): Metadata => ({ + updateTimestamp: "", + createdBy: "", + uid: "", + creationTimestamp: "", + finalizers: [], + resourceVersion: "", + generation: 0, + updatedBy: "", + labels: {}, +}); + diff --git a/codegen/testing/golden_generated/typescript/versioned/customkind/v0-0/types.spec.gen.ts.txt b/codegen/testing/golden_generated/typescript/versioned/customkind/v0-0/types.spec.gen.ts.txt index 81ffe520..ccc3411a 100644 --- a/codegen/testing/golden_generated/typescript/versioned/customkind/v0-0/types.spec.gen.ts.txt +++ b/codegen/testing/golden_generated/typescript/versioned/customkind/v0-0/types.spec.gen.ts.txt @@ -1,4 +1,12 @@ +// Code generated - EDITING IS FUTILE. DO NOT EDIT. + export interface Spec { - deprecatedField: string; - field1: string; + field1: string; + deprecatedField: string; } + +export const defaultSpec = (): Spec => ({ + field1: "", + deprecatedField: "", +}); + diff --git a/codegen/testing/golden_generated/typescript/versioned/customkind/v0-0/types.status.gen.ts.txt b/codegen/testing/golden_generated/typescript/versioned/customkind/v0-0/types.status.gen.ts.txt index d1f8620c..01be8df7 100644 --- a/codegen/testing/golden_generated/typescript/versioned/customkind/v0-0/types.status.gen.ts.txt +++ b/codegen/testing/golden_generated/typescript/versioned/customkind/v0-0/types.status.gen.ts.txt @@ -1,29 +1,30 @@ +// Code generated - EDITING IS FUTILE. DO NOT EDIT. + +export interface OperatorState { + // lastEvaluation is the ResourceVersion last evaluated + lastEvaluation: string; + // state describes the state of the lastEvaluation. + // It is limited to three possible states for machine evaluation. + state: "success" | "in_progress" | "failed"; + // descriptiveState is an optional more descriptive state field which has no requirements on format + descriptiveState?: string; + // details contains any extra information that is operator-specific + details?: Record; +} + +export const defaultOperatorState = (): OperatorState => ({ + lastEvaluation: "", + state: "success", +}); + export interface Status { - /** - * additionalFields is reserved for future use - */ - additionalFields?: Record; - /** - * 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?: Record, -}>; + // 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?: Record; + // additionalFields is reserved for future use + additionalFields?: Record; } + +export const defaultStatus = (): Status => ({ +}); + diff --git a/codegen/testing/golden_generated/typescript/versioned/customkind/v1-0/types.metadata.gen.ts.txt b/codegen/testing/golden_generated/typescript/versioned/customkind/v1-0/types.metadata.gen.ts.txt index 3f1cdb1a..bc3062a3 100644 --- a/codegen/testing/golden_generated/typescript/versioned/customkind/v1-0/types.metadata.gen.ts.txt +++ b/codegen/testing/golden_generated/typescript/versioned/customkind/v1-0/types.metadata.gen.ts.txt @@ -1,35 +1,42 @@ -/** - * 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. - */ +// Code generated - EDITING IS FUTILE. DO NOT EDIT. + +// 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. export interface Metadata { - createdBy: string; - creationTimestamp: string; - /** - * 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; - deletionTimestamp?: string; - finalizers: string[]; - generation: number; - labels: Record; - /** - * 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; - resourceVersion: string; - uid: string; - updateTimestamp: string; - updatedBy: string; + // 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; + updateTimestamp: string; + createdBy: string; + uid: string; + creationTimestamp: string; + deletionTimestamp?: string; + finalizers: string[]; + resourceVersion: string; + generation: number; + // 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; + updatedBy: string; + labels: Record; } -export const defaultMetadata: Partial = { - finalizers: [], -}; +export const defaultMetadata = (): Metadata => ({ + customMetadataField: "", + updateTimestamp: "", + createdBy: "", + uid: "", + creationTimestamp: "", + finalizers: [], + resourceVersion: "", + generation: 0, + otherMetadataField: "", + updatedBy: "", + labels: {}, +}); + diff --git a/codegen/testing/golden_generated/typescript/versioned/customkind/v1-0/types.spec.gen.ts.txt b/codegen/testing/golden_generated/typescript/versioned/customkind/v1-0/types.spec.gen.ts.txt index aba03faf..0351b33c 100644 --- a/codegen/testing/golden_generated/typescript/versioned/customkind/v1-0/types.spec.gen.ts.txt +++ b/codegen/testing/golden_generated/typescript/versioned/customkind/v1-0/types.spec.gen.ts.txt @@ -1,27 +1,73 @@ -export enum enum { - Default = 'default', - Val1 = 'val1', - Val2 = 'val2', - Val3 = 'val3', - Val4 = 'val4', +// Code generated - EDITING IS FUTILE. DO NOT EDIT. + +export interface InnerObject1 { + innerField1: string; + innerField2: string[]; + innerField3: InnerObject2[]; +} + +export const defaultInnerObject1 = (): InnerObject1 => ({ + innerField1: "", + innerField2: [], + innerField3: [], +}); + +export interface InnerObject2 { + name: string; + details: Record; +} + +export const defaultInnerObject2 = (): InnerObject2 => ({ + name: "", + details: {}, +}); + +export interface Type1 { + group: string; + options?: string[]; } -export const defaultenum: enum = enum.Default; +export const defaultType1 = (): Type1 => ({ + group: "", +}); + +export interface Type2 { + group: string; + details: Record; +} + +export const defaultType2 = (): Type2 => ({ + group: "", + details: {}, +}); + +export type UnionType = Type1 | Type2; + +export const defaultUnionType = (): UnionType => (defaultType1()); export interface Spec { - boolField: boolean; - enum: ('val1' | 'val2' | 'val3' | 'val4' | 'default'); - field1: string; - floatField: number; - i32: number; - i64: number; - inner: InnerObject1; - map: Record; - timestamp: string; - union: UnionType; + field1: string; + inner: InnerObject1; + union: UnionType; + map: Record; + timestamp: string; + enum: "val1" | "val2" | "val3" | "val4" | "default"; + i32: number; + i64: number; + boolField: boolean; + floatField: number; } -export const defaultSpec: Partial = { - boolField: false, - enum: 'default', -}; +export const defaultSpec = (): Spec => ({ + field1: "", + inner: defaultInnerObject1(), + union: defaultUnionType(), + map: {}, + timestamp: "", + enum: "default", + i32: 0, + i64: 0, + boolField: false, + floatField: 0, +}); + diff --git a/codegen/testing/golden_generated/typescript/versioned/customkind/v1-0/types.status.gen.ts.txt b/codegen/testing/golden_generated/typescript/versioned/customkind/v1-0/types.status.gen.ts.txt index 3c977e60..d5e40a0e 100644 --- a/codegen/testing/golden_generated/typescript/versioned/customkind/v1-0/types.status.gen.ts.txt +++ b/codegen/testing/golden_generated/typescript/versioned/customkind/v1-0/types.status.gen.ts.txt @@ -1,30 +1,32 @@ +// Code generated - EDITING IS FUTILE. DO NOT EDIT. + +export interface OperatorState { + // lastEvaluation is the ResourceVersion last evaluated + lastEvaluation: string; + // state describes the state of the lastEvaluation. + // It is limited to three possible states for machine evaluation. + state: "success" | "in_progress" | "failed"; + // descriptiveState is an optional more descriptive state field which has no requirements on format + descriptiveState?: string; + // details contains any extra information that is operator-specific + details?: Record; +} + +export const defaultOperatorState = (): OperatorState => ({ + lastEvaluation: "", + state: "success", +}); + export interface Status { - /** - * additionalFields is reserved for future use - */ - additionalFields?: Record; - /** - * 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?: Record, -}>; - statusField1: string; + statusField1: string; + // 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?: Record; + // additionalFields is reserved for future use + additionalFields?: Record; } + +export const defaultStatus = (): Status => ({ + statusField1: "", +}); + diff --git a/codegen/thema/generators_test.go b/codegen/thema/generators_test.go index f13d3c4c..b7165b1a 100644 --- a/codegen/thema/generators_test.go +++ b/codegen/thema/generators_test.go @@ -54,7 +54,7 @@ func TestResourceGenerator(t *testing.T) { require.Nil(t, err) files, err := parser.Generate(ResourceGenerator(), "customKind") - require.Nil(t, err) + require.NoError(t, err) // Check number of files generated // 8 -> object, spec, metadata, status, lineage (CUE), lineage (go), schema, codec, cue.mod/module.cue assert.Len(t, files, 9) diff --git a/codegen/thema/testing/customkind.cue b/codegen/thema/testing/customkind.cue index bfc0a61f..031cab27 100644 --- a/codegen/thema/testing/customkind.cue +++ b/codegen/thema/testing/customkind.cue @@ -12,39 +12,40 @@ customKind: { lineage: { name: "customkind", schemas: [{ - version: [0,0] - schema: { - spec: { - field1: string - deprecatedField: string - } - } + version: [0,0] + schema: { + spec: { + field1: string + deprecatedField: string + } + } },{ version: [1,0] schema: { - #InnerObject1: { - innerField1: string - innerField2: [...string] - innerField3: [...#InnerObject2] - } - #InnerObject2: { - name: string - details: { - [string]: _ + spec: { + #InnerObject1: { + innerField1: string + innerField2: [...string] + innerField3: [...#InnerObject2] } - } - #Type1: { - group: string - options?: [...string] - } - #Type2: { - group: string - details: { - [string]: _ + #InnerObject2: { + name: string + details: { + [string]: _ + } } - } - #UnionType: #Type1 | #Type2 - spec: { + #Type1: { + group: string + options?: [...string] + } + #Type2: { + group: string + details: { + [string]: _ + } + } + #UnionType: #Type1 | #Type2 + field1: string inner: #InnerObject1 union: #UnionType diff --git a/go.mod b/go.mod index 3e45514c..25c7e64d 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( cuelang.org/go v0.8.2 github.com/getkin/kin-openapi v0.123.0 github.com/grafana/codejen v0.0.4-0.20230321061741-77f656893a3d - github.com/grafana/cog v0.0.0-20240625151715-4edf6d363ef5 + github.com/grafana/cog v0.0.0-20240701132206-feda63c6647f github.com/grafana/thema v0.0.0-20230511182720-3146087fcc26 github.com/hashicorp/go-multierror v1.1.1 github.com/matryer/moq v0.3.4 diff --git a/go.sum b/go.sum index e6a660af..b0df39e7 100644 --- a/go.sum +++ b/go.sum @@ -137,8 +137,8 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORR github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grafana/codejen v0.0.4-0.20230321061741-77f656893a3d h1:hrXbGJ5jgp6yNITzs5o+zXq0V5yT3siNJ+uM8LGwWKk= github.com/grafana/codejen v0.0.4-0.20230321061741-77f656893a3d/go.mod h1:zmwwM/DRyQB7pfuBjTWII3CWtxcXh8LTwAYGfDfpR6s= -github.com/grafana/cog v0.0.0-20240625151715-4edf6d363ef5 h1:MnfHP4jj63Ddc94Cl0ZLu9gzCvSa3U4QyGlTgDElaW8= -github.com/grafana/cog v0.0.0-20240625151715-4edf6d363ef5/go.mod h1:liBxkYUVBZ9rgBe4pBa0SC1Mip7SRO2oiM0DpsSRCQY= +github.com/grafana/cog v0.0.0-20240701132206-feda63c6647f h1:vNtlN+e3ZrTJBI8ChnGPoBEFySEqnGCUl0oF45kEGjc= +github.com/grafana/cog v0.0.0-20240701132206-feda63c6647f/go.mod h1:liBxkYUVBZ9rgBe4pBa0SC1Mip7SRO2oiM0DpsSRCQY= github.com/grafana/thema v0.0.0-20230511182720-3146087fcc26 h1:HX927q4X1n451pnGb8U0wq74i8PCzuxVjzv7TyD10kc= github.com/grafana/thema v0.0.0-20230511182720-3146087fcc26/go.mod h1:Pn9nfzCk7nV0mvNgwusgCjCROZP6nm4GpwTnmEhLT24= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= diff --git a/go.work.sum b/go.work.sum index e89dde50..3b79d896 100644 --- a/go.work.sum +++ b/go.work.sum @@ -213,7 +213,9 @@ github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad github.com/grafana/codejen v0.0.3/go.mod h1:zmwwM/DRyQB7pfuBjTWII3CWtxcXh8LTwAYGfDfpR6s= github.com/grafana/cog v0.0.0-20240529130920-083c489f684f/go.mod h1:A+ggqoURW2MB0Y5bxfi7DZOtxKYqwLuugRfMI+sT/0w= github.com/grafana/cog v0.0.0-20240603130906-42de25f609a6/go.mod h1:A+ggqoURW2MB0Y5bxfi7DZOtxKYqwLuugRfMI+sT/0w= +github.com/grafana/cog v0.0.0-20240625151715-4edf6d363ef5/go.mod h1:liBxkYUVBZ9rgBe4pBa0SC1Mip7SRO2oiM0DpsSRCQY= github.com/grafana/cuetsy v0.1.10/go.mod h1:Ix97+CPD8ws9oSSxR3/Lf4ahU1I4Np83kjJmDVnLZvc= +github.com/grafana/cuetsy v0.1.11/go.mod h1:Ix97+CPD8ws9oSSxR3/Lf4ahU1I4Np83kjJmDVnLZvc= github.com/grafana/grafana-plugin-sdk-go v0.222.0/go.mod h1:0lYONo3rJrjIoJNOQP0h2NXmOaF5rFIuH/rwSVSeIrQ= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= @@ -277,6 +279,7 @@ github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNue github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=