Skip to content

Commit

Permalink
Change json tag name to match struct field name
Browse files Browse the repository at this point in the history
Signed-off-by: Pierangelo Di Pilato <[email protected]>
  • Loading branch information
pierDipi committed Jan 12, 2022
1 parent 8cc1192 commit 9b393b9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions testing/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ type ResourceSpec struct {
FieldThatsImmutable string `json:"fieldThatsImmutable,omitempty"`
FieldThatsImmutableWithDefault string `json:"fieldThatsImmutableWithDefault,omitempty"`
FieldForCallbackValidation string `json:"fieldThatCallbackRejects,omitempty"`
FieldForCallbackDefaulting string `json:"fieldDefaultingCallback,omitempty"`
FieldForCallbackDefaulting string `json:"fieldForCallbackDefaulting,omitempty"`
FieldForCallbackDefaultingIsWithinUpdate bool `json:"fieldForIsWithinUpdate,omitempty"`
FieldForCallbackDefaultingUsername string `json:"FieldForCallbackDefaultingUsername,omitempty"`
FieldForCallbackDefaultingUsername string `json:"fieldForCallbackDefaultingUsername,omitempty"`
}

// GetGroupVersionKind returns the GroupVersionKind.
Expand Down
20 changes: 10 additions & 10 deletions webhook/resourcesemantics/defaulting/defaulting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ func TestAdmitCreates(t *testing.T) {
},
patches: []jsonpatch.JsonPatchOperation{{
Operation: "replace",
Path: "/spec/fieldDefaultingCallback",
Path: "/spec/fieldForCallbackDefaulting",
Value: "I'm a default",
}, {
Operation: "replace",
Expand All @@ -383,7 +383,7 @@ func TestAdmitCreates(t *testing.T) {
Value: user1,
}, {
Operation: "add",
Path: "/spec/FieldForCallbackDefaultingUsername",
Path: "/spec/fieldForCallbackDefaultingUsername",
Value: user1,
}},
}, {
Expand All @@ -404,11 +404,11 @@ func TestAdmitCreates(t *testing.T) {
},
patches: []jsonpatch.JsonPatchOperation{{
Operation: "replace",
Path: "/spec/fieldDefaultingCallback",
Path: "/spec/fieldForCallbackDefaulting",
Value: "I'm a default",
}, {
Operation: "add",
Path: "/spec/FieldForCallbackDefaultingUsername",
Path: "/spec/fieldForCallbackDefaultingUsername",
Value: user1,
}, {
Operation: "replace",
Expand Down Expand Up @@ -604,7 +604,7 @@ func TestAdmitUpdatesCallback(t *testing.T) {
},
patches: []jsonpatch.JsonPatchOperation{{
Operation: "replace",
Path: "/spec/fieldDefaultingCallback",
Path: "/spec/fieldForCallbackDefaulting",
Value: "I'm a default",
}, {

Expand All @@ -617,7 +617,7 @@ func TestAdmitUpdatesCallback(t *testing.T) {
Value: true,
}, {
Operation: "add",
Path: "/spec/FieldForCallbackDefaultingUsername",
Path: "/spec/fieldForCallbackDefaultingUsername",
Value: user2,
}},
createUpdateResourceFunc: createUpdateResource,
Expand All @@ -643,15 +643,15 @@ func TestAdmitUpdatesCallback(t *testing.T) {
Value: user2,
}, {
Operation: "replace",
Path: "/spec/fieldDefaultingCallback",
Path: "/spec/fieldForCallbackDefaulting",
Value: "I'm a default",
}, {
Operation: "add",
Path: "/spec/fieldForIsWithinUpdate",
Value: true,
}, {
Operation: "add",
Path: "/spec/FieldForCallbackDefaultingUsername",
Path: "/spec/fieldForCallbackDefaultingUsername",
Value: user2,
}},
}, {
Expand Down Expand Up @@ -681,7 +681,7 @@ func TestAdmitUpdatesCallback(t *testing.T) {
},
patches: []jsonpatch.JsonPatchOperation{{
Operation: "replace",
Path: "/spec/fieldDefaultingCallback",
Path: "/spec/fieldForCallbackDefaulting",
Value: "I'm a default",
}, {

Expand All @@ -694,7 +694,7 @@ func TestAdmitUpdatesCallback(t *testing.T) {
Value: true,
}, {
Operation: "add",
Path: "/spec/FieldForCallbackDefaultingUsername",
Path: "/spec/fieldForCallbackDefaultingUsername",
Value: user2,
}},
createUpdateResourceFunc: createUpdateResource,
Expand Down

0 comments on commit 9b393b9

Please sign in to comment.