Skip to content

Commit

Permalink
Inline JSON: GameServerAllocation v1.LabelSelector
Browse files Browse the repository at this point in the history
The K8s YAML library will inline embeded structs, but some other ones
will not. So adding the `json:",inline"` hint, so that they know that
the `v1.LabelSelector` should be inlined if people are so inclined to
reference it via Golang yaml libraries.

Include regeneration of the crd docs and client libraries, which
picked up on some small changes.

Closes #2853
  • Loading branch information
markmandel committed Dec 16, 2022
1 parent f518cc3 commit c61a21a
Show file tree
Hide file tree
Showing 5 changed files with 1,260 additions and 1,257 deletions.
2 changes: 1 addition & 1 deletion pkg/apis/allocation/v1/gameserverallocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ type GameServerAllocationSpec struct {
// a GameServer for allocation.
type GameServerSelector struct {
// See: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
metav1.LabelSelector
metav1.LabelSelector `json:",inline"`
// [Stage:Beta]
// [FeatureFlag:StateAllocationFilter]
// +optional
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/allocation/v1/gameserverallocation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestGameServerAllocationApplyDefaults(t *testing.T) {
assert.Equal(t, int64(0), gsa.Spec.Required.Players.MinAvailable)
}

//nolint // Current lint duplicate threshold will consider this function is a duplication of the function TestGameServerAllocationSpecSelectors
// nolint // Current lint duplicate threshold will consider this function is a duplication of the function TestGameServerAllocationSpecSelectors
func TestGameServerAllocationSpecPreferredSelectors(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -78,7 +78,7 @@ func TestGameServerAllocationSpecPreferredSelectors(t *testing.T) {
assert.True(t, gsas.Preferred[1].Matches(gs))
}

//nolint // Current lint duplicate threshold will consider this function is a duplication of the function TestGameServerAllocationSpecPreferredSelectors
// nolint // Current lint duplicate threshold will consider this function is a duplication of the function TestGameServerAllocationSpecPreferredSelectors
func TestGameServerAllocationSpecSelectors(t *testing.T) {
t.Parallel()

Expand Down
14 changes: 7 additions & 7 deletions pkg/client/clientset/versioned/fake/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions pkg/client/clientset/versioned/scheme/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c61a21a

Please sign in to comment.