Skip to content

Commit

Permalink
code-generator/examples: fix json tags
Browse files Browse the repository at this point in the history
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
  • Loading branch information
sttts committed Jun 27, 2024
1 parent be2cf7e commit 676d989
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -70,5 +70,5 @@ type ClusterTestType struct {
}

type ClusterTestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -71,5 +72,5 @@ type ClusterTestType struct {
}

type ClusterTestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ type TestTypeList struct {
}

type TestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ type TestTypeList struct {
}

type TestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ type TestTypeList struct {
}

type TestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ type TestTypeList struct {
}

type TestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -71,5 +73,5 @@ type ClusterTestType struct {
}

type ClusterTestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ type TestTypeList struct {
}

type TestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -70,5 +71,5 @@ type ClusterTestType struct {
}

type ClusterTestTypeStatus struct {
Blah string
Blah string `json:"blah"`
}

0 comments on commit 676d989

Please sign in to comment.