Skip to content

Commit

Permalink
Fixed some lint errors after rebasing.
Browse files Browse the repository at this point in the history
  • Loading branch information
EricFortin committed Apr 14, 2018
1 parent d39d939 commit 2c69845
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion pkg/apis/stable/v1alpha1/fleet.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import (
)

const (
// FleetGameServerSetLabel is the label that the name of the Fleet
// is set to on the GameServerSet the Fleet controls
FleetGameServerSetLabel = stable.GroupName + "/fleet"
)

Expand Down Expand Up @@ -62,7 +64,7 @@ type FleetStatus struct {
ReadyReplicas int32 `json:"readyReplicas"`
}

// Fleet returns a single GameServerSet for this Fleet definition
// GameServerSet returns a single GameServerSet for this Fleet definition
func (f *Fleet) GameServerSet() *GameServerSet {
gsSet := &GameServerSet{
ObjectMeta: *f.Spec.Template.ObjectMeta.DeepCopy(),
Expand Down
6 changes: 3 additions & 3 deletions pkg/gameserversets/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ import (
)

// holder for all my fakes and mocks
type mocks struct {
type mocks struct { // nolint: megacheck
kubeClient *kubefake.Clientset
extClient *extfake.Clientset
agonesClient *agonesfake.Clientset
agonesInformerFactory externalversions.SharedInformerFactory
fakeRecorder *record.FakeRecorder
}

func newMocks() mocks {
func newMocks() mocks { // nolint: megacheck
kubeClient := &kubefake.Clientset{}
extClient := &extfake.Clientset{}
agonesClient := &agonesfake.Clientset{}
Expand All @@ -51,7 +51,7 @@ func newMocks() mocks {
return m
}

func startInformers(mocks mocks, sync ...cache.InformerSynced) (<-chan struct{}, context.CancelFunc) {
func startInformers(mocks mocks, sync ...cache.InformerSynced) (<-chan struct{}, context.CancelFunc) { // nolint: megacheck
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
stop := ctx.Done()

Expand Down
5 changes: 4 additions & 1 deletion pkg/testing/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (

// Handy tools for testing controllers

// holder for all my fakes and Mocks
// Mocks is a holder for all my fakes and Mocks
type Mocks struct {
KubeClient *kubefake.Clientset
KubeInformationFactory informers.SharedInformerFactory
Expand All @@ -41,6 +41,7 @@ type Mocks struct {
FakeRecorder *record.FakeRecorder
}

// NewMocks creates a new set of fakes and mocks.
func NewMocks() Mocks {
kubeClient := &kubefake.Clientset{}
agonesClient := &agonesfake.Clientset{}
Expand All @@ -56,6 +57,7 @@ func NewMocks() Mocks {
return m
}

// StartInformers starts new fake informers
func StartInformers(mocks Mocks, sync ...cache.InformerSynced) (<-chan struct{}, context.CancelFunc) {
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
stop := ctx.Done()
Expand All @@ -71,6 +73,7 @@ func StartInformers(mocks Mocks, sync ...cache.InformerSynced) (<-chan struct{},
return stop, cancel
}

// NewEstablishedCRD fakes CRD installation success.
func NewEstablishedCRD() *v1beta1.CustomResourceDefinition {
return &v1beta1.CustomResourceDefinition{
Status: v1beta1.CustomResourceDefinitionStatus{
Expand Down

0 comments on commit 2c69845

Please sign in to comment.