code-generator/examples: fix json tags
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
This commit is contained in:
		| @@ -43,16 +43,16 @@ type TestTypeList struct { | |||||||
| } | } | ||||||
|  |  | ||||||
| type TestTypeStatus struct { | type TestTypeStatus struct { | ||||||
| 	Blah string | 	Blah string `json:"blah"` | ||||||
| } | } | ||||||
|  |  | ||||||
| // +genclient:nonNamespaced | // +genclient:nonNamespaced | ||||||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||||||
|  |  | ||||||
| type ClusterTestTypeList struct { | type ClusterTestTypeList struct { | ||||||
| 	metav1.TypeMeta | 	metav1.TypeMeta `json:",inline"` | ||||||
| 	metav1.ListMeta | 	metav1.ListMeta `json:"metadata,omitempty"` | ||||||
| 	Items []ClusterTestType | 	Items           []ClusterTestType `json:"items"` | ||||||
| } | } | ||||||
|  |  | ||||||
| // +genclient | // +genclient | ||||||
| @@ -70,5 +70,5 @@ type ClusterTestType struct { | |||||||
| } | } | ||||||
|  |  | ||||||
| type ClusterTestTypeStatus struct { | type ClusterTestTypeStatus struct { | ||||||
| 	Blah string | 	Blah string `json:"blah"` | ||||||
| } | } | ||||||
|   | |||||||
| @@ -43,16 +43,17 @@ type TestTypeList struct { | |||||||
| } | } | ||||||
|  |  | ||||||
| type TestTypeStatus struct { | type TestTypeStatus struct { | ||||||
| 	Blah string | 	Blah string `json:"blah"` | ||||||
| } | } | ||||||
|  |  | ||||||
| // +genclient:nonNamespaced | // +genclient:nonNamespaced | ||||||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||||||
|  |  | ||||||
| type ClusterTestTypeList struct { | type ClusterTestTypeList struct { | ||||||
| 	metav1.TypeMeta | 	metav1.TypeMeta `json:",inline"` | ||||||
| 	metav1.ListMeta | 	// +optional | ||||||
| 	Items []ClusterTestType | 	metav1.ListMeta `json:"metadata,omitempty"` | ||||||
|  | 	Items           []ClusterTestType `json:"items"` | ||||||
| } | } | ||||||
|  |  | ||||||
| // +genclient | // +genclient | ||||||
| @@ -71,5 +72,5 @@ type ClusterTestType struct { | |||||||
| } | } | ||||||
|  |  | ||||||
| type ClusterTestTypeStatus struct { | type ClusterTestTypeStatus struct { | ||||||
| 	Blah string | 	Blah string `json:"blah"` | ||||||
| } | } | ||||||
|   | |||||||
| @@ -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. | // TestType is a top-level type. A client is created for it. | ||||||
| type TestType struct { | type TestType struct { | ||||||
| 	metav1.TypeMeta | 	metav1.TypeMeta | ||||||
|  | 	// +optional | ||||||
| 	metav1.ObjectMeta | 	metav1.ObjectMeta | ||||||
|  | 	// +optional | ||||||
| 	Status TestTypeStatus | 	Status TestTypeStatus | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -34,6 +36,7 @@ type TestType struct { | |||||||
| // You are not supposed to create a separated client for this one. | // You are not supposed to create a separated client for this one. | ||||||
| type TestTypeList struct { | type TestTypeList struct { | ||||||
| 	metav1.TypeMeta | 	metav1.TypeMeta | ||||||
|  | 	// +optional | ||||||
| 	metav1.ListMeta | 	metav1.ListMeta | ||||||
|  |  | ||||||
| 	Items []TestType | 	Items []TestType | ||||||
|   | |||||||
| @@ -43,5 +43,5 @@ type TestTypeList struct { | |||||||
| } | } | ||||||
|  |  | ||||||
| type TestTypeStatus struct { | type TestTypeStatus struct { | ||||||
| 	Blah string | 	Blah string `json:"blah"` | ||||||
| } | } | ||||||
|   | |||||||
| @@ -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. | // TestType is a top-level type. A client is created for it. | ||||||
| type TestType struct { | type TestType struct { | ||||||
| 	metav1.TypeMeta | 	metav1.TypeMeta | ||||||
|  | 	// +optional | ||||||
| 	metav1.ObjectMeta | 	metav1.ObjectMeta | ||||||
|  | 	// +optional | ||||||
| 	Status TestTypeStatus | 	Status TestTypeStatus | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -34,6 +36,7 @@ type TestType struct { | |||||||
| // You are not supposed to create a separated client for this one. | // You are not supposed to create a separated client for this one. | ||||||
| type TestTypeList struct { | type TestTypeList struct { | ||||||
| 	metav1.TypeMeta | 	metav1.TypeMeta | ||||||
|  | 	// +optional | ||||||
| 	metav1.ListMeta | 	metav1.ListMeta | ||||||
|  |  | ||||||
| 	Items []TestType | 	Items []TestType | ||||||
|   | |||||||
| @@ -43,5 +43,5 @@ type TestTypeList struct { | |||||||
| } | } | ||||||
|  |  | ||||||
| type TestTypeStatus struct { | type TestTypeStatus struct { | ||||||
| 	Blah string | 	Blah string `json:"blah"` | ||||||
| } | } | ||||||
|   | |||||||
| @@ -21,6 +21,7 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||||
| // +genclient | // +genclient | ||||||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||||||
| // +genclient:nonNamespaced | // +genclient:nonNamespaced | ||||||
|  | // | ||||||
| // TestType is a top-level type. A client is created for it. | // TestType is a top-level type. A client is created for it. | ||||||
| type TestType struct { | type TestType struct { | ||||||
| 	metav1.TypeMeta | 	metav1.TypeMeta | ||||||
|   | |||||||
| @@ -43,5 +43,5 @@ type TestTypeList struct { | |||||||
| } | } | ||||||
|  |  | ||||||
| type TestTypeStatus struct { | type TestTypeStatus struct { | ||||||
| 	Blah string | 	Blah string `json:"blah"` | ||||||
| } | } | ||||||
|   | |||||||
| @@ -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. | // TestType is a top-level type. A client is created for it. | ||||||
| type TestType struct { | type TestType struct { | ||||||
| 	metav1.TypeMeta | 	metav1.TypeMeta | ||||||
|  | 	// +optional | ||||||
| 	metav1.ObjectMeta | 	metav1.ObjectMeta | ||||||
|  | 	// +optional | ||||||
| 	Status TestTypeStatus | 	Status TestTypeStatus | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -34,6 +36,7 @@ type TestType struct { | |||||||
| // You are not supposed to create a separated client for this one. | // You are not supposed to create a separated client for this one. | ||||||
| type TestTypeList struct { | type TestTypeList struct { | ||||||
| 	metav1.TypeMeta | 	metav1.TypeMeta | ||||||
|  | 	// +optional | ||||||
| 	metav1.ListMeta | 	metav1.ListMeta | ||||||
|  |  | ||||||
| 	Items []TestType | 	Items []TestType | ||||||
|   | |||||||
| @@ -43,5 +43,5 @@ type TestTypeList struct { | |||||||
| } | } | ||||||
|  |  | ||||||
| type TestTypeStatus struct { | type TestTypeStatus struct { | ||||||
| 	Blah string | 	Blah string `json:"blah"` | ||||||
| } | } | ||||||
|   | |||||||
| @@ -44,16 +44,18 @@ type TestTypeList struct { | |||||||
| } | } | ||||||
|  |  | ||||||
| type TestTypeStatus struct { | type TestTypeStatus struct { | ||||||
| 	Blah string | 	Blah string `json:"blah"` | ||||||
| } | } | ||||||
|  |  | ||||||
| // +genclient:nonNamespaced | // +genclient:nonNamespaced | ||||||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||||||
|  |  | ||||||
| type ClusterTestTypeList struct { | type ClusterTestTypeList struct { | ||||||
| 	metav1.TypeMeta | 	metav1.TypeMeta `json:",inline"` | ||||||
| 	metav1.ListMeta | 	// +optional | ||||||
| 	Items []ClusterTestType | 	metav1.ListMeta `json:"metadata,omitempty"` | ||||||
|  |  | ||||||
|  | 	Items []ClusterTestType `json:"items"` | ||||||
| } | } | ||||||
|  |  | ||||||
| // +genclient | // +genclient | ||||||
| @@ -71,5 +73,5 @@ type ClusterTestType struct { | |||||||
| } | } | ||||||
|  |  | ||||||
| type ClusterTestTypeStatus struct { | type ClusterTestTypeStatus struct { | ||||||
| 	Blah string | 	Blah string `json:"blah"` | ||||||
| } | } | ||||||
|   | |||||||
| @@ -43,5 +43,5 @@ type TestTypeList struct { | |||||||
| } | } | ||||||
|  |  | ||||||
| type TestTypeStatus struct { | type TestTypeStatus struct { | ||||||
| 	Blah string | 	Blah string `json:"blah"` | ||||||
| } | } | ||||||
|   | |||||||
| @@ -43,16 +43,17 @@ type TestTypeList struct { | |||||||
| } | } | ||||||
|  |  | ||||||
| type TestTypeStatus struct { | type TestTypeStatus struct { | ||||||
| 	Blah string | 	Blah string `json:"blah"` | ||||||
| } | } | ||||||
|  |  | ||||||
| // +genclient:nonNamespaced | // +genclient:nonNamespaced | ||||||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||||||
|  |  | ||||||
| type ClusterTestTypeList struct { | type ClusterTestTypeList struct { | ||||||
| 	metav1.TypeMeta | 	metav1.TypeMeta `json:",inline"` | ||||||
| 	metav1.ListMeta | 	// +optional | ||||||
| 	Items []ClusterTestType | 	metav1.ListMeta `json:"metadata,omitempty"` | ||||||
|  | 	Items           []ClusterTestType `json:"items"` | ||||||
| } | } | ||||||
|  |  | ||||||
| // +genclient | // +genclient | ||||||
| @@ -70,5 +71,5 @@ type ClusterTestType struct { | |||||||
| } | } | ||||||
|  |  | ||||||
| type ClusterTestTypeStatus struct { | type ClusterTestTypeStatus struct { | ||||||
| 	Blah string | 	Blah string `json:"blah"` | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Dr. Stefan Schimanski
					Dr. Stefan Schimanski