From 29f6f08a634772954e585499da14b06b0864d270 Mon Sep 17 00:00:00 2001 From: "(Brien Dieterle)" <(briend@gmail.com)> Date: Thu, 19 Sep 2019 13:43:15 +0200 Subject: [PATCH 1/3] Project migrared under kubernetes-sigs, change import path prefix to sigs.k8s.io/descheduler --- .golangci.yml | 2 +- Dockerfile | 4 ++-- Makefile | 4 ++-- README.md | 4 ++-- cmd/descheduler/app/options/options.go | 8 ++++---- cmd/descheduler/app/server.go | 4 ++-- cmd/descheduler/descheduler.go | 2 +- glide.yaml | 2 +- hack/lib/init.sh | 2 +- hack/update-codecgen.sh | 2 +- pkg/api/doc.go | 2 +- pkg/api/install/install.go | 6 +++--- pkg/api/v1alpha1/doc.go | 4 ++-- pkg/api/v1alpha1/zz_generated.conversion.go | 2 +- pkg/apis/componentconfig/doc.go | 2 +- pkg/apis/componentconfig/install/install.go | 6 +++--- pkg/apis/componentconfig/v1alpha1/doc.go | 4 ++-- .../v1alpha1/zz_generated.conversion.go | 2 +- pkg/descheduler/descheduler.go | 10 +++++----- pkg/descheduler/evictions/evictions.go | 2 +- pkg/descheduler/evictions/evictions_test.go | 2 +- pkg/descheduler/node/node.go | 2 +- pkg/descheduler/node/node_test.go | 2 +- pkg/descheduler/pod/pods_test.go | 2 +- pkg/descheduler/policyconfig.go | 8 ++++---- pkg/descheduler/strategies/duplicates.go | 8 ++++---- pkg/descheduler/strategies/duplicates_test.go | 2 +- pkg/descheduler/strategies/lownodeutilization.go | 10 +++++----- .../strategies/lownodeutilization_test.go | 4 ++-- pkg/descheduler/strategies/node_affinity.go | 10 +++++----- pkg/descheduler/strategies/node_affinity_test.go | 6 +++--- pkg/descheduler/strategies/pod_antiaffinity.go | 8 ++++---- .../strategies/pod_antiaffinity_test.go | 2 +- test/e2e/e2e_test.go | 14 +++++++------- test/run-e2e-tests.sh | 3 +-- test/run-unit-tests.sh | 3 +-- 36 files changed, 79 insertions(+), 81 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index c4f501b0c9..0870cde545 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -12,4 +12,4 @@ linters: linters-settings: goimports: -local-prefixes: github.com/kubernetes-incubator/descheduler +local-prefixes: sigs.k8s.io/descheduler diff --git a/Dockerfile b/Dockerfile index 1716570a8c..2fdd405e37 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. FROM golang:1.9.2 -WORKDIR /go/src/github.com/kubernetes-incubator/descheduler +WORKDIR /go/src/sigs.k8s.io/descheduler COPY . . RUN make @@ -21,6 +21,6 @@ FROM scratch MAINTAINER Avesh Agarwal -COPY --from=0 /go/src/github.com/kubernetes-incubator/descheduler/_output/bin/descheduler /bin/descheduler +COPY --from=0 /go/src/sigs.k8s.io/descheduler/_output/bin/descheduler /bin/descheduler CMD ["/bin/descheduler", "--help"] diff --git a/Makefile b/Makefile index 8ce1349041..2d774b0e3b 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ VERSION?=`git describe --tags` COMMIT=`git rev-parse HEAD` BUILD=`date +%FT%T%z` -LDFLAG_LOCATION=github.com/kubernetes-incubator/descheduler/cmd/descheduler/app +LDFLAG_LOCATION=sigs.k8s.io/descheduler/cmd/descheduler/app LDFLAGS=-ldflags "-X ${LDFLAG_LOCATION}.version=${VERSION} -X ${LDFLAG_LOCATION}.buildDate=${BUILD} -X ${LDFLAG_LOCATION}.gitCommit=${COMMIT}" @@ -37,7 +37,7 @@ IMAGE_GCLOUD:=$(REGISTRY)/descheduler:$(VERSION) all: build build: - CGO_ENABLED=0 go build ${LDFLAGS} -o _output/bin/descheduler github.com/kubernetes-incubator/descheduler/cmd/descheduler + CGO_ENABLED=0 go build ${LDFLAGS} -o _output/bin/descheduler sigs.k8s.io/descheduler/cmd/descheduler dev-image: build docker build -f Dockerfile.dev -t $(IMAGE) . diff --git a/README.md b/README.md index 8898b10d0b..2479a83103 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![Build Status](https://travis-ci.org/kubernetes-incubator/descheduler.svg?branch=master)](https://travis-ci.org/kubernetes-incubator/descheduler) -[![Go Report Card](https://goreportcard.com/badge/github.com/kubernetes-incubator/descheduler)](https://goreportcard.com/report/github.com/kubernetes-incubator/descheduler) +[![Build Status](https://travis-ci.org/kubernetes-sigs/descheduler.svg?branch=master)](https://travis-ci.org/kubernetes-sigs/descheduler) +[![Go Report Card](https://goreportcard.com/badge/kubernetes-sigs/descheduler)](https://goreportcard.com/report/sigs.k8s.io/descheduler) # Descheduler for Kubernetes diff --git a/cmd/descheduler/app/options/options.go b/cmd/descheduler/app/options/options.go index 72bfb4163e..ef6bbbebc0 100644 --- a/cmd/descheduler/app/options/options.go +++ b/cmd/descheduler/app/options/options.go @@ -21,10 +21,10 @@ import ( clientset "k8s.io/client-go/kubernetes" // install the componentconfig api so we get its defaulting and conversion functions - "github.com/kubernetes-incubator/descheduler/pkg/apis/componentconfig" - _ "github.com/kubernetes-incubator/descheduler/pkg/apis/componentconfig/install" - "github.com/kubernetes-incubator/descheduler/pkg/apis/componentconfig/v1alpha1" - deschedulerscheme "github.com/kubernetes-incubator/descheduler/pkg/descheduler/scheme" + "sigs.k8s.io/descheduler/pkg/apis/componentconfig" + _ "sigs.k8s.io/descheduler/pkg/apis/componentconfig/install" + "sigs.k8s.io/descheduler/pkg/apis/componentconfig/v1alpha1" + deschedulerscheme "sigs.k8s.io/descheduler/pkg/descheduler/scheme" "github.com/spf13/pflag" ) diff --git a/cmd/descheduler/app/server.go b/cmd/descheduler/app/server.go index 01d86343fd..8feaa68daf 100644 --- a/cmd/descheduler/app/server.go +++ b/cmd/descheduler/app/server.go @@ -21,8 +21,8 @@ import ( "flag" "io" - "github.com/kubernetes-incubator/descheduler/cmd/descheduler/app/options" - "github.com/kubernetes-incubator/descheduler/pkg/descheduler" + "sigs.k8s.io/descheduler/cmd/descheduler/app/options" + "sigs.k8s.io/descheduler/pkg/descheduler" "github.com/golang/glog" "github.com/spf13/cobra" diff --git a/cmd/descheduler/descheduler.go b/cmd/descheduler/descheduler.go index f5cea4f4ed..c09348bfc0 100644 --- a/cmd/descheduler/descheduler.go +++ b/cmd/descheduler/descheduler.go @@ -21,7 +21,7 @@ import ( "fmt" "os" - "github.com/kubernetes-incubator/descheduler/cmd/descheduler/app" + "sigs.k8s.io/descheduler/cmd/descheduler/app" ) func main() { diff --git a/glide.yaml b/glide.yaml index c45d884f70..911263ea40 100644 --- a/glide.yaml +++ b/glide.yaml @@ -1,4 +1,4 @@ -package: github.com/kubernetes-incubator/descheduler +package: sigs.k8s.io/descheduler import: - package: k8s.io/client-go version: 78700dec6369ba22221b72770783300f143df150 diff --git a/hack/lib/init.sh b/hack/lib/init.sh index 69b4936398..c1a6a415e3 100644 --- a/hack/lib/init.sh +++ b/hack/lib/init.sh @@ -43,5 +43,5 @@ OS_ROOT="$( os::util::absolute_path "${init_source}" )" export OS_ROOT cd "${OS_ROOT}" -PRJ_PREFIX="github.com/${REPO_ORG:-kubernetes-incubator}/descheduler" +PRJ_PREFIX="sigs.k8s.io/descheduler" OS_OUTPUT_BINPATH="${OS_ROOT}/_output/bin" diff --git a/hack/update-codecgen.sh b/hack/update-codecgen.sh index b57af814e6..09956a63dd 100755 --- a/hack/update-codecgen.sh +++ b/hack/update-codecgen.sh @@ -40,7 +40,7 @@ generated_files=($( # We only work for deps within this prefix. #my_prefix="k8s.io/kubernetes" -my_prefix="github.com/${REPO_ORG:-kubernetes-incubator}/descheduler" +my_prefix="sigs.k8s.io/descheduler" # Register function to be called on EXIT to remove codecgen # binary and also to touch the files that should be regenerated diff --git a/pkg/api/doc.go b/pkg/api/doc.go index 97b537f0a9..55f05a2077 100644 --- a/pkg/api/doc.go +++ b/pkg/api/doc.go @@ -16,4 +16,4 @@ limitations under the License. // +k8s:deepcopy-gen=package,register -package api // import "github.com/kubernetes-incubator/descheduler/pkg/api" +package api // import "sigs.k8s.io/descheduler/pkg/api" diff --git a/pkg/api/install/install.go b/pkg/api/install/install.go index d1964ecc4e..6ba419a5f8 100644 --- a/pkg/api/install/install.go +++ b/pkg/api/install/install.go @@ -22,9 +22,9 @@ import ( "k8s.io/apimachinery/pkg/apimachinery/registered" "k8s.io/apimachinery/pkg/runtime" - deschedulerapi "github.com/kubernetes-incubator/descheduler/pkg/api" - "github.com/kubernetes-incubator/descheduler/pkg/api/v1alpha1" - deschedulerscheme "github.com/kubernetes-incubator/descheduler/pkg/descheduler/scheme" + deschedulerapi "sigs.k8s.io/descheduler/pkg/api" + "sigs.k8s.io/descheduler/pkg/api/v1alpha1" + deschedulerscheme "sigs.k8s.io/descheduler/pkg/descheduler/scheme" ) func init() { diff --git a/pkg/api/v1alpha1/doc.go b/pkg/api/v1alpha1/doc.go index 0557ca9650..b1664026e1 100644 --- a/pkg/api/v1alpha1/doc.go +++ b/pkg/api/v1alpha1/doc.go @@ -15,10 +15,10 @@ limitations under the License. */ // +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=github.com/kubernetes-incubator/descheduler/pkg/api +// +k8s:conversion-gen=sigs.k8s.io/descheduler/pkg/api // +k8s:defaulter-gen=TypeMeta // Package v1alpha1 is the v1alpha1 version of the descheduler API // +groupName=descheduler -package v1alpha1 // import "github.com/kubernetes-incubator/descheduler/pkg/api/v1alpha1" +package v1alpha1 // import "sigs.k8s.io/descheduler/pkg/api/v1alpha1" diff --git a/pkg/api/v1alpha1/zz_generated.conversion.go b/pkg/api/v1alpha1/zz_generated.conversion.go index 315bc6860b..cba302f23d 100644 --- a/pkg/api/v1alpha1/zz_generated.conversion.go +++ b/pkg/api/v1alpha1/zz_generated.conversion.go @@ -23,9 +23,9 @@ package v1alpha1 import ( unsafe "unsafe" - api "github.com/kubernetes-incubator/descheduler/pkg/api" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" + api "sigs.k8s.io/descheduler/pkg/api" ) func init() { diff --git a/pkg/apis/componentconfig/doc.go b/pkg/apis/componentconfig/doc.go index 30b98701c7..11eafc654a 100644 --- a/pkg/apis/componentconfig/doc.go +++ b/pkg/apis/componentconfig/doc.go @@ -16,4 +16,4 @@ limitations under the License. // +k8s:deepcopy-gen=package,register -package componentconfig // import "github.com/kubernetes-incubator/descheduler/pkg/apis/componentconfig" +package componentconfig // import "sigs.k8s.io/descheduler/pkg/apis/componentconfig" diff --git a/pkg/apis/componentconfig/install/install.go b/pkg/apis/componentconfig/install/install.go index 841eabbee9..ecc5ce5f97 100644 --- a/pkg/apis/componentconfig/install/install.go +++ b/pkg/apis/componentconfig/install/install.go @@ -22,9 +22,9 @@ import ( "k8s.io/apimachinery/pkg/apimachinery/registered" "k8s.io/apimachinery/pkg/runtime" - "github.com/kubernetes-incubator/descheduler/pkg/apis/componentconfig" - "github.com/kubernetes-incubator/descheduler/pkg/apis/componentconfig/v1alpha1" - deschedulerscheme "github.com/kubernetes-incubator/descheduler/pkg/descheduler/scheme" + "sigs.k8s.io/descheduler/pkg/apis/componentconfig" + "sigs.k8s.io/descheduler/pkg/apis/componentconfig/v1alpha1" + deschedulerscheme "sigs.k8s.io/descheduler/pkg/descheduler/scheme" ) func init() { diff --git a/pkg/apis/componentconfig/v1alpha1/doc.go b/pkg/apis/componentconfig/v1alpha1/doc.go index 0e9e690cd7..78a71bd691 100644 --- a/pkg/apis/componentconfig/v1alpha1/doc.go +++ b/pkg/apis/componentconfig/v1alpha1/doc.go @@ -15,10 +15,10 @@ limitations under the License. */ // +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=github.com/kubernetes-incubator/descheduler/pkg/apis/componentconfig +// +k8s:conversion-gen=sigs.k8s.io/descheduler/pkg/apis/componentconfig // +k8s:defaulter-gen=TypeMeta // Package v1alpha1 is the v1alpha1 version of the descheduler's componentconfig API // +groupName=deschedulercomponentconfig -package v1alpha1 // import "github.com/kubernetes-incubator/descheduler/pkg/apis/componentconfig/v1alpha1" +package v1alpha1 // import "sigs.k8s.io/descheduler/pkg/apis/componentconfig/v1alpha1" diff --git a/pkg/apis/componentconfig/v1alpha1/zz_generated.conversion.go b/pkg/apis/componentconfig/v1alpha1/zz_generated.conversion.go index 98f7cfddc3..52a9b4e3d2 100644 --- a/pkg/apis/componentconfig/v1alpha1/zz_generated.conversion.go +++ b/pkg/apis/componentconfig/v1alpha1/zz_generated.conversion.go @@ -23,9 +23,9 @@ package v1alpha1 import ( time "time" - componentconfig "github.com/kubernetes-incubator/descheduler/pkg/apis/componentconfig" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" + componentconfig "sigs.k8s.io/descheduler/pkg/apis/componentconfig" ) func init() { diff --git a/pkg/descheduler/descheduler.go b/pkg/descheduler/descheduler.go index 07d73c395b..3e28e12110 100644 --- a/pkg/descheduler/descheduler.go +++ b/pkg/descheduler/descheduler.go @@ -21,11 +21,11 @@ import ( "github.com/golang/glog" - "github.com/kubernetes-incubator/descheduler/cmd/descheduler/app/options" - "github.com/kubernetes-incubator/descheduler/pkg/descheduler/client" - eutils "github.com/kubernetes-incubator/descheduler/pkg/descheduler/evictions/utils" - nodeutil "github.com/kubernetes-incubator/descheduler/pkg/descheduler/node" - "github.com/kubernetes-incubator/descheduler/pkg/descheduler/strategies" + "sigs.k8s.io/descheduler/cmd/descheduler/app/options" + "sigs.k8s.io/descheduler/pkg/descheduler/client" + eutils "sigs.k8s.io/descheduler/pkg/descheduler/evictions/utils" + nodeutil "sigs.k8s.io/descheduler/pkg/descheduler/node" + "sigs.k8s.io/descheduler/pkg/descheduler/strategies" ) func Run(rs *options.DeschedulerServer) error { diff --git a/pkg/descheduler/evictions/evictions.go b/pkg/descheduler/evictions/evictions.go index 1be6b35ace..acc1fc4e7d 100644 --- a/pkg/descheduler/evictions/evictions.go +++ b/pkg/descheduler/evictions/evictions.go @@ -25,7 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" clientset "k8s.io/client-go/kubernetes" - eutils "github.com/kubernetes-incubator/descheduler/pkg/descheduler/evictions/utils" + eutils "sigs.k8s.io/descheduler/pkg/descheduler/evictions/utils" ) func EvictPod(client clientset.Interface, pod *v1.Pod, policyGroupVersion string, dryRun bool) (bool, error) { diff --git a/pkg/descheduler/evictions/evictions_test.go b/pkg/descheduler/evictions/evictions_test.go index 7ec711659a..79f177c418 100644 --- a/pkg/descheduler/evictions/evictions_test.go +++ b/pkg/descheduler/evictions/evictions_test.go @@ -17,7 +17,7 @@ limitations under the License. package evictions import ( - "github.com/kubernetes-incubator/descheduler/test" + "sigs.k8s.io/descheduler/test" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/fake" diff --git a/pkg/descheduler/node/node.go b/pkg/descheduler/node/node.go index 5b48973d83..cdcfdc0705 100644 --- a/pkg/descheduler/node/node.go +++ b/pkg/descheduler/node/node.go @@ -20,7 +20,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kubernetes-incubator/descheduler/pkg/utils" + "sigs.k8s.io/descheduler/pkg/utils" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" diff --git a/pkg/descheduler/node/node_test.go b/pkg/descheduler/node/node_test.go index 44e922acec..27b7b3ea46 100644 --- a/pkg/descheduler/node/node_test.go +++ b/pkg/descheduler/node/node_test.go @@ -19,7 +19,7 @@ package node import ( "testing" - "github.com/kubernetes-incubator/descheduler/test" + "sigs.k8s.io/descheduler/test" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" diff --git a/pkg/descheduler/pod/pods_test.go b/pkg/descheduler/pod/pods_test.go index 25a51dbd3a..a6f54d4843 100644 --- a/pkg/descheduler/pod/pods_test.go +++ b/pkg/descheduler/pod/pods_test.go @@ -19,7 +19,7 @@ package pod import ( "testing" - "github.com/kubernetes-incubator/descheduler/test" + "sigs.k8s.io/descheduler/test" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" ) diff --git a/pkg/descheduler/policyconfig.go b/pkg/descheduler/policyconfig.go index 33bebb4ac2..209033b201 100644 --- a/pkg/descheduler/policyconfig.go +++ b/pkg/descheduler/policyconfig.go @@ -23,10 +23,10 @@ import ( "k8s.io/apimachinery/pkg/runtime" "github.com/golang/glog" - "github.com/kubernetes-incubator/descheduler/pkg/api" - _ "github.com/kubernetes-incubator/descheduler/pkg/api/install" - "github.com/kubernetes-incubator/descheduler/pkg/api/v1alpha1" - "github.com/kubernetes-incubator/descheduler/pkg/descheduler/scheme" + "sigs.k8s.io/descheduler/pkg/api" + _ "sigs.k8s.io/descheduler/pkg/api/install" + "sigs.k8s.io/descheduler/pkg/api/v1alpha1" + "sigs.k8s.io/descheduler/pkg/descheduler/scheme" ) func LoadPolicyConfig(policyConfigFile string) (*api.DeschedulerPolicy, error) { diff --git a/pkg/descheduler/strategies/duplicates.go b/pkg/descheduler/strategies/duplicates.go index b0333e2063..1d3c480a31 100644 --- a/pkg/descheduler/strategies/duplicates.go +++ b/pkg/descheduler/strategies/duplicates.go @@ -24,10 +24,10 @@ import ( "k8s.io/api/core/v1" clientset "k8s.io/client-go/kubernetes" - "github.com/kubernetes-incubator/descheduler/cmd/descheduler/app/options" - "github.com/kubernetes-incubator/descheduler/pkg/api" - "github.com/kubernetes-incubator/descheduler/pkg/descheduler/evictions" - podutil "github.com/kubernetes-incubator/descheduler/pkg/descheduler/pod" + "sigs.k8s.io/descheduler/cmd/descheduler/app/options" + "sigs.k8s.io/descheduler/pkg/api" + "sigs.k8s.io/descheduler/pkg/descheduler/evictions" + podutil "sigs.k8s.io/descheduler/pkg/descheduler/pod" ) //type creator string diff --git a/pkg/descheduler/strategies/duplicates_test.go b/pkg/descheduler/strategies/duplicates_test.go index 5d285a004b..d5dd310428 100644 --- a/pkg/descheduler/strategies/duplicates_test.go +++ b/pkg/descheduler/strategies/duplicates_test.go @@ -19,7 +19,7 @@ package strategies import ( "testing" - "github.com/kubernetes-incubator/descheduler/test" + "sigs.k8s.io/descheduler/test" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/runtime" diff --git a/pkg/descheduler/strategies/lownodeutilization.go b/pkg/descheduler/strategies/lownodeutilization.go index 1c27c0db21..f7b9be8e87 100644 --- a/pkg/descheduler/strategies/lownodeutilization.go +++ b/pkg/descheduler/strategies/lownodeutilization.go @@ -25,11 +25,11 @@ import ( clientset "k8s.io/client-go/kubernetes" helper "k8s.io/kubernetes/pkg/api/v1/resource" - "github.com/kubernetes-incubator/descheduler/cmd/descheduler/app/options" - "github.com/kubernetes-incubator/descheduler/pkg/api" - "github.com/kubernetes-incubator/descheduler/pkg/descheduler/evictions" - nodeutil "github.com/kubernetes-incubator/descheduler/pkg/descheduler/node" - podutil "github.com/kubernetes-incubator/descheduler/pkg/descheduler/pod" + "sigs.k8s.io/descheduler/cmd/descheduler/app/options" + "sigs.k8s.io/descheduler/pkg/api" + "sigs.k8s.io/descheduler/pkg/descheduler/evictions" + nodeutil "sigs.k8s.io/descheduler/pkg/descheduler/node" + podutil "sigs.k8s.io/descheduler/pkg/descheduler/pod" ) type NodeUsageMap struct { diff --git a/pkg/descheduler/strategies/lownodeutilization_test.go b/pkg/descheduler/strategies/lownodeutilization_test.go index 54df11f121..e6ebc296cb 100644 --- a/pkg/descheduler/strategies/lownodeutilization_test.go +++ b/pkg/descheduler/strategies/lownodeutilization_test.go @@ -21,8 +21,8 @@ import ( "strings" "testing" - "github.com/kubernetes-incubator/descheduler/pkg/api" - "github.com/kubernetes-incubator/descheduler/test" + "sigs.k8s.io/descheduler/pkg/api" + "sigs.k8s.io/descheduler/test" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/runtime" diff --git a/pkg/descheduler/strategies/node_affinity.go b/pkg/descheduler/strategies/node_affinity.go index 667313df13..cd4506a0ee 100644 --- a/pkg/descheduler/strategies/node_affinity.go +++ b/pkg/descheduler/strategies/node_affinity.go @@ -18,11 +18,11 @@ package strategies import ( "github.com/golang/glog" - "github.com/kubernetes-incubator/descheduler/cmd/descheduler/app/options" - "github.com/kubernetes-incubator/descheduler/pkg/api" - "github.com/kubernetes-incubator/descheduler/pkg/descheduler/evictions" - nodeutil "github.com/kubernetes-incubator/descheduler/pkg/descheduler/node" - podutil "github.com/kubernetes-incubator/descheduler/pkg/descheduler/pod" + "sigs.k8s.io/descheduler/cmd/descheduler/app/options" + "sigs.k8s.io/descheduler/pkg/api" + "sigs.k8s.io/descheduler/pkg/descheduler/evictions" + nodeutil "sigs.k8s.io/descheduler/pkg/descheduler/node" + podutil "sigs.k8s.io/descheduler/pkg/descheduler/pod" "k8s.io/api/core/v1" ) diff --git a/pkg/descheduler/strategies/node_affinity_test.go b/pkg/descheduler/strategies/node_affinity_test.go index 5843f9a8e9..039b7bdcde 100644 --- a/pkg/descheduler/strategies/node_affinity_test.go +++ b/pkg/descheduler/strategies/node_affinity_test.go @@ -19,9 +19,9 @@ package strategies import ( "testing" - "github.com/kubernetes-incubator/descheduler/cmd/descheduler/app/options" - "github.com/kubernetes-incubator/descheduler/pkg/api" - "github.com/kubernetes-incubator/descheduler/test" + "sigs.k8s.io/descheduler/cmd/descheduler/app/options" + "sigs.k8s.io/descheduler/pkg/api" + "sigs.k8s.io/descheduler/test" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/fake" diff --git a/pkg/descheduler/strategies/pod_antiaffinity.go b/pkg/descheduler/strategies/pod_antiaffinity.go index 3cbf74c46b..e860ed26d5 100644 --- a/pkg/descheduler/strategies/pod_antiaffinity.go +++ b/pkg/descheduler/strategies/pod_antiaffinity.go @@ -17,10 +17,10 @@ limitations under the License. package strategies import ( - "github.com/kubernetes-incubator/descheduler/cmd/descheduler/app/options" - "github.com/kubernetes-incubator/descheduler/pkg/api" - "github.com/kubernetes-incubator/descheduler/pkg/descheduler/evictions" - podutil "github.com/kubernetes-incubator/descheduler/pkg/descheduler/pod" + "sigs.k8s.io/descheduler/cmd/descheduler/app/options" + "sigs.k8s.io/descheduler/pkg/api" + "sigs.k8s.io/descheduler/pkg/descheduler/evictions" + podutil "sigs.k8s.io/descheduler/pkg/descheduler/pod" "github.com/golang/glog" diff --git a/pkg/descheduler/strategies/pod_antiaffinity_test.go b/pkg/descheduler/strategies/pod_antiaffinity_test.go index f4a5b2d86a..4d672d67e3 100644 --- a/pkg/descheduler/strategies/pod_antiaffinity_test.go +++ b/pkg/descheduler/strategies/pod_antiaffinity_test.go @@ -19,7 +19,7 @@ package strategies import ( "testing" - "github.com/kubernetes-incubator/descheduler/test" + "sigs.k8s.io/descheduler/test" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index d62f852556..b203bb09ff 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -22,13 +22,13 @@ import ( "testing" "time" - "github.com/kubernetes-incubator/descheduler/cmd/descheduler/app/options" - deschedulerapi "github.com/kubernetes-incubator/descheduler/pkg/api" - "github.com/kubernetes-incubator/descheduler/pkg/descheduler/client" - eutils "github.com/kubernetes-incubator/descheduler/pkg/descheduler/evictions/utils" - nodeutil "github.com/kubernetes-incubator/descheduler/pkg/descheduler/node" - podutil "github.com/kubernetes-incubator/descheduler/pkg/descheduler/pod" - "github.com/kubernetes-incubator/descheduler/pkg/descheduler/strategies" + "sigs.k8s.io/descheduler/cmd/descheduler/app/options" + deschedulerapi "sigs.k8s.io/descheduler/pkg/api" + "sigs.k8s.io/descheduler/pkg/descheduler/client" + eutils "sigs.k8s.io/descheduler/pkg/descheduler/evictions/utils" + nodeutil "sigs.k8s.io/descheduler/pkg/descheduler/node" + podutil "sigs.k8s.io/descheduler/pkg/descheduler/pod" + "sigs.k8s.io/descheduler/pkg/descheduler/strategies" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/test/run-e2e-tests.sh b/test/run-e2e-tests.sh index 4ad8f9e68e..d20b156a3d 100755 --- a/test/run-e2e-tests.sh +++ b/test/run-e2e-tests.sh @@ -15,6 +15,5 @@ #!/bin/bash # This just run e2e tests. -PRJ_PREFIX="github.com/${REPO_ORG:-kubernetes-incubator}/descheduler" +PRJ_PREFIX="sigs.k8s.io/descheduler" go test ${PRJ_PREFIX}/test/e2e/ -v - diff --git a/test/run-unit-tests.sh b/test/run-unit-tests.sh index 5cd0912afc..6493196905 100755 --- a/test/run-unit-tests.sh +++ b/test/run-unit-tests.sh @@ -15,6 +15,5 @@ #!/bin/bash # This just run unit-tests. Ignoring the current directory so as to avoid running e2e tests. -PRJ_PREFIX="github.com/${REPO_ORG:-kubernetes-incubator}/descheduler" +PRJ_PREFIX="sigs.k8s.io/descheduler" go test $(go list ${PRJ_PREFIX}/... | grep -v ${PRJ_PREFIX}/vendor/| grep -v ${PRJ_PREFIX}/test/) - From 8e4d6029d37831438ed2f5e95a709d94287534b1 Mon Sep 17 00:00:00 2001 From: "(Brien Dieterle)" <(briend@gmail.com)> Date: Thu, 19 Sep 2019 14:27:07 +0200 Subject: [PATCH 2/3] Run ./hack/update-gofmt --- hack/update-gofmt.sh | 49 +++++++++++++++++++ hack/verify-gofmt.sh | 4 +- pkg/descheduler/evictions/evictions_test.go | 2 +- pkg/descheduler/node/node.go | 2 +- pkg/descheduler/node/node_test.go | 2 +- pkg/descheduler/pod/pods_test.go | 2 +- pkg/descheduler/strategies/duplicates_test.go | 2 +- .../strategies/lownodeutilization_test.go | 4 +- pkg/descheduler/strategies/node_affinity.go | 2 +- .../strategies/node_affinity_test.go | 6 +-- .../strategies/pod_antiaffinity_test.go | 2 +- test/e2e/e2e_test.go | 10 ++-- 12 files changed, 68 insertions(+), 19 deletions(-) create mode 100755 hack/update-gofmt.sh diff --git a/hack/update-gofmt.sh b/hack/update-gofmt.sh new file mode 100755 index 0000000000..4bef00ed8c --- /dev/null +++ b/hack/update-gofmt.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# Copyright 2017 The Kubernetes Authors. +# +# 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. + + +set -o errexit +set -o nounset +set -o pipefail + +DESCHEDULER_ROOT=$(dirname "${BASH_SOURCE}")/.. + +GO_VERSION=($(go version)) + +if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.2|go1.3|go1.4|go1.5|go1.6|go1.7|go1.8|go1.9|go1.10|go1.11|go1.12') ]]; then + echo "Unknown go version '${GO_VERSION[2]}', skipping gofmt." + exit 1 +fi + +cd "${DESCHEDULER_ROOT}" + +find_files() { + find . -not \( \ + \( \ + -wholename './output' \ + -o -wholename './_output' \ + -o -wholename './release' \ + -o -wholename './target' \ + -o -wholename './.git' \ + -o -wholename '*/third_party/*' \ + -o -wholename '*/Godeps/*' \ + -o -wholename '*/vendor/*' \ + \) -prune \ + \) -name '*.go' +} + +GOFMT="gofmt -s -w" +find_files | xargs $GOFMT -l diff --git a/hack/verify-gofmt.sh b/hack/verify-gofmt.sh index 08ab75f216..747e54a713 100755 --- a/hack/verify-gofmt.sh +++ b/hack/verify-gofmt.sh @@ -23,7 +23,7 @@ DESCHEDULER_ROOT=$(dirname "${BASH_SOURCE}")/.. GO_VERSION=($(go version)) -if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.2|go1.3|go1.4|go1.5|go1.6|go1.7|go1.8|go1.9|go1.10|go1.11') ]]; then +if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.2|go1.3|go1.4|go1.5|go1.6|go1.7|go1.8|go1.9|go1.10|go1.11|go1.12') ]]; then echo "Unknown go version '${GO_VERSION[2]}', skipping gofmt." exit 1 fi @@ -45,7 +45,7 @@ find_files() { \) -name '*.go' } -GOFMT="gofmt -s" +GOFMT="gofmt -s" bad_files=$(find_files | xargs $GOFMT -l) if [[ -n "${bad_files}" ]]; then echo "!!! '$GOFMT' needs to be run on the following files: " diff --git a/pkg/descheduler/evictions/evictions_test.go b/pkg/descheduler/evictions/evictions_test.go index 79f177c418..fb1e942ccb 100644 --- a/pkg/descheduler/evictions/evictions_test.go +++ b/pkg/descheduler/evictions/evictions_test.go @@ -17,11 +17,11 @@ limitations under the License. package evictions import ( - "sigs.k8s.io/descheduler/test" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/fake" core "k8s.io/client-go/testing" + "sigs.k8s.io/descheduler/test" "testing" ) diff --git a/pkg/descheduler/node/node.go b/pkg/descheduler/node/node.go index cdcfdc0705..7ab39051dd 100644 --- a/pkg/descheduler/node/node.go +++ b/pkg/descheduler/node/node.go @@ -20,7 +20,6 @@ import ( "time" "github.com/golang/glog" - "sigs.k8s.io/descheduler/pkg/utils" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" @@ -28,6 +27,7 @@ import ( clientset "k8s.io/client-go/kubernetes" corelisters "k8s.io/client-go/listers/core/v1" "k8s.io/client-go/tools/cache" + "sigs.k8s.io/descheduler/pkg/utils" ) // ReadyNodes returns ready nodes irrespective of whether they are diff --git a/pkg/descheduler/node/node_test.go b/pkg/descheduler/node/node_test.go index 27b7b3ea46..5cf5797b73 100644 --- a/pkg/descheduler/node/node_test.go +++ b/pkg/descheduler/node/node_test.go @@ -19,10 +19,10 @@ package node import ( "testing" - "sigs.k8s.io/descheduler/test" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" + "sigs.k8s.io/descheduler/test" ) func TestReadyNodes(t *testing.T) { diff --git a/pkg/descheduler/pod/pods_test.go b/pkg/descheduler/pod/pods_test.go index a6f54d4843..2c87e38743 100644 --- a/pkg/descheduler/pod/pods_test.go +++ b/pkg/descheduler/pod/pods_test.go @@ -19,9 +19,9 @@ package pod import ( "testing" - "sigs.k8s.io/descheduler/test" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + "sigs.k8s.io/descheduler/test" ) func TestPodTypes(t *testing.T) { diff --git a/pkg/descheduler/strategies/duplicates_test.go b/pkg/descheduler/strategies/duplicates_test.go index d5dd310428..d806257270 100644 --- a/pkg/descheduler/strategies/duplicates_test.go +++ b/pkg/descheduler/strategies/duplicates_test.go @@ -19,12 +19,12 @@ package strategies import ( "testing" - "sigs.k8s.io/descheduler/test" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/fake" core "k8s.io/client-go/testing" + "sigs.k8s.io/descheduler/test" ) func TestFindDuplicatePods(t *testing.T) { diff --git a/pkg/descheduler/strategies/lownodeutilization_test.go b/pkg/descheduler/strategies/lownodeutilization_test.go index e6ebc296cb..a35a44afa3 100644 --- a/pkg/descheduler/strategies/lownodeutilization_test.go +++ b/pkg/descheduler/strategies/lownodeutilization_test.go @@ -21,14 +21,14 @@ import ( "strings" "testing" - "sigs.k8s.io/descheduler/pkg/api" - "sigs.k8s.io/descheduler/test" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/fake" core "k8s.io/client-go/testing" "reflect" + "sigs.k8s.io/descheduler/pkg/api" + "sigs.k8s.io/descheduler/test" ) // TODO: Make this table driven. diff --git a/pkg/descheduler/strategies/node_affinity.go b/pkg/descheduler/strategies/node_affinity.go index cd4506a0ee..3a697960ef 100644 --- a/pkg/descheduler/strategies/node_affinity.go +++ b/pkg/descheduler/strategies/node_affinity.go @@ -18,12 +18,12 @@ package strategies import ( "github.com/golang/glog" + "k8s.io/api/core/v1" "sigs.k8s.io/descheduler/cmd/descheduler/app/options" "sigs.k8s.io/descheduler/pkg/api" "sigs.k8s.io/descheduler/pkg/descheduler/evictions" nodeutil "sigs.k8s.io/descheduler/pkg/descheduler/node" podutil "sigs.k8s.io/descheduler/pkg/descheduler/pod" - "k8s.io/api/core/v1" ) func RemovePodsViolatingNodeAffinity(ds *options.DeschedulerServer, strategy api.DeschedulerStrategy, evictionPolicyGroupVersion string, nodes []*v1.Node, nodePodCount nodePodEvictedCount) { diff --git a/pkg/descheduler/strategies/node_affinity_test.go b/pkg/descheduler/strategies/node_affinity_test.go index 039b7bdcde..792a7afa00 100644 --- a/pkg/descheduler/strategies/node_affinity_test.go +++ b/pkg/descheduler/strategies/node_affinity_test.go @@ -19,13 +19,13 @@ package strategies import ( "testing" - "sigs.k8s.io/descheduler/cmd/descheduler/app/options" - "sigs.k8s.io/descheduler/pkg/api" - "sigs.k8s.io/descheduler/test" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/fake" core "k8s.io/client-go/testing" + "sigs.k8s.io/descheduler/cmd/descheduler/app/options" + "sigs.k8s.io/descheduler/pkg/api" + "sigs.k8s.io/descheduler/test" ) func TestRemovePodsViolatingNodeAffinity(t *testing.T) { diff --git a/pkg/descheduler/strategies/pod_antiaffinity_test.go b/pkg/descheduler/strategies/pod_antiaffinity_test.go index 4d672d67e3..1cb62786aa 100644 --- a/pkg/descheduler/strategies/pod_antiaffinity_test.go +++ b/pkg/descheduler/strategies/pod_antiaffinity_test.go @@ -19,12 +19,12 @@ package strategies import ( "testing" - "sigs.k8s.io/descheduler/test" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/fake" core "k8s.io/client-go/testing" + "sigs.k8s.io/descheduler/test" ) func TestPodAntiAffinity(t *testing.T) { diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index b203bb09ff..e190affcda 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -22,6 +22,11 @@ import ( "testing" "time" + "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clientset "k8s.io/client-go/kubernetes" + "k8s.io/kubernetes/pkg/api/testapi" "sigs.k8s.io/descheduler/cmd/descheduler/app/options" deschedulerapi "sigs.k8s.io/descheduler/pkg/api" "sigs.k8s.io/descheduler/pkg/descheduler/client" @@ -29,11 +34,6 @@ import ( nodeutil "sigs.k8s.io/descheduler/pkg/descheduler/node" podutil "sigs.k8s.io/descheduler/pkg/descheduler/pod" "sigs.k8s.io/descheduler/pkg/descheduler/strategies" - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clientset "k8s.io/client-go/kubernetes" - "k8s.io/kubernetes/pkg/api/testapi" ) func MakePodSpec() v1.PodSpec { From 20f4f8fcde902d6f5b9b2275c3bff61076e928df Mon Sep 17 00:00:00 2001 From: "(Brien Dieterle)" <(briend@gmail.com)> Date: Thu, 19 Sep 2019 14:40:04 +0200 Subject: [PATCH 3/3] Explicitly set the repository root directory Looks like Travis does not honor the new repository location. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 4a7fc6f587..4f403542c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,8 @@ before_script: - kind load docker-image kubernetes/pause - cp "$(kind get kubeconfig-path --name="kind")" /tmp/admin.conf script: +- mkdir -p ~/gopath/src/sigs.k8s.io/ +- mv ~/gopath/src/github.com/kubernetes-sigs/descheduler ~/gopath/src/sigs.k8s.io/. - hack/verify-gofmt.sh - make lint - make build