Skip to content
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

Project migrated under kubernetes-sigs, change import path prefix to sigs.k8s.io/descheduler #182

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ linters:

linters-settings:
goimports:
local-prefixes: github.com/kubernetes-incubator/descheduler
local-prefixes: sigs.k8s.io/descheduler
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the dot at the end intentional? just asking does not matter much.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just my convention. I can remove it if needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am fine, have not seen that frequently (for current dir at the end of the path) so asking.

- hack/verify-gofmt.sh
- make lint
- make build
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
# 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

FROM scratch

MAINTAINER Avesh Agarwal <[email protected]>

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"]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand All @@ -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) .
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
8 changes: 4 additions & 4 deletions cmd/descheduler/app/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/descheduler/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion cmd/descheduler/descheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"fmt"
"os"

"github.com/kubernetes-incubator/descheduler/cmd/descheduler/app"
"sigs.k8s.io/descheduler/cmd/descheduler/app"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion glide.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package: github.com/kubernetes-incubator/descheduler
package: sigs.k8s.io/descheduler
import:
- package: k8s.io/client-go
version: 78700dec6369ba22221b72770783300f143df150
Expand Down
2 changes: 1 addition & 1 deletion hack/lib/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion hack/update-codecgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
49 changes: 49 additions & 0 deletions hack/update-gofmt.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions hack/verify-gofmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: "
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 3 additions & 3 deletions pkg/api/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/v1alpha1/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion pkg/api/v1alpha1/zz_generated.conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/componentconfig/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 3 additions & 3 deletions pkg/apis/componentconfig/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/componentconfig/v1alpha1/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
10 changes: 5 additions & 5 deletions pkg/descheduler/descheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/descheduler/evictions/evictions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/descheduler/evictions/evictions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ limitations under the License.
package evictions

import (
"github.com/kubernetes-incubator/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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/descheduler/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import (
"time"

"github.com/golang/glog"
"github.com/kubernetes-incubator/descheduler/pkg/utils"
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels"
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
Expand Down
2 changes: 1 addition & 1 deletion pkg/descheduler/node/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ package node
import (
"testing"

"github.com/kubernetes-incubator/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) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/descheduler/pod/pods_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ package pod
import (
"testing"

"github.com/kubernetes-incubator/descheduler/test"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
"sigs.k8s.io/descheduler/test"
)

func TestPodTypes(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions pkg/descheduler/policyconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions pkg/descheduler/strategies/duplicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/descheduler/strategies/duplicates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ package strategies
import (
"testing"

"github.com/kubernetes-incubator/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) {
Expand Down
Loading