-
Notifications
You must be signed in to change notification settings - Fork 820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/gometalinter #176
Feature/gometalinter #176
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2018 Google Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
excluded=$(find . -name "*.go" | grep -v vendor | xargs grep autogenerated | cut -d ':' -f 1 | uniq | sed 's#\./##g') | ||
jq -n --arg inarjq -n --arg inarr "${excluded}" '{ Exclude: ($inarr | split("\n")) }' > .exclude.gometalinter.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ import ( | |
|
||
// main starts a UDP server that received 1024 byte sized packets at at time | ||
// converts the bytes to a string, and logs the output | ||
func main() { | ||
func main() { // nolint: gocyclo | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, we should make a ticket to fix this one too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Created #178 |
||
port := flag.String("port", "7654", "The port to listen to udp traffic on") | ||
flag.Parse() | ||
if ep := os.Getenv("PORT"); ep != "" { | ||
|
@@ -41,7 +41,7 @@ func main() { | |
if err != nil { | ||
log.Fatalf("Could not start udp server: %v", err) | ||
} | ||
defer conn.Close() | ||
defer conn.Close() // nolint: errcheck | ||
|
||
log.Print("Creating SDK instance") | ||
s, err := sdk.NewSDK() | ||
|
@@ -79,12 +79,10 @@ func main() { | |
log.Printf("Could not shutdown") | ||
} | ||
os.Exit(0) | ||
break | ||
|
||
// turns off the health pings | ||
case "UNHEALTHY": | ||
close(stop) | ||
break | ||
} | ||
|
||
// echo it back | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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{} | ||
|
@@ -56,6 +57,7 @@ func NewMocks() Mocks { | |
return m | ||
} | ||
|
||
// StartInformers starts new fake informers | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 it's so good to have all of this picked up |
||
func StartInformers(mocks Mocks, sync ...cache.InformerSynced) (<-chan struct{}, context.CancelFunc) { | ||
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) | ||
stop := ctx.Done() | ||
|
@@ -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{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this PR - but we should make a ticket for this, because we should fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #177