From 693ce0bfde8bd78060310da0af7e0566189ef08f Mon Sep 17 00:00:00 2001 From: Sean Knox Date: Mon, 29 May 2017 17:50:50 -0700 Subject: [PATCH] ref(*): remove dead code --- pkg/api/convertertoupgradeapi.go | 14 -------------- pkg/api/v20160330/validate.go | 11 ----------- pkg/api/v20160930/validate.go | 11 ----------- pkg/api/v20170131/validate.go | 11 ----------- scripts/validate-go.sh | 10 +++++----- 5 files changed, 5 insertions(+), 52 deletions(-) diff --git a/pkg/api/convertertoupgradeapi.go b/pkg/api/convertertoupgradeapi.go index bfd33c158..16dd21e03 100644 --- a/pkg/api/convertertoupgradeapi.go +++ b/pkg/api/convertertoupgradeapi.go @@ -17,17 +17,3 @@ func ConvertVLabsUpgradeContainerService(vlabs *vlabs.UpgradeContainerService) * convertVLabsOrchestratorProfile(vlabs.OrchestratorProfile, ucs.OrchestratorProfile) return ucs } - -func convertVLabsUpgradeOrchestratorProfile(vlabscs *vlabs.OrchestratorProfile, api *OrchestratorProfile) { - api.OrchestratorType = OrchestratorType(vlabscs.OrchestratorType) - if api.OrchestratorType == Kubernetes { - switch vlabscs.OrchestratorVersion { - case vlabs.Kubernetes162: - api.OrchestratorVersion = Kubernetes162 - case vlabs.Kubernetes160: - api.OrchestratorVersion = Kubernetes160 - default: - api.OrchestratorVersion = KubernetesLatest - } - } -} diff --git a/pkg/api/v20160330/validate.go b/pkg/api/v20160330/validate.go index 633379d4f..bf130a229 100644 --- a/pkg/api/v20160330/validate.go +++ b/pkg/api/v20160330/validate.go @@ -148,14 +148,3 @@ func validateUniqueProfileNames(profiles []*AgentPoolProfile) error { } return nil } - -func validateUniquePorts(ports []int, name string) error { - portMap := make(map[int]bool) - for _, port := range ports { - if _, ok := portMap[port]; ok { - return fmt.Errorf("agent profile '%s' has duplicate port '%d', ports must be unique", name, port) - } - portMap[port] = true - } - return nil -} diff --git a/pkg/api/v20160930/validate.go b/pkg/api/v20160930/validate.go index 1d307841e..29e15126c 100644 --- a/pkg/api/v20160930/validate.go +++ b/pkg/api/v20160930/validate.go @@ -164,14 +164,3 @@ func validateUniqueProfileNames(profiles []*AgentPoolProfile) error { } return nil } - -func validateUniquePorts(ports []int, name string) error { - portMap := make(map[int]bool) - for _, port := range ports { - if _, ok := portMap[port]; ok { - return fmt.Errorf("agent profile '%s' has duplicate port '%d', ports must be unique", name, port) - } - portMap[port] = true - } - return nil -} diff --git a/pkg/api/v20170131/validate.go b/pkg/api/v20170131/validate.go index 8652afad7..44c2d49a0 100644 --- a/pkg/api/v20170131/validate.go +++ b/pkg/api/v20170131/validate.go @@ -167,14 +167,3 @@ func validateUniqueProfileNames(profiles []*AgentPoolProfile) error { } return nil } - -func validateUniquePorts(ports []int, name string) error { - portMap := make(map[int]bool) - for _, port := range ports { - if _, ok := portMap[port]; ok { - return fmt.Errorf("agent profile '%s' has duplicate port '%d', ports must be unique", name, port) - } - portMap[port] = true - } - return nil -} diff --git a/scripts/validate-go.sh b/scripts/validate-go.sh index 2ecf5dfb3..a051ea8f3 100755 --- a/scripts/validate-go.sh +++ b/scripts/validate-go.sh @@ -17,15 +17,15 @@ set -euo pipefail exit_code=0 -if ! hash gometalinter.v1 2>/dev/null ; then - go get -u gopkg.in/alecthomas/gometalinter.v1 - gometalinter.v1 --install +if ! hash gometalinter 2>/dev/null ; then + go get -u github.com/alecthomas/gometalinter + gometalinter --install fi echo echo "==> Running static validations <==" # Run linters that should return errors -gometalinter.v1 \ +gometalinter \ --disable-all \ --enable deadcode \ --severity deadcode:error \ @@ -41,7 +41,7 @@ gometalinter.v1 \ echo echo "==> Running linters <==" # Run linters that should return warnings -gometalinter.v1 \ +gometalinter \ --disable-all \ --enable golint \ --vendor \