mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 16:06:51 +00:00
Add +optional tag to all fields with omitempty json tag
This commit is contained in:
@@ -23,11 +23,12 @@ import (
|
||||
|
||||
type TestStruct struct {
|
||||
unversioned.TypeMeta `json:",inline"`
|
||||
api.ObjectMeta `json:"metadata,omitempty"`
|
||||
Key string `json:"Key"`
|
||||
Map map[string]int `json:"Map"`
|
||||
StringList []string `json:"StringList"`
|
||||
IntList []int `json:"IntList"`
|
||||
// +optional
|
||||
api.ObjectMeta `json:"metadata,omitempty"`
|
||||
Key string `json:"Key"`
|
||||
Map map[string]int `json:"Map"`
|
||||
StringList []string `json:"StringList"`
|
||||
IntList []int `json:"IntList"`
|
||||
}
|
||||
|
||||
func (obj *TestStruct) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
|
||||
Reference in New Issue
Block a user