code-generator/examples: fix json tags

Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
This commit is contained in:
Dr. Stefan Schimanski 2024-06-04 11:50:23 -04:00
parent be2cf7e4d9
commit 676d989713
No known key found for this signature in database
GPG Key ID: 4C68E0F19F95EC33
13 changed files with 39 additions and 25 deletions

View File

@ -43,16 +43,16 @@ type TestTypeList struct {
}
type TestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ClusterTestTypeList struct {
metav1.TypeMeta
metav1.ListMeta
Items []ClusterTestType
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ClusterTestType `json:"items"`
}
// +genclient
@ -70,5 +70,5 @@ type ClusterTestType struct {
}
type ClusterTestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}

View File

@ -43,16 +43,17 @@ type TestTypeList struct {
}
type TestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ClusterTestTypeList struct {
metav1.TypeMeta
metav1.ListMeta
Items []ClusterTestType
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ListMeta `json:"metadata,omitempty"`
Items []ClusterTestType `json:"items"`
}
// +genclient
@ -71,5 +72,5 @@ type ClusterTestType struct {
}
type ClusterTestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}

View File

@ -24,7 +24,9 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// TestType is a top-level type. A client is created for it.
type TestType struct {
metav1.TypeMeta
// +optional
metav1.ObjectMeta
// +optional
Status TestTypeStatus
}
@ -34,6 +36,7 @@ type TestType struct {
// You are not supposed to create a separated client for this one.
type TestTypeList struct {
metav1.TypeMeta
// +optional
metav1.ListMeta
Items []TestType

View File

@ -43,5 +43,5 @@ type TestTypeList struct {
}
type TestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}

View File

@ -24,7 +24,9 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// TestType is a top-level type. A client is created for it.
type TestType struct {
metav1.TypeMeta
// +optional
metav1.ObjectMeta
// +optional
Status TestTypeStatus
}
@ -34,6 +36,7 @@ type TestType struct {
// You are not supposed to create a separated client for this one.
type TestTypeList struct {
metav1.TypeMeta
// +optional
metav1.ListMeta
Items []TestType

View File

@ -43,5 +43,5 @@ type TestTypeList struct {
}
type TestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}

View File

@ -21,6 +21,7 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +genclient:nonNamespaced
//
// TestType is a top-level type. A client is created for it.
type TestType struct {
metav1.TypeMeta

View File

@ -43,5 +43,5 @@ type TestTypeList struct {
}
type TestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}

View File

@ -24,7 +24,9 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// TestType is a top-level type. A client is created for it.
type TestType struct {
metav1.TypeMeta
// +optional
metav1.ObjectMeta
// +optional
Status TestTypeStatus
}
@ -34,6 +36,7 @@ type TestType struct {
// You are not supposed to create a separated client for this one.
type TestTypeList struct {
metav1.TypeMeta
// +optional
metav1.ListMeta
Items []TestType

View File

@ -43,5 +43,5 @@ type TestTypeList struct {
}
type TestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}

View File

@ -44,16 +44,18 @@ type TestTypeList struct {
}
type TestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ClusterTestTypeList struct {
metav1.TypeMeta
metav1.ListMeta
Items []ClusterTestType
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ListMeta `json:"metadata,omitempty"`
Items []ClusterTestType `json:"items"`
}
// +genclient
@ -71,5 +73,5 @@ type ClusterTestType struct {
}
type ClusterTestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}

View File

@ -43,5 +43,5 @@ type TestTypeList struct {
}
type TestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}

View File

@ -43,16 +43,17 @@ type TestTypeList struct {
}
type TestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ClusterTestTypeList struct {
metav1.TypeMeta
metav1.ListMeta
Items []ClusterTestType
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ListMeta `json:"metadata,omitempty"`
Items []ClusterTestType `json:"items"`
}
// +genclient
@ -70,5 +71,5 @@ type ClusterTestType struct {
}
type ClusterTestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}