diff --git a/codegen/templates/lineage.tmpl b/codegen/templates/lineage.tmpl index 7a915906..08d0b6c8 100644 --- a/codegen/templates/lineage.tmpl +++ b/codegen/templates/lineage.tmpl @@ -30,7 +30,7 @@ var LacunaResolver func(*LineageType, []thema.Lacuna) error = nil // and Object has extra fields for metadata (which necessarily cannot be rendered in the Lineage/Schema, // but must exist for the Object). This is essentially an "intermediate step" struct. type LineageType struct { {{ range .Subresources }} - {{.TypeName}} {{.TypeName}} `json:"{{.JSONName}}"`{{ end }} + {{.TypeName}} {{.TypeName}} `json:"{{.JSONName}}" yaml:"{{.JSONName}}"`{{ end }} } func init() { diff --git a/codegen/templates/resourceobject.tmpl b/codegen/templates/resourceobject.tmpl index 194d7865..91a5553a 100644 --- a/codegen/templates/resourceobject.tmpl +++ b/codegen/templates/resourceobject.tmpl @@ -16,11 +16,11 @@ import ({{ range .CustomMetadataFields }}{{ range $imp := .GoType.AdditionalImpo // +k8s:openapi-gen=true type {{.TypeName}} struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - Spec {{.SpecTypeName}} `json:"spec"`{{ range .Subresources }}{{ if ne .Comment "" }} + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec {{.SpecTypeName}} `json:"spec" yaml:"spec"`{{ range .Subresources }}{{ if ne .Comment "" }} // {{.Comment }}{{end}} - {{ .TypeName }} {{.TypeName}} `json:"{{.JSONName}}"`{{ end }} + {{ .TypeName }} {{.TypeName}} `json:"{{.JSONName}}" yaml:"{{.JSONName}}"`{{ end }} } func ({{.ObjectShortName}} *{{.TypeName}}) GetSpec() any { @@ -196,9 +196,9 @@ var _ resource.Object = &{{.TypeName}}{} // +k8s:openapi-gen=true type {{.TypeName}}List struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - Items []{{.TypeName}} `json:"items"` + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []{{.TypeName}} `json:"items" yaml:"items"` } func ({{.ObjectShortName}} *{{.TypeName}}List) DeepCopyObject() runtime.Object { diff --git a/codegen/templates/secure/data.tmpl b/codegen/templates/secure/data.tmpl index 13a47c1c..459d8428 100644 --- a/codegen/templates/secure/data.tmpl +++ b/codegen/templates/secure/data.tmpl @@ -2,7 +2,7 @@ package secure // Data is the go model of the plugin's secureJsonData type Data struct { - AuthHeaderContent string `json:"auth_header_content"` + AuthHeaderContent string `json:"auth_header_content" yaml:"auth_header_content"` } // ParseRaw parses secure settings from a raw string map. 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..5ccd087d 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 @@ -6,27 +6,27 @@ import ( // CustomKindMetadata defines model for CustomKindMetadata. type CustomKindMetadata struct { - 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"` + CreatedBy string `json:"createdBy" yaml:"createdBy"` + CreationTimestamp time.Time `json:"creationTimestamp" yaml:"creationTimestamp"` + DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty" yaml:"deletionTimestamp,omitempty"` + Finalizers []string `json:"finalizers" yaml:"finalizers"` + Generation int64 `json:"generation" yaml:"generation"` + Labels map[string]string `json:"labels" yaml:"labels"` + ResourceVersion string `json:"resourceVersion" yaml:"resourceVersion"` + Uid string `json:"uid" yaml:"uid"` + UpdateTimestamp time.Time `json:"updateTimestamp" yaml:"updateTimestamp"` + UpdatedBy string `json:"updatedBy" yaml:"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"` + CreationTimestamp time.Time `json:"creationTimestamp" yaml:"creationTimestamp"` + DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty" yaml:"deletionTimestamp,omitempty"` + Finalizers []string `json:"finalizers" yaml:"finalizers"` + Generation int64 `json:"generation" yaml:"generation"` + Labels map[string]string `json:"labels" yaml:"labels"` + ResourceVersion string `json:"resourceVersion" yaml:"resourceVersion"` + Uid string `json:"uid" yaml:"uid"` } diff --git a/codegen/testing/golden_generated/go/groupbygroup/custom/v0_0/customkind_object_gen.go.txt b/codegen/testing/golden_generated/go/groupbygroup/custom/v0_0/customkind_object_gen.go.txt index db30307d..ff70bec9 100644 --- a/codegen/testing/golden_generated/go/groupbygroup/custom/v0_0/customkind_object_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbygroup/custom/v0_0/customkind_object_gen.go.txt @@ -16,10 +16,10 @@ import ( // +k8s:openapi-gen=true type CustomKind struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - Spec CustomKindSpec `json:"spec"` - CustomKindStatus CustomKindStatus `json:"status"` + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec CustomKindSpec `json:"spec" yaml:"spec"` + CustomKindStatus CustomKindStatus `json:"status" yaml:"status"` } func (o *CustomKind) GetSpec() any { @@ -224,9 +224,9 @@ var _ resource.Object = &CustomKind{} // +k8s:openapi-gen=true type CustomKindList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - Items []CustomKind `json:"items"` + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []CustomKind `json:"items" yaml:"items"` } func (o *CustomKindList) DeepCopyObject() runtime.Object { 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..ed1c2561 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 @@ -3,6 +3,6 @@ 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" yaml:"deprecatedField"` + Field1 string `json:"field1" yaml:"field1"` } 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..b0bad54c 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 @@ -18,17 +18,17 @@ const ( // +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"` + DescriptiveState *string `json:"descriptiveState,omitempty" yaml:"descriptiveState,omitempty"` // details contains any extra information that is operator-specific - Details map[string]interface{} `json:"details,omitempty"` + Details map[string]interface{} `json:"details,omitempty" yaml:"details,omitempty"` // lastEvaluation is the ResourceVersion last evaluated - LastEvaluation string `json:"lastEvaluation"` + LastEvaluation string `json:"lastEvaluation" yaml:"lastEvaluation"` // state describes the state of the lastEvaluation. // It is limited to three possible states for machine evaluation. - State CustomKindOperatorStateState `json:"state"` + State CustomKindOperatorStateState `json:"state" yaml:"state"` } // CustomKindOperatorStateState state describes the state of the lastEvaluation. @@ -40,28 +40,28 @@ type CustomKindOperatorStateState string // +k8s:openapi-gen=true type CustomKindStatus struct { // additionalFields is reserved for future use - AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"` + AdditionalFields map[string]interface{} `json:"additionalFields,omitempty" yaml:"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"` + OperatorStates map[string]CustomKindstatusOperatorState `json:"operatorStates,omitempty" yaml:"operatorStates,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"` + DescriptiveState *string `json:"descriptiveState,omitempty" yaml:"descriptiveState,omitempty"` // details contains any extra information that is operator-specific - Details map[string]interface{} `json:"details,omitempty"` + Details map[string]interface{} `json:"details,omitempty" yaml:"details,omitempty"` // lastEvaluation is the ResourceVersion last evaluated - LastEvaluation string `json:"lastEvaluation"` + LastEvaluation string `json:"lastEvaluation" yaml:"lastEvaluation"` // state describes the state of the lastEvaluation. // It is limited to three possible states for machine evaluation. - State CustomKindstatusOperatorStateState `json:"state"` + State CustomKindstatusOperatorStateState `json:"state" yaml:"state"` } // CustomKindstatusOperatorStateState state describes the state of the lastEvaluation. 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..02faaa13 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 @@ -6,29 +6,29 @@ import ( // CustomKindMetadata defines model for CustomKindMetadata. 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"` + CreatedBy string `json:"createdBy" yaml:"createdBy"` + CreationTimestamp time.Time `json:"creationTimestamp" yaml:"creationTimestamp"` + CustomMetadataField string `json:"customMetadataField" yaml:"customMetadataField"` + DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty" yaml:"deletionTimestamp,omitempty"` + Finalizers []string `json:"finalizers" yaml:"finalizers"` + Generation int64 `json:"generation" yaml:"generation"` + Labels map[string]string `json:"labels" yaml:"labels"` + OtherMetadataField string `json:"otherMetadataField" yaml:"otherMetadataField"` + ResourceVersion string `json:"resourceVersion" yaml:"resourceVersion"` + Uid string `json:"uid" yaml:"uid"` + UpdateTimestamp time.Time `json:"updateTimestamp" yaml:"updateTimestamp"` + UpdatedBy string `json:"updatedBy" yaml:"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"` + CreationTimestamp time.Time `json:"creationTimestamp" yaml:"creationTimestamp"` + DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty" yaml:"deletionTimestamp,omitempty"` + Finalizers []string `json:"finalizers" yaml:"finalizers"` + Generation int64 `json:"generation" yaml:"generation"` + Labels map[string]string `json:"labels" yaml:"labels"` + ResourceVersion string `json:"resourceVersion" yaml:"resourceVersion"` + Uid string `json:"uid" yaml:"uid"` } diff --git a/codegen/testing/golden_generated/go/groupbygroup/custom/v1_0/customkind_object_gen.go.txt b/codegen/testing/golden_generated/go/groupbygroup/custom/v1_0/customkind_object_gen.go.txt index 853e5871..c1883f51 100644 --- a/codegen/testing/golden_generated/go/groupbygroup/custom/v1_0/customkind_object_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbygroup/custom/v1_0/customkind_object_gen.go.txt @@ -16,10 +16,10 @@ import ( // +k8s:openapi-gen=true type CustomKind struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - Spec CustomKindSpec `json:"spec"` - CustomKindStatus CustomKindStatus `json:"status"` + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec CustomKindSpec `json:"spec" yaml:"spec"` + CustomKindStatus CustomKindStatus `json:"status" yaml:"status"` } func (o *CustomKind) GetSpec() any { @@ -256,9 +256,9 @@ var _ resource.Object = &CustomKind{} // +k8s:openapi-gen=true type CustomKindList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - Items []CustomKind `json:"items"` + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []CustomKind `json:"items" yaml:"items"` } func (o *CustomKindList) DeepCopyObject() runtime.Object { 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..cedca228 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 @@ -16,31 +16,31 @@ const ( // CustomKindInnerObject1 defines model for CustomKindInnerObject1. // +k8s:openapi-gen=true type CustomKindInnerObject1 struct { - InnerField1 string `json:"innerField1"` - InnerField2 []string `json:"innerField2"` - InnerField3 []CustomKindInnerObject2 `json:"innerField3"` + InnerField1 string `json:"innerField1" yaml:"innerField1"` + InnerField2 []string `json:"innerField2" yaml:"innerField2"` + InnerField3 []CustomKindInnerObject2 `json:"innerField3" yaml:"innerField3"` } // CustomKindInnerObject2 defines model for CustomKindInnerObject2. // +k8s:openapi-gen=true type CustomKindInnerObject2 struct { - Details map[string]interface{} `json:"details"` - Name string `json:"name"` + Details map[string]interface{} `json:"details" yaml:"details"` + Name string `json:"name" yaml:"name"` } // 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"` + BoolField bool `json:"boolField" yaml:"boolField"` + Enum CustomKindSpecEnum `json:"enum" yaml:"enum"` + Field1 string `json:"field1" yaml:"field1"` + FloatField float64 `json:"floatField" yaml:"floatField"` + I32 int `json:"i32" yaml:"i32"` + I64 int `json:"i64" yaml:"i64"` + Inner CustomKindInnerObject1 `json:"inner" yaml:"inner"` + Map map[string]CustomKindType2 `json:"map" yaml:"map"` + Timestamp time.Time `json:"timestamp" yaml:"timestamp"` + Union interface{} `json:"union" yaml:"union"` } // CustomKindSpecEnum defines model for CustomKindSpec.Enum. @@ -50,13 +50,13 @@ type CustomKindSpecEnum string // CustomKindType1 defines model for CustomKindType1. // +k8s:openapi-gen=true type CustomKindType1 struct { - Group string `json:"group"` - Options []string `json:"options,omitempty"` + Group string `json:"group" yaml:"group"` + Options []string `json:"options,omitempty" yaml:"options,omitempty"` } // CustomKindType2 defines model for CustomKindType2. // +k8s:openapi-gen=true type CustomKindType2 struct { - Details map[string]interface{} `json:"details"` - Group string `json:"group"` + Details map[string]interface{} `json:"details" yaml:"details"` + Group string `json:"group" yaml:"group"` } 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..9f87e0bc 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 @@ -18,17 +18,17 @@ const ( // +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"` + DescriptiveState *string `json:"descriptiveState,omitempty" yaml:"descriptiveState,omitempty"` // details contains any extra information that is operator-specific - Details map[string]interface{} `json:"details,omitempty"` + Details map[string]interface{} `json:"details,omitempty" yaml:"details,omitempty"` // lastEvaluation is the ResourceVersion last evaluated - LastEvaluation string `json:"lastEvaluation"` + LastEvaluation string `json:"lastEvaluation" yaml:"lastEvaluation"` // state describes the state of the lastEvaluation. // It is limited to three possible states for machine evaluation. - State CustomKindOperatorStateState `json:"state"` + State CustomKindOperatorStateState `json:"state" yaml:"state"` } // CustomKindOperatorStateState state describes the state of the lastEvaluation. @@ -40,29 +40,29 @@ type CustomKindOperatorStateState string // +k8s:openapi-gen=true type CustomKindStatus struct { // additionalFields is reserved for future use - AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"` + AdditionalFields map[string]interface{} `json:"additionalFields,omitempty" yaml:"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"` - StatusField1 string `json:"statusField1"` + OperatorStates map[string]CustomKindstatusOperatorState `json:"operatorStates,omitempty" yaml:"operatorStates,omitempty"` + StatusField1 string `json:"statusField1" yaml:"statusField1"` } // 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"` + DescriptiveState *string `json:"descriptiveState,omitempty" yaml:"descriptiveState,omitempty"` // details contains any extra information that is operator-specific - Details map[string]interface{} `json:"details,omitempty"` + Details map[string]interface{} `json:"details,omitempty" yaml:"details,omitempty"` // lastEvaluation is the ResourceVersion last evaluated - LastEvaluation string `json:"lastEvaluation"` + LastEvaluation string `json:"lastEvaluation" yaml:"lastEvaluation"` // state describes the state of the lastEvaluation. // It is limited to three possible states for machine evaluation. - State CustomKindstatusOperatorStateState `json:"state"` + State CustomKindstatusOperatorStateState `json:"state" yaml:"state"` } // CustomKindstatusOperatorStateState state describes the state of the lastEvaluation. 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..5901c26e 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 @@ -6,27 +6,27 @@ import ( // TestKind2Metadata defines model for TestKind2Metadata. type TestKind2Metadata struct { - 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"` + CreatedBy string `json:"createdBy" yaml:"createdBy"` + CreationTimestamp time.Time `json:"creationTimestamp" yaml:"creationTimestamp"` + DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty" yaml:"deletionTimestamp,omitempty"` + Finalizers []string `json:"finalizers" yaml:"finalizers"` + Generation int64 `json:"generation" yaml:"generation"` + Labels map[string]string `json:"labels" yaml:"labels"` + ResourceVersion string `json:"resourceVersion" yaml:"resourceVersion"` + Uid string `json:"uid" yaml:"uid"` + UpdateTimestamp time.Time `json:"updateTimestamp" yaml:"updateTimestamp"` + UpdatedBy string `json:"updatedBy" yaml:"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"` - Generation int64 `json:"generation"` - Labels map[string]string `json:"labels"` - ResourceVersion string `json:"resourceVersion"` - Uid string `json:"uid"` + CreationTimestamp time.Time `json:"creationTimestamp" yaml:"creationTimestamp"` + DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty" yaml:"deletionTimestamp,omitempty"` + Finalizers []string `json:"finalizers" yaml:"finalizers"` + Generation int64 `json:"generation" yaml:"generation"` + Labels map[string]string `json:"labels" yaml:"labels"` + ResourceVersion string `json:"resourceVersion" yaml:"resourceVersion"` + Uid string `json:"uid" yaml:"uid"` } diff --git a/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind2_object_gen.go.txt b/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind2_object_gen.go.txt index c060230e..3fb3e163 100644 --- a/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind2_object_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind2_object_gen.go.txt @@ -16,10 +16,10 @@ import ( // +k8s:openapi-gen=true type TestKind2 struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - Spec TestKind2Spec `json:"spec"` - TestKind2Status TestKind2Status `json:"status"` + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec TestKind2Spec `json:"spec" yaml:"spec"` + TestKind2Status TestKind2Status `json:"status" yaml:"status"` } func (o *TestKind2) GetSpec() any { @@ -224,9 +224,9 @@ var _ resource.Object = &TestKind2{} // +k8s:openapi-gen=true type TestKind2List struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - Items []TestKind2 `json:"items"` + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []TestKind2 `json:"items" yaml:"items"` } func (o *TestKind2List) DeepCopyObject() runtime.Object { 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..80f4687c 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 @@ -3,5 +3,5 @@ package v1 // TestKind2Spec defines model for TestKind2Spec. // +k8s:openapi-gen=true type TestKind2Spec struct { - TestField string `json:"testField"` + TestField string `json:"testField" yaml:"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..13f16361 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 @@ -18,17 +18,17 @@ const ( // +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"` + DescriptiveState *string `json:"descriptiveState,omitempty" yaml:"descriptiveState,omitempty"` // details contains any extra information that is operator-specific - Details map[string]interface{} `json:"details,omitempty"` + Details map[string]interface{} `json:"details,omitempty" yaml:"details,omitempty"` // lastEvaluation is the ResourceVersion last evaluated - LastEvaluation string `json:"lastEvaluation"` + LastEvaluation string `json:"lastEvaluation" yaml:"lastEvaluation"` // state describes the state of the lastEvaluation. // It is limited to three possible states for machine evaluation. - State TestKind2OperatorStateState `json:"state"` + State TestKind2OperatorStateState `json:"state" yaml:"state"` } // TestKind2OperatorStateState state describes the state of the lastEvaluation. @@ -40,28 +40,28 @@ type TestKind2OperatorStateState string // +k8s:openapi-gen=true type TestKind2Status struct { // additionalFields is reserved for future use - AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"` + AdditionalFields map[string]interface{} `json:"additionalFields,omitempty" yaml:"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"` + OperatorStates map[string]TestKind2statusOperatorState `json:"operatorStates,omitempty" yaml:"operatorStates,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"` + DescriptiveState *string `json:"descriptiveState,omitempty" yaml:"descriptiveState,omitempty"` // details contains any extra information that is operator-specific - Details map[string]interface{} `json:"details,omitempty"` + Details map[string]interface{} `json:"details,omitempty" yaml:"details,omitempty"` // lastEvaluation is the ResourceVersion last evaluated - LastEvaluation string `json:"lastEvaluation"` + LastEvaluation string `json:"lastEvaluation" yaml:"lastEvaluation"` // state describes the state of the lastEvaluation. // It is limited to three possible states for machine evaluation. - State TestKind2statusOperatorStateState `json:"state"` + State TestKind2statusOperatorStateState `json:"state" yaml:"state"` } // TestKind2statusOperatorStateState state describes the state of the lastEvaluation. 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..ec9cfc10 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 @@ -6,27 +6,27 @@ import ( // TestKindMetadata defines model for TestKindMetadata. type TestKindMetadata struct { - 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"` + CreatedBy string `json:"createdBy" yaml:"createdBy"` + CreationTimestamp time.Time `json:"creationTimestamp" yaml:"creationTimestamp"` + DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty" yaml:"deletionTimestamp,omitempty"` + Finalizers []string `json:"finalizers" yaml:"finalizers"` + Generation int64 `json:"generation" yaml:"generation"` + Labels map[string]string `json:"labels" yaml:"labels"` + ResourceVersion string `json:"resourceVersion" yaml:"resourceVersion"` + Uid string `json:"uid" yaml:"uid"` + UpdateTimestamp time.Time `json:"updateTimestamp" yaml:"updateTimestamp"` + UpdatedBy string `json:"updatedBy" yaml:"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"` - Generation int64 `json:"generation"` - Labels map[string]string `json:"labels"` - ResourceVersion string `json:"resourceVersion"` - Uid string `json:"uid"` + CreationTimestamp time.Time `json:"creationTimestamp" yaml:"creationTimestamp"` + DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty" yaml:"deletionTimestamp,omitempty"` + Finalizers []string `json:"finalizers" yaml:"finalizers"` + Generation int64 `json:"generation" yaml:"generation"` + Labels map[string]string `json:"labels" yaml:"labels"` + ResourceVersion string `json:"resourceVersion" yaml:"resourceVersion"` + Uid string `json:"uid" yaml:"uid"` } diff --git a/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind_object_gen.go.txt b/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind_object_gen.go.txt index e01a8c65..3669a682 100644 --- a/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind_object_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbygroup/test/v1/testkind_object_gen.go.txt @@ -16,10 +16,10 @@ import ( // +k8s:openapi-gen=true type TestKind struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - Spec TestKindSpec `json:"spec"` - TestKindStatus TestKindStatus `json:"status"` + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec TestKindSpec `json:"spec" yaml:"spec"` + TestKindStatus TestKindStatus `json:"status" yaml:"status"` } func (o *TestKind) GetSpec() any { @@ -224,9 +224,9 @@ var _ resource.Object = &TestKind{} // +k8s:openapi-gen=true type TestKindList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - Items []TestKind `json:"items"` + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []TestKind `json:"items" yaml:"items"` } func (o *TestKindList) DeepCopyObject() runtime.Object { 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..a27f653a 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 @@ -3,5 +3,5 @@ package v1 // TestKindSpec defines model for TestKindSpec. // +k8s:openapi-gen=true type TestKindSpec struct { - StringField string `json:"stringField"` + StringField string `json:"stringField" yaml:"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..bfb4fdc3 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 @@ -18,17 +18,17 @@ const ( // +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"` + DescriptiveState *string `json:"descriptiveState,omitempty" yaml:"descriptiveState,omitempty"` // details contains any extra information that is operator-specific - Details map[string]interface{} `json:"details,omitempty"` + Details map[string]interface{} `json:"details,omitempty" yaml:"details,omitempty"` // lastEvaluation is the ResourceVersion last evaluated - LastEvaluation string `json:"lastEvaluation"` + LastEvaluation string `json:"lastEvaluation" yaml:"lastEvaluation"` // state describes the state of the lastEvaluation. // It is limited to three possible states for machine evaluation. - State TestKindOperatorStateState `json:"state"` + State TestKindOperatorStateState `json:"state" yaml:"state"` } // TestKindOperatorStateState state describes the state of the lastEvaluation. @@ -40,28 +40,28 @@ type TestKindOperatorStateState string // +k8s:openapi-gen=true type TestKindStatus struct { // additionalFields is reserved for future use - AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"` + AdditionalFields map[string]interface{} `json:"additionalFields,omitempty" yaml:"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"` + OperatorStates map[string]TestKindstatusOperatorState `json:"operatorStates,omitempty" yaml:"operatorStates,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"` + DescriptiveState *string `json:"descriptiveState,omitempty" yaml:"descriptiveState,omitempty"` // details contains any extra information that is operator-specific - Details map[string]interface{} `json:"details,omitempty"` + Details map[string]interface{} `json:"details,omitempty" yaml:"details,omitempty"` // lastEvaluation is the ResourceVersion last evaluated - LastEvaluation string `json:"lastEvaluation"` + LastEvaluation string `json:"lastEvaluation" yaml:"lastEvaluation"` // state describes the state of the lastEvaluation. // It is limited to three possible states for machine evaluation. - State TestKindstatusOperatorStateState `json:"state"` + State TestKindstatusOperatorStateState `json:"state" yaml:"state"` } // TestKindstatusOperatorStateState state describes the state of the lastEvaluation. 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..850682ff 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 @@ -6,27 +6,27 @@ import ( // TestKindMetadata defines model for TestKindMetadata. type TestKindMetadata struct { - 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"` + CreatedBy string `json:"createdBy" yaml:"createdBy"` + CreationTimestamp time.Time `json:"creationTimestamp" yaml:"creationTimestamp"` + DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty" yaml:"deletionTimestamp,omitempty"` + Finalizers []string `json:"finalizers" yaml:"finalizers"` + Generation int64 `json:"generation" yaml:"generation"` + Labels map[string]string `json:"labels" yaml:"labels"` + ResourceVersion string `json:"resourceVersion" yaml:"resourceVersion"` + Uid string `json:"uid" yaml:"uid"` + UpdateTimestamp time.Time `json:"updateTimestamp" yaml:"updateTimestamp"` + UpdatedBy string `json:"updatedBy" yaml:"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"` - Generation int64 `json:"generation"` - Labels map[string]string `json:"labels"` - ResourceVersion string `json:"resourceVersion"` - Uid string `json:"uid"` + CreationTimestamp time.Time `json:"creationTimestamp" yaml:"creationTimestamp"` + DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty" yaml:"deletionTimestamp,omitempty"` + Finalizers []string `json:"finalizers" yaml:"finalizers"` + Generation int64 `json:"generation" yaml:"generation"` + Labels map[string]string `json:"labels" yaml:"labels"` + ResourceVersion string `json:"resourceVersion" yaml:"resourceVersion"` + Uid string `json:"uid" yaml:"uid"` } diff --git a/codegen/testing/golden_generated/go/groupbygroup/test/v2/testkind_object_gen.go.txt b/codegen/testing/golden_generated/go/groupbygroup/test/v2/testkind_object_gen.go.txt index 4cce10e2..ec6f1c2e 100644 --- a/codegen/testing/golden_generated/go/groupbygroup/test/v2/testkind_object_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbygroup/test/v2/testkind_object_gen.go.txt @@ -16,10 +16,10 @@ import ( // +k8s:openapi-gen=true type TestKind struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - Spec TestKindSpec `json:"spec"` - TestKindStatus TestKindStatus `json:"status"` + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec TestKindSpec `json:"spec" yaml:"spec"` + TestKindStatus TestKindStatus `json:"status" yaml:"status"` } func (o *TestKind) GetSpec() any { @@ -224,9 +224,9 @@ var _ resource.Object = &TestKind{} // +k8s:openapi-gen=true type TestKindList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - Items []TestKind `json:"items"` + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []TestKind `json:"items" yaml:"items"` } func (o *TestKindList) DeepCopyObject() runtime.Object { 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..506c5fc8 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 @@ -7,7 +7,7 @@ import ( // TestKindSpec defines model for TestKindSpec. // +k8s:openapi-gen=true type TestKindSpec struct { - IntField int64 `json:"intField"` - StringField string `json:"stringField"` - TimeField time.Time `json:"timeField"` + IntField int64 `json:"intField" yaml:"intField"` + StringField string `json:"stringField" yaml:"stringField"` + TimeField time.Time `json:"timeField" yaml:"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..cb17d161 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 @@ -18,17 +18,17 @@ const ( // +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"` + DescriptiveState *string `json:"descriptiveState,omitempty" yaml:"descriptiveState,omitempty"` // details contains any extra information that is operator-specific - Details map[string]interface{} `json:"details,omitempty"` + Details map[string]interface{} `json:"details,omitempty" yaml:"details,omitempty"` // lastEvaluation is the ResourceVersion last evaluated - LastEvaluation string `json:"lastEvaluation"` + LastEvaluation string `json:"lastEvaluation" yaml:"lastEvaluation"` // state describes the state of the lastEvaluation. // It is limited to three possible states for machine evaluation. - State TestKindOperatorStateState `json:"state"` + State TestKindOperatorStateState `json:"state" yaml:"state"` } // TestKindOperatorStateState state describes the state of the lastEvaluation. @@ -40,28 +40,28 @@ type TestKindOperatorStateState string // +k8s:openapi-gen=true type TestKindStatus struct { // additionalFields is reserved for future use - AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"` + AdditionalFields map[string]interface{} `json:"additionalFields,omitempty" yaml:"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"` + OperatorStates map[string]TestKindstatusOperatorState `json:"operatorStates,omitempty" yaml:"operatorStates,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"` + DescriptiveState *string `json:"descriptiveState,omitempty" yaml:"descriptiveState,omitempty"` // details contains any extra information that is operator-specific - Details map[string]interface{} `json:"details,omitempty"` + Details map[string]interface{} `json:"details,omitempty" yaml:"details,omitempty"` // lastEvaluation is the ResourceVersion last evaluated - LastEvaluation string `json:"lastEvaluation"` + LastEvaluation string `json:"lastEvaluation" yaml:"lastEvaluation"` // state describes the state of the lastEvaluation. // It is limited to three possible states for machine evaluation. - State TestKindstatusOperatorStateState `json:"state"` + State TestKindstatusOperatorStateState `json:"state" yaml:"state"` } // TestKindstatusOperatorStateState state describes the state of the lastEvaluation. 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..f8871993 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 @@ -6,27 +6,27 @@ import ( // Metadata defines model for Metadata. type Metadata struct { - 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"` + CreatedBy string `json:"createdBy" yaml:"createdBy"` + CreationTimestamp time.Time `json:"creationTimestamp" yaml:"creationTimestamp"` + DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty" yaml:"deletionTimestamp,omitempty"` + Finalizers []string `json:"finalizers" yaml:"finalizers"` + Generation int64 `json:"generation" yaml:"generation"` + Labels map[string]string `json:"labels" yaml:"labels"` + ResourceVersion string `json:"resourceVersion" yaml:"resourceVersion"` + Uid string `json:"uid" yaml:"uid"` + UpdateTimestamp time.Time `json:"updateTimestamp" yaml:"updateTimestamp"` + UpdatedBy string `json:"updatedBy" yaml:"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"` + CreationTimestamp time.Time `json:"creationTimestamp" yaml:"creationTimestamp"` + DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty" yaml:"deletionTimestamp,omitempty"` + Finalizers []string `json:"finalizers" yaml:"finalizers"` + Generation int64 `json:"generation" yaml:"generation"` + Labels map[string]string `json:"labels" yaml:"labels"` + ResourceVersion string `json:"resourceVersion" yaml:"resourceVersion"` + Uid string `json:"uid" yaml:"uid"` } diff --git a/codegen/testing/golden_generated/go/groupbykind/customkind/v0_0/customkind_object_gen.go.txt b/codegen/testing/golden_generated/go/groupbykind/customkind/v0_0/customkind_object_gen.go.txt index 20cd9721..44fd96b6 100644 --- a/codegen/testing/golden_generated/go/groupbykind/customkind/v0_0/customkind_object_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbykind/customkind/v0_0/customkind_object_gen.go.txt @@ -16,10 +16,10 @@ import ( // +k8s:openapi-gen=true type CustomKind struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - Spec Spec `json:"spec"` - Status Status `json:"status"` + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec Spec `json:"spec" yaml:"spec"` + Status Status `json:"status" yaml:"status"` } func (o *CustomKind) GetSpec() any { @@ -224,9 +224,9 @@ var _ resource.Object = &CustomKind{} // +k8s:openapi-gen=true type CustomKindList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - Items []CustomKind `json:"items"` + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []CustomKind `json:"items" yaml:"items"` } func (o *CustomKindList) DeepCopyObject() runtime.Object { 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..29ddbd4c 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 @@ -3,6 +3,6 @@ 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" yaml:"deprecatedField"` + Field1 string `json:"field1" yaml:"field1"` } 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..1d31c9c9 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 @@ -18,17 +18,17 @@ const ( // +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"` + DescriptiveState *string `json:"descriptiveState,omitempty" yaml:"descriptiveState,omitempty"` // details contains any extra information that is operator-specific - Details map[string]interface{} `json:"details,omitempty"` + Details map[string]interface{} `json:"details,omitempty" yaml:"details,omitempty"` // lastEvaluation is the ResourceVersion last evaluated - LastEvaluation string `json:"lastEvaluation"` + LastEvaluation string `json:"lastEvaluation" yaml:"lastEvaluation"` // state describes the state of the lastEvaluation. // It is limited to three possible states for machine evaluation. - State OperatorStateState `json:"state"` + State OperatorStateState `json:"state" yaml:"state"` } // OperatorStateState state describes the state of the lastEvaluation. @@ -40,28 +40,28 @@ type OperatorStateState string // +k8s:openapi-gen=true type Status struct { // additionalFields is reserved for future use - AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"` + AdditionalFields map[string]interface{} `json:"additionalFields,omitempty" yaml:"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"` + OperatorStates map[string]StatusOperatorState `json:"operatorStates,omitempty" yaml:"operatorStates,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"` + DescriptiveState *string `json:"descriptiveState,omitempty" yaml:"descriptiveState,omitempty"` // details contains any extra information that is operator-specific - Details map[string]interface{} `json:"details,omitempty"` + Details map[string]interface{} `json:"details,omitempty" yaml:"details,omitempty"` // lastEvaluation is the ResourceVersion last evaluated - LastEvaluation string `json:"lastEvaluation"` + LastEvaluation string `json:"lastEvaluation" yaml:"lastEvaluation"` // state describes the state of the lastEvaluation. // It is limited to three possible states for machine evaluation. - State StatusOperatorStateState `json:"state"` + State StatusOperatorStateState `json:"state" yaml:"state"` } // StatusOperatorStateState state describes the state of the lastEvaluation. 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..4d69906b 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 @@ -6,29 +6,29 @@ import ( // Metadata defines model for Metadata. 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"` + CreatedBy string `json:"createdBy" yaml:"createdBy"` + CreationTimestamp time.Time `json:"creationTimestamp" yaml:"creationTimestamp"` + CustomMetadataField string `json:"customMetadataField" yaml:"customMetadataField"` + DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty" yaml:"deletionTimestamp,omitempty"` + Finalizers []string `json:"finalizers" yaml:"finalizers"` + Generation int64 `json:"generation" yaml:"generation"` + Labels map[string]string `json:"labels" yaml:"labels"` + OtherMetadataField string `json:"otherMetadataField" yaml:"otherMetadataField"` + ResourceVersion string `json:"resourceVersion" yaml:"resourceVersion"` + Uid string `json:"uid" yaml:"uid"` + UpdateTimestamp time.Time `json:"updateTimestamp" yaml:"updateTimestamp"` + UpdatedBy string `json:"updatedBy" yaml:"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"` + CreationTimestamp time.Time `json:"creationTimestamp" yaml:"creationTimestamp"` + DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty" yaml:"deletionTimestamp,omitempty"` + Finalizers []string `json:"finalizers" yaml:"finalizers"` + Generation int64 `json:"generation" yaml:"generation"` + Labels map[string]string `json:"labels" yaml:"labels"` + ResourceVersion string `json:"resourceVersion" yaml:"resourceVersion"` + Uid string `json:"uid" yaml:"uid"` } diff --git a/codegen/testing/golden_generated/go/groupbykind/customkind/v1_0/customkind_object_gen.go.txt b/codegen/testing/golden_generated/go/groupbykind/customkind/v1_0/customkind_object_gen.go.txt index aa692257..fd327ed7 100644 --- a/codegen/testing/golden_generated/go/groupbykind/customkind/v1_0/customkind_object_gen.go.txt +++ b/codegen/testing/golden_generated/go/groupbykind/customkind/v1_0/customkind_object_gen.go.txt @@ -16,10 +16,10 @@ import ( // +k8s:openapi-gen=true type CustomKind struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - Spec Spec `json:"spec"` - Status Status `json:"status"` + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec Spec `json:"spec" yaml:"spec"` + Status Status `json:"status" yaml:"status"` } func (o *CustomKind) GetSpec() any { @@ -256,9 +256,9 @@ var _ resource.Object = &CustomKind{} // +k8s:openapi-gen=true type CustomKindList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - Items []CustomKind `json:"items"` + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []CustomKind `json:"items" yaml:"items"` } func (o *CustomKindList) DeepCopyObject() runtime.Object { 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..1a57cf9b 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 @@ -16,31 +16,31 @@ const ( // InnerObject1 defines model for InnerObject1. // +k8s:openapi-gen=true type InnerObject1 struct { - InnerField1 string `json:"innerField1"` - InnerField2 []string `json:"innerField2"` - InnerField3 []InnerObject2 `json:"innerField3"` + InnerField1 string `json:"innerField1" yaml:"innerField1"` + InnerField2 []string `json:"innerField2" yaml:"innerField2"` + InnerField3 []InnerObject2 `json:"innerField3" yaml:"innerField3"` } // InnerObject2 defines model for InnerObject2. // +k8s:openapi-gen=true type InnerObject2 struct { - Details map[string]interface{} `json:"details"` - Name string `json:"name"` + Details map[string]interface{} `json:"details" yaml:"details"` + Name string `json:"name" yaml:"name"` } // 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"` + BoolField bool `json:"boolField" yaml:"boolField"` + Enum SpecEnum `json:"enum" yaml:"enum"` + Field1 string `json:"field1" yaml:"field1"` + FloatField float64 `json:"floatField" yaml:"floatField"` + I32 int `json:"i32" yaml:"i32"` + I64 int `json:"i64" yaml:"i64"` + Inner InnerObject1 `json:"inner" yaml:"inner"` + Map map[string]Type2 `json:"map" yaml:"map"` + Timestamp time.Time `json:"timestamp" yaml:"timestamp"` + Union interface{} `json:"union" yaml:"union"` } // SpecEnum defines model for Spec.Enum. @@ -50,13 +50,13 @@ type SpecEnum string // Type1 defines model for Type1. // +k8s:openapi-gen=true type Type1 struct { - Group string `json:"group"` - Options []string `json:"options,omitempty"` + Group string `json:"group" yaml:"group"` + Options []string `json:"options,omitempty" yaml:"options,omitempty"` } // Type2 defines model for Type2. // +k8s:openapi-gen=true type Type2 struct { - Details map[string]interface{} `json:"details"` - Group string `json:"group"` + Details map[string]interface{} `json:"details" yaml:"details"` + Group string `json:"group" yaml:"group"` } 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..aba709cf 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 @@ -18,17 +18,17 @@ const ( // +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"` + DescriptiveState *string `json:"descriptiveState,omitempty" yaml:"descriptiveState,omitempty"` // details contains any extra information that is operator-specific - Details map[string]interface{} `json:"details,omitempty"` + Details map[string]interface{} `json:"details,omitempty" yaml:"details,omitempty"` // lastEvaluation is the ResourceVersion last evaluated - LastEvaluation string `json:"lastEvaluation"` + LastEvaluation string `json:"lastEvaluation" yaml:"lastEvaluation"` // state describes the state of the lastEvaluation. // It is limited to three possible states for machine evaluation. - State OperatorStateState `json:"state"` + State OperatorStateState `json:"state" yaml:"state"` } // OperatorStateState state describes the state of the lastEvaluation. @@ -40,29 +40,29 @@ type OperatorStateState string // +k8s:openapi-gen=true type Status struct { // additionalFields is reserved for future use - AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"` + AdditionalFields map[string]interface{} `json:"additionalFields,omitempty" yaml:"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"` - StatusField1 string `json:"statusField1"` + OperatorStates map[string]StatusOperatorState `json:"operatorStates,omitempty" yaml:"operatorStates,omitempty"` + StatusField1 string `json:"statusField1" yaml:"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"` + DescriptiveState *string `json:"descriptiveState,omitempty" yaml:"descriptiveState,omitempty"` // details contains any extra information that is operator-specific - Details map[string]interface{} `json:"details,omitempty"` + Details map[string]interface{} `json:"details,omitempty" yaml:"details,omitempty"` // lastEvaluation is the ResourceVersion last evaluated - LastEvaluation string `json:"lastEvaluation"` + LastEvaluation string `json:"lastEvaluation" yaml:"lastEvaluation"` // state describes the state of the lastEvaluation. // It is limited to three possible states for machine evaluation. - State StatusOperatorStateState `json:"state"` + State StatusOperatorStateState `json:"state" yaml:"state"` } // StatusOperatorStateState state describes the state of the lastEvaluation. diff --git a/codegen/testing/golden_generated/go/unversioned/customkind/customkind_lineage_gen.go.txt b/codegen/testing/golden_generated/go/unversioned/customkind/customkind_lineage_gen.go.txt index 90aa95b5..b9c97472 100644 --- a/codegen/testing/golden_generated/go/unversioned/customkind/customkind_lineage_gen.go.txt +++ b/codegen/testing/golden_generated/go/unversioned/customkind/customkind_lineage_gen.go.txt @@ -30,9 +30,9 @@ var LacunaResolver func(*LineageType, []thema.Lacuna) error = nil // and Object has extra fields for metadata (which necessarily cannot be rendered in the Lineage/Schema, // but must exist for the Object). This is essentially an "intermediate step" struct. type LineageType struct { - Spec Spec `json:"spec"` - Status Status `json:"status"` - Metadata Metadata `json:"metadata"` + Spec Spec `json:"spec" yaml:"spec"` + Status Status `json:"status" yaml:"status"` + Metadata Metadata `json:"metadata" yaml:"metadata"` } func init() { 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..907f8da9 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 @@ -6,29 +6,29 @@ import ( // Metadata defines model for Metadata. 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"` + CreatedBy string `json:"createdBy" yaml:"createdBy"` + CreationTimestamp time.Time `json:"creationTimestamp" yaml:"creationTimestamp"` + CustomMetadataField string `json:"customMetadataField" yaml:"customMetadataField"` + DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty" yaml:"deletionTimestamp,omitempty"` + Finalizers []string `json:"finalizers" yaml:"finalizers"` + Generation int64 `json:"generation" yaml:"generation"` + Labels map[string]string `json:"labels" yaml:"labels"` + OtherMetadataField string `json:"otherMetadataField" yaml:"otherMetadataField"` + ResourceVersion string `json:"resourceVersion" yaml:"resourceVersion"` + Uid string `json:"uid" yaml:"uid"` + UpdateTimestamp time.Time `json:"updateTimestamp" yaml:"updateTimestamp"` + UpdatedBy string `json:"updatedBy" yaml:"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"` + CreationTimestamp time.Time `json:"creationTimestamp" yaml:"creationTimestamp"` + DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty" yaml:"deletionTimestamp,omitempty"` + Finalizers []string `json:"finalizers" yaml:"finalizers"` + Generation int64 `json:"generation" yaml:"generation"` + Labels map[string]string `json:"labels" yaml:"labels"` + ResourceVersion string `json:"resourceVersion" yaml:"resourceVersion"` + Uid string `json:"uid" yaml:"uid"` } diff --git a/codegen/testing/golden_generated/go/unversioned/customkind/customkind_object_gen.go.txt b/codegen/testing/golden_generated/go/unversioned/customkind/customkind_object_gen.go.txt index 1ff25e7e..5789eec6 100644 --- a/codegen/testing/golden_generated/go/unversioned/customkind/customkind_object_gen.go.txt +++ b/codegen/testing/golden_generated/go/unversioned/customkind/customkind_object_gen.go.txt @@ -16,10 +16,10 @@ import ( // +k8s:openapi-gen=true type CustomKind struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - Spec Spec `json:"spec"` - Status Status `json:"status"` + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata" yaml:"metadata"` + Spec Spec `json:"spec" yaml:"spec"` + Status Status `json:"status" yaml:"status"` } func (o *CustomKind) GetSpec() any { @@ -256,9 +256,9 @@ var _ resource.Object = &CustomKind{} // +k8s:openapi-gen=true type CustomKindList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - Items []CustomKind `json:"items"` + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata" yaml:"metadata"` + Items []CustomKind `json:"items" yaml:"items"` } func (o *CustomKindList) DeepCopyObject() runtime.Object { 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..18385404 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 @@ -16,31 +16,31 @@ const ( // InnerObject1 defines model for InnerObject1. // +k8s:openapi-gen=true type InnerObject1 struct { - InnerField1 string `json:"innerField1"` - InnerField2 []string `json:"innerField2"` - InnerField3 []InnerObject2 `json:"innerField3"` + InnerField1 string `json:"innerField1" yaml:"innerField1"` + InnerField2 []string `json:"innerField2" yaml:"innerField2"` + InnerField3 []InnerObject2 `json:"innerField3" yaml:"innerField3"` } // InnerObject2 defines model for InnerObject2. // +k8s:openapi-gen=true type InnerObject2 struct { - Details map[string]interface{} `json:"details"` - Name string `json:"name"` + Details map[string]interface{} `json:"details" yaml:"details"` + Name string `json:"name" yaml:"name"` } // 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"` + BoolField bool `json:"boolField" yaml:"boolField"` + Enum SpecEnum `json:"enum" yaml:"enum"` + Field1 string `json:"field1" yaml:"field1"` + FloatField float64 `json:"floatField" yaml:"floatField"` + I32 int `json:"i32" yaml:"i32"` + I64 int `json:"i64" yaml:"i64"` + Inner InnerObject1 `json:"inner" yaml:"inner"` + Map map[string]Type2 `json:"map" yaml:"map"` + Timestamp time.Time `json:"timestamp" yaml:"timestamp"` + Union interface{} `json:"union" yaml:"union"` } // SpecEnum defines model for Spec.Enum. @@ -50,13 +50,13 @@ type SpecEnum string // Type1 defines model for Type1. // +k8s:openapi-gen=true type Type1 struct { - Group string `json:"group"` - Options []string `json:"options,omitempty"` + Group string `json:"group" yaml:"group"` + Options []string `json:"options,omitempty" yaml:"options,omitempty"` } // Type2 defines model for Type2. // +k8s:openapi-gen=true type Type2 struct { - Details map[string]interface{} `json:"details"` - Group string `json:"group"` + Details map[string]interface{} `json:"details" yaml:"details"` + Group string `json:"group" yaml:"group"` } 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..944d4854 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 @@ -18,17 +18,17 @@ const ( // +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"` + DescriptiveState *string `json:"descriptiveState,omitempty" yaml:"descriptiveState,omitempty"` // details contains any extra information that is operator-specific - Details map[string]interface{} `json:"details,omitempty"` + Details map[string]interface{} `json:"details,omitempty" yaml:"details,omitempty"` // lastEvaluation is the ResourceVersion last evaluated - LastEvaluation string `json:"lastEvaluation"` + LastEvaluation string `json:"lastEvaluation" yaml:"lastEvaluation"` // state describes the state of the lastEvaluation. // It is limited to three possible states for machine evaluation. - State OperatorStateState `json:"state"` + State OperatorStateState `json:"state" yaml:"state"` } // OperatorStateState state describes the state of the lastEvaluation. @@ -40,29 +40,29 @@ type OperatorStateState string // +k8s:openapi-gen=true type Status struct { // additionalFields is reserved for future use - AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"` + AdditionalFields map[string]interface{} `json:"additionalFields,omitempty" yaml:"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"` - StatusField1 string `json:"statusField1"` + OperatorStates map[string]StatusOperatorState `json:"operatorStates,omitempty" yaml:"operatorStates,omitempty"` + StatusField1 string `json:"statusField1" yaml:"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"` + DescriptiveState *string `json:"descriptiveState,omitempty" yaml:"descriptiveState,omitempty"` // details contains any extra information that is operator-specific - Details map[string]interface{} `json:"details,omitempty"` + Details map[string]interface{} `json:"details,omitempty" yaml:"details,omitempty"` // lastEvaluation is the ResourceVersion last evaluated - LastEvaluation string `json:"lastEvaluation"` + LastEvaluation string `json:"lastEvaluation" yaml:"lastEvaluation"` // state describes the state of the lastEvaluation. // It is limited to three possible states for machine evaluation. - State StatusOperatorStateState `json:"state"` + State StatusOperatorStateState `json:"state" yaml:"state"` } // StatusOperatorStateState state describes the state of the lastEvaluation. 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..ffd6df28 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 @@ -15,16 +15,16 @@ const ( // 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"` + BoolField bool `json:"boolField" yaml:"boolField"` + Enum CustomKind2Enum `json:"enum" yaml:"enum"` + Field1 string `json:"field1" yaml:"field1"` + FloatField float64 `json:"floatField" yaml:"floatField"` + I32 int `json:"i32" yaml:"i32"` + I64 int `json:"i64" yaml:"i64"` + Inner InnerObject1 `json:"inner" yaml:"inner"` + Map map[string]Type2 `json:"map" yaml:"map"` + Timestamp time.Time `json:"timestamp" yaml:"timestamp"` + Union interface{} `json:"union" yaml:"union"` } // CustomKind2Enum defines model for CustomKind2.Enum. @@ -32,25 +32,25 @@ type CustomKind2Enum string // InnerObject1 defines model for InnerObject1. type InnerObject1 struct { - InnerField1 string `json:"innerField1"` - InnerField2 []string `json:"innerField2"` - InnerField3 []InnerObject2 `json:"innerField3"` + InnerField1 string `json:"innerField1" yaml:"innerField1"` + InnerField2 []string `json:"innerField2" yaml:"innerField2"` + InnerField3 []InnerObject2 `json:"innerField3" yaml:"innerField3"` } // InnerObject2 defines model for InnerObject2. type InnerObject2 struct { - Details map[string]interface{} `json:"details"` - Name string `json:"name"` + Details map[string]interface{} `json:"details" yaml:"details"` + Name string `json:"name" yaml:"name"` } // Type1 defines model for Type1. type Type1 struct { - Group string `json:"group"` - Options []string `json:"options,omitempty"` + Group string `json:"group" yaml:"group"` + Options []string `json:"options,omitempty" yaml:"options,omitempty"` } // Type2 defines model for Type2. type Type2 struct { - Details map[string]interface{} `json:"details"` - Group string `json:"group"` + Details map[string]interface{} `json:"details" yaml:"details"` + Group string `json:"group" yaml:"group"` } diff --git a/go.work.sum b/go.work.sum index a043477c..78e46d08 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1036,16 +1036,19 @@ go.opentelemetry.io/contrib/samplers/jaegerremote v0.18.0/go.mod h1:tjp49JHNvreA go.opentelemetry.io/otel v1.23.0/go.mod h1:YCycw9ZeKhcJFrb34iVSkyT0iczq/zYDtZYFufObyB0= go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ= go.opentelemetry.io/otel/metric v1.23.0/go.mod h1:MqUW2X2a6Q8RN96E2/nqNoT+z9BSms20Jb7Bbp+HiTo= go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= go.opentelemetry.io/otel/trace v1.23.0/go.mod h1:GSGTbIClEsuZrGIzoEHqsVfxgn5UkggkflQwDScNUsk= go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= @@ -1068,6 +1071,8 @@ golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= +golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= +golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= @@ -1101,6 +1106,7 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1127,6 +1133,7 @@ golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1164,6 +1171,7 @@ google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157/go. google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117/go.mod h1:OimBR/bc1wPO9iV4NC2bpyjy3VnAwZh5EBPQdtaE5oo= google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= +google.golang.org/genproto/googleapis/api v0.0.0-20241021214115-324edc3d5d38/go.mod h1:vuAjtvlwkDKF6L1GQ0SokiRLCGFfeBUXWr/aFFkHACc= google.golang.org/genproto/googleapis/bytestream v0.0.0-20240304161311-37d4d3c04a78 h1:YqFWYZXim8bG9v68xU8WjTZmYKb5M5dMeSOWIp6jogI= google.golang.org/genproto/googleapis/bytestream v0.0.0-20240304161311-37d4d3c04a78/go.mod h1:vh/N7795ftP0AkN1w8XKqN4w1OdUKXW5Eummda+ofv8= google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= @@ -1176,6 +1184,7 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go. google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241021214115-324edc3d5d38/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.18.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= @@ -1223,6 +1232,8 @@ k8s.io/apiserver v0.31.1 h1:Sars5ejQDCRBY5f7R3QFHdqN3s61nhkpaX8/k1iEw1c= k8s.io/apiserver v0.31.1/go.mod h1:lzDhpeToamVZJmmFlaLwdYZwd7zB+WYRYIboqA1kGxM= k8s.io/apiserver v0.31.2 h1:VUzOEUGRCDi6kX1OyQ801m4A7AUPglpsmGvdsekmcI4= k8s.io/apiserver v0.31.2/go.mod h1:o3nKZR7lPlJqkU5I3Ove+Zx3JuoFjQobGX1Gctw6XuE= +k8s.io/apiserver v0.31.3 h1:+1oHTtCB+OheqFEz375D0IlzHZ5VeQKX1KGXnx+TTuY= +k8s.io/apiserver v0.31.3/go.mod h1:PrxVbebxrxQPFhJk4powDISIROkNMKHibTg9lTRQ0Qg= k8s.io/code-generator v0.30.3 h1:bmtnLJKagDS5f5uOEpLyJiDfIMKXGMKgOLBdde+w0Mc= k8s.io/code-generator v0.30.3/go.mod h1:PFgBiv+miFV7TZYp+RXgROkhA+sWYZ+mtpbMLofMke8= k8s.io/code-generator v0.31.0 h1:w607nrMi1KeDKB3/F/J4lIoOgAwc+gV9ZKew4XRfMp8= @@ -1231,6 +1242,8 @@ k8s.io/code-generator v0.31.1 h1:GvkRZEP2g2UnB2QKT2Dgc/kYxIkDxCHENv2Q1itioVs= k8s.io/code-generator v0.31.1/go.mod h1:oL2ky46L48osNqqZAeOcWWy0S5BXj50vVdwOtTefqIs= k8s.io/code-generator v0.31.2 h1:xLWxG0HEpMSHfcM//3u3Ro2Hmc6AyyLINQS//Z2GEOI= k8s.io/code-generator v0.31.2/go.mod h1:eEQHXgBU/m7LDaToDoiz3t97dUUVyOblQdwOr8rivqc= +k8s.io/code-generator v0.31.3 h1:Pj0fYOBms+ZrsulLi4DMsCEx1jG8fWKRLy44onHsLBI= +k8s.io/code-generator v0.31.3/go.mod h1:/umCIlT84g1+Yu5ZXtP1KGSRTnGiIzzX5AzUAxsNlts= k8s.io/component-base v0.30.3 h1:Ci0UqKWf4oiwy8hr1+E3dsnliKnkMLZMVbWzeorlk7s= k8s.io/component-base v0.30.3/go.mod h1:C1SshT3rGPCuNtBs14RmVD2xW0EhRSeLvBh7AGk1quA= k8s.io/component-base v0.31.0 h1:/KIzGM5EvPNQcYgwq5NwoQBaOlVFrghoVGr8lG6vNRs= @@ -1239,6 +1252,8 @@ k8s.io/component-base v0.31.1 h1:UpOepcrX3rQ3ab5NB6g5iP0tvsgJWzxTyAo20sgYSy8= k8s.io/component-base v0.31.1/go.mod h1:WGeaw7t/kTsqpVTaCoVEtillbqAhF2/JgvO0LDOMa0w= k8s.io/component-base v0.31.2 h1:Z1J1LIaC0AV+nzcPRFqfK09af6bZ4D1nAOpWsy9owlA= k8s.io/component-base v0.31.2/go.mod h1:9PeyyFN/drHjtJZMCTkSpQJS3U9OXORnHQqMLDz0sUQ= +k8s.io/component-base v0.31.3 h1:DMCXXVx546Rfvhj+3cOm2EUxhS+EyztH423j+8sOwhQ= +k8s.io/component-base v0.31.3/go.mod h1:xME6BHfUOafRgT0rGVBGl7TuSg8Z9/deT7qq6w7qjIU= k8s.io/kms v0.30.3 h1:NLg+oN45S2Y3U0WiLRzbS61AY/XrS5JBMZp531Z+Pho= k8s.io/kms v0.30.3/go.mod h1:GrMurD0qk3G4yNgGcsCEmepqf9KyyIrTXYR2lyUOJC4= k8s.io/kms v0.31.0 h1:KchILPfB1ZE+ka7223mpU5zeFNkmb45jl7RHnlImUaI= @@ -1247,6 +1262,8 @@ k8s.io/kms v0.31.1 h1:cGLyV3cIwb0ovpP/jtyIe2mEuQ/MkbhmeBF2IYCA9Io= k8s.io/kms v0.31.1/go.mod h1:OZKwl1fan3n3N5FFxnW5C4V3ygrah/3YXeJWS3O6+94= k8s.io/kms v0.31.2 h1:pyx7l2qVOkClzFMIWMVF/FxsSkgd+OIGH7DecpbscJI= k8s.io/kms v0.31.2/go.mod h1:OZKwl1fan3n3N5FFxnW5C4V3ygrah/3YXeJWS3O6+94= +k8s.io/kms v0.31.3 h1:XCFmiJn5CCKs8xoOLpCmu42Ubm/KW85wNHybGFcSAYc= +k8s.io/kms v0.31.3/go.mod h1:OZKwl1fan3n3N5FFxnW5C4V3ygrah/3YXeJWS3O6+94= lukechampine.com/uint128 v1.3.0 h1:cDdUVfRwDUDovz610ABgFD17nXD4/uDgVHl2sC3+sbo= lukechampine.com/uint128 v1.3.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw= diff --git a/internal/deepmap/oapi-codegen/pkg/codegen/codegen_test.go b/internal/deepmap/oapi-codegen/pkg/codegen/codegen_test.go index bac664ea..ca6ba221 100644 --- a/internal/deepmap/oapi-codegen/pkg/codegen/codegen_test.go +++ b/internal/deepmap/oapi-codegen/pkg/codegen/codegen_test.go @@ -74,10 +74,10 @@ type GetTestByNameResponse struct { // Check the client method signatures: assert.Contains(t, code, "type GetTestByNameParams struct {") - assert.Contains(t, code, "Top *int `form:\"$top,omitempty\" json:\"$top,omitempty\"`") + assert.Contains(t, code, "Top *int `form:\"$top,omitempty\" json:\"$top,omitempty\" yaml:\"$top,omitempty\"`") assert.Contains(t, code, "func (c *Client) GetTestByName(ctx context.Context, name string, params *GetTestByNameParams, reqEditors ...RequestEditorFn) (*http.Response, error) {") assert.Contains(t, code, "func (c *ClientWithResponses) GetTestByNameWithResponse(ctx context.Context, name string, params *GetTestByNameParams, reqEditors ...RequestEditorFn) (*GetTestByNameResponse, error) {") - assert.Contains(t, code, "DeadSince *time.Time `json:\"dead_since,omitempty\" tag1:\"value1\" tag2:\"value2\"`") + assert.Contains(t, code, "DeadSince *time.Time `json:\"dead_since,omitempty\" tag1:\"value1\" tag2:\"value2\" yaml:\"dead_since,omitempty\"`") assert.Contains(t, code, "type EnumTestNumerics int") assert.Contains(t, code, "N2 EnumTestNumerics = 2") assert.Contains(t, code, "type EnumTestEnumNames int") @@ -110,17 +110,17 @@ func TestExtPropGoTypeSkipOptionalPointer(t *testing.T) { assert.NoError(t, err) // Check that optional pointer fields are skipped if requested - assert.Contains(t, code, "NullableFieldSkipFalse *string `json:\"nullableFieldSkipFalse\"`") - assert.Contains(t, code, "NullableFieldSkipTrue string `json:\"nullableFieldSkipTrue\"`") - assert.Contains(t, code, "OptionalField *string `json:\"optionalField,omitempty\"`") - assert.Contains(t, code, "OptionalFieldSkipFalse *string `json:\"optionalFieldSkipFalse,omitempty\"`") - assert.Contains(t, code, "OptionalFieldSkipTrue string `json:\"optionalFieldSkipTrue,omitempty\"`") + assert.Contains(t, code, "NullableFieldSkipFalse *string `json:\"nullableFieldSkipFalse\" yaml:\"nullableFieldSkipFalse\"`") + assert.Contains(t, code, "NullableFieldSkipTrue string `json:\"nullableFieldSkipTrue\" yaml:\"nullableFieldSkipTrue\"`") + assert.Contains(t, code, "OptionalField *string `json:\"optionalField,omitempty\" yaml:\"optionalField,omitempty\"`") + assert.Contains(t, code, "OptionalFieldSkipFalse *string `json:\"optionalFieldSkipFalse,omitempty\" yaml:\"optionalFieldSkipFalse,omitempty\"`") + assert.Contains(t, code, "OptionalFieldSkipTrue string `json:\"optionalFieldSkipTrue,omitempty\" yaml:\"optionalFieldSkipTrue,omitempty\"`") // Check that the extension applies on custom types as well - assert.Contains(t, code, "CustomTypeWithSkipTrue string `json:\"customTypeWithSkipTrue,omitempty\"`") + assert.Contains(t, code, "CustomTypeWithSkipTrue string `json:\"customTypeWithSkipTrue,omitempty\" yaml:\"customTypeWithSkipTrue,omitempty\"`") // Check that the extension has no effect on required fields - assert.Contains(t, code, "RequiredField string `json:\"requiredField\"`") + assert.Contains(t, code, "RequiredField string `json:\"requiredField\" yaml:\"requiredField\"`") } func TestGoTypeImport(t *testing.T) { diff --git a/internal/deepmap/oapi-codegen/pkg/codegen/schema.go b/internal/deepmap/oapi-codegen/pkg/codegen/schema.go index 8d5ec407..047b8a30 100644 --- a/internal/deepmap/oapi-codegen/pkg/codegen/schema.go +++ b/internal/deepmap/oapi-codegen/pkg/codegen/schema.go @@ -716,11 +716,13 @@ func GenFieldsFromProperties(props []Property) []string { if !omitEmpty { fieldTags["json"] = p.JsonFieldName + fieldTags["yaml"] = p.JsonFieldName if p.NeedsFormTag { fieldTags["form"] = p.JsonFieldName } } else { fieldTags["json"] = p.JsonFieldName + ",omitempty" + fieldTags["yaml"] = p.JsonFieldName + ",omitempty" if p.NeedsFormTag { fieldTags["form"] = p.JsonFieldName + ",omitempty" }