Skip to content

Commit 1ce5c4d

Browse files
nileboxpmorie
authored andcommitted
Remove k8s/k8s dependency (openshift#1355)
* Copy used types from k8s/k8s repo to Service Catalog codebase * Remove dependency on k8s/k8s repo * Update vendor dir (remove vendored k8s/k8s) * FIx conversion-gen, stop importing k8s/k8s packages * Copy init scripts from k8s/k8s, needed for running integration tests * Update etcd version * Removed unused scripts
1 parent b458323 commit 1ce5c4d

File tree

10,208 files changed

+1852
-2141289
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

10,208 files changed

+1852
-2141289
lines changed

Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ USER_BROKER_IMAGE = $(REGISTRY)user-broker-$(ARCH):$(VERSION)
8686
USER_BROKER_MUTABLE_IMAGE = $(REGISTRY)user-broker-$(ARCH):$(MUTABLE_TAG)
8787

8888
# precheck to avoid kubernetes-incubator/service-catalog#361
89-
$(if $(realpath vendor/k8s.io/kubernetes/vendor), \
90-
$(error the vendor directory exists in the kubernetes \
89+
$(if $(realpath vendor/k8s.io/apimachinery/vendor), \
90+
$(error the vendor directory exists in the apimachinery \
9191
vendored source and must be flattened. \
9292
run 'glide i -v'))
9393

@@ -188,6 +188,7 @@ $(BINDIR)/e2e.test: .init $(NEWEST_E2ETEST_SOURCE) $(NEWEST_GO_FILE)
188188
# Generate conversions
189189
$(DOCKER_CMD) $(BINDIR)/conversion-gen \
190190
--v 1 --logtostderr \
191+
--extra-peer-dirs k8s.io/api/core/v1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/conversion,k8s.io/apimachinery/pkg/runtime \
191192
--go-header-file "vendor/github.com/kubernetes/repo-infra/verify/boilerplate/boilerplate.go.txt" \
192193
--input-dirs "$(SC_PKG)/pkg/apis/servicecatalog" \
193194
--input-dirs "$(SC_PKG)/pkg/apis/servicecatalog/v1beta1" \
@@ -228,6 +229,7 @@ verify: .init .generate_files verify-client-gen
228229
@# observes conventions from upstream that will not pass lint checks).
229230
@$(DOCKER_CMD) sh -c \
230231
'for i in $$(find $(TOP_SRC_DIRS) -name *.go \
232+
| grep -v ^pkg/kubernetes/ \
231233
| grep -v generated \
232234
| grep -v ^pkg/client/ \
233235
| grep -v v1beta1/defaults.go); \

build/build-image/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ RUN curl -sSL https://github.com/Masterminds/glide/releases/download/$GLIDE_VERS
2424
| tar -vxz -C /usr/local/bin --strip=1
2525

2626
# Install etcd
27-
RUN curl -sSL https://github.com/coreos/etcd/releases/download/v3.1.0/etcd-v3.1.0-linux-amd64.tar.gz \
28-
| tar -vxz -C /usr/local/bin --strip=1 etcd-v3.1.0-linux-amd64/etcd
27+
RUN curl -sSL https://github.com/coreos/etcd/releases/download/v3.1.10/etcd-v3.1.10-linux-amd64.tar.gz \
28+
| tar -vxz -C /usr/local/bin --strip=1 etcd-v3.1.10-linux-amd64/etcd
2929

3030
# Install the golint, use this to check our source for niceness
3131
RUN go get -u github.com/golang/lint/golint

build/verify-errexit.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fi
3333

3434
# Gather the list of files that appear to be shell scripts.
3535
# Meaning they have some form of "#!...sh" as a line in them.
36-
shFiles=$(grep -rl '^#!.*sh$' $args)
36+
shFiles=$(grep -rl '^#!.*sh$' $args | grep -v ^pkg/kubernetes/)
3737

3838
tmp=/tmp/out$RANDOM
3939
for file in ${shFiles}; do

cmd/apiserver/app/server/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323

2424
"github.com/golang/glog"
2525
"github.com/kubernetes-incubator/service-catalog/pkg"
26+
"github.com/kubernetes-incubator/service-catalog/pkg/kubernetes/pkg/util/interrupt"
2627
"github.com/kubernetes-incubator/service-catalog/pkg/registry/servicecatalog/server"
2728
"github.com/kubernetes-incubator/service-catalog/plugin/pkg/admission/broker/authsarcheck"
2829
"github.com/kubernetes-incubator/service-catalog/plugin/pkg/admission/namespace/lifecycle"
@@ -32,7 +33,6 @@ import (
3233
"github.com/spf13/cobra"
3334
"k8s.io/apiserver/pkg/admission"
3435
genericserveroptions "k8s.io/apiserver/pkg/server/options"
35-
"k8s.io/kubernetes/pkg/util/interrupt"
3636
)
3737

3838
const (

cmd/controller-manager/app/controller_manager.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ import (
3737
"k8s.io/client-go/tools/clientcmd"
3838
"k8s.io/client-go/tools/record"
3939

40+
"github.com/kubernetes-incubator/service-catalog/pkg/kubernetes/pkg/util/configz"
4041
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
4142
"k8s.io/apimachinery/pkg/runtime/schema"
4243
"k8s.io/apimachinery/pkg/util/wait"
4344
"k8s.io/apiserver/pkg/server/healthz"
4445
"k8s.io/client-go/tools/leaderelection"
4546
"k8s.io/client-go/tools/leaderelection/resourcelock"
46-
"k8s.io/kubernetes/pkg/util/configz"
4747

4848
// The API groups for our API must be installed before we can use the
4949
// client to work with them. This needs to be done once per process; this

cmd/controller-manager/app/options/options.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ import (
2727
utilfeature "k8s.io/apiserver/pkg/util/feature"
2828

2929
"github.com/kubernetes-incubator/service-catalog/pkg/apis/componentconfig"
30+
k8scomponentconfig "github.com/kubernetes-incubator/service-catalog/pkg/kubernetes/pkg/apis/componentconfig"
31+
"github.com/kubernetes-incubator/service-catalog/pkg/kubernetes/pkg/client/leaderelectionconfig"
3032
osb "github.com/pmorie/go-open-service-broker-client/v2"
31-
k8scomponentconfig "k8s.io/kubernetes/pkg/apis/componentconfig"
32-
"k8s.io/kubernetes/pkg/client/leaderelectionconfig"
3333
)
3434

3535
// ControllerManagerServer is the main context object for the controller

glide.lock

+2-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glide.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ import:
6868
- args
6969
- package: github.com/kubernetes/repo-infra
7070
version: e26fc85d14a1d3dc25569831acc06919673c545a # latest (Oct 4, 2017)
71-
- package: k8s.io/kubernetes
72-
version: 0b9efaeb34a2fc51ff8e4d34ad9bc6375459c4a4 # kubernetes 1.8.0
7371
- package: k8s.io/client-go
7472
version: afb4606c45bae77c4dc2c15291d4d7d6d792196c # release-5.0, latest (Oct 4, 2017)
7573
- package: k8s.io/apimachinery

pkg/apis/componentconfig/types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ package componentconfig
2323
import (
2424
"time"
2525

26-
"k8s.io/kubernetes/pkg/apis/componentconfig"
26+
"github.com/kubernetes-incubator/service-catalog/pkg/kubernetes/pkg/apis/componentconfig"
2727
)
2828

2929
// ControllerManagerConfiguration encapsulates configuration for the

pkg/kubernetes/README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Kubernetes Code Copy Area
2+
3+
This directory is the copy of original types from the main
4+
[kubernetes/kubernetes repo](https://github.com/kubernetes/kubernetes) with
5+
maintaining original packages structure. The purpose of this package is to
6+
avoid depending on the entire main repo and copy only necessary types as needed.
7+
8+
The types in this directory should be treated as read-only, and any necessary
9+
changes should be addressed in the original repository. If there are some
10+
specific changes needed to be made for Service Catalog, the type should be moved
11+
out of this directory to the appropriate one first.
12+
13+
## Updating dependencies to the latest Kubernetes release
14+
15+
When updating dependencies on
16+
[k8s.io/apimachinery](https://github.com/kubernetes/apimachinery),
17+
[k8s.io/client-go](https://github.com/kubernetes/client-go),
18+
[k8s.io/apiserver](https://github.com/kubernetes/apiserver)
19+
and other top-level Kubernetes repositories, we need to overwrite the types in
20+
this directory with the latest version from the corresponding release of
21+
[k8s.io/kubernetes](https://github.com/kubernetes/kubernetes) to keep the files
22+
in sync.
23+
24+
## Long-term plan
25+
26+
In the long term the packages used by Kubernetes-based projects will be moved
27+
from the main repo to separate top-level repositories, [k8s.io/common](https://github.com/kubernetes/common)
28+
and [k8s.io/utils](https://github.com/kubernetes/utils). Once it is done, we can
29+
eventually switch to those packages and drop this directory.

vendor/k8s.io/kubernetes/hack/lib/etcd.sh pkg/kubernetes/hack/lib/etcd.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# A set of helpers for starting/running etcd for tests
1818

19-
ETCD_VERSION=${ETCD_VERSION:-3.0.17}
19+
ETCD_VERSION=${ETCD_VERSION:-3.1.10}
2020
ETCD_HOST=${ETCD_HOST:-127.0.0.1}
2121
ETCD_PORT=${ETCD_PORT:-2379}
2222

vendor/k8s.io/kubernetes/hack/lib/golang.sh pkg/kubernetes/hack/lib/golang.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -366,13 +366,16 @@ kube::golang::setup_env() {
366366

367367
kube::golang::create_gopath_tree
368368

369-
export GOPATH=${KUBE_GOPATH}
369+
export GOPATH="${KUBE_GOPATH}"
370370

371371
# Append KUBE_EXTRA_GOPATH to the GOPATH if it is defined.
372372
if [[ -n ${KUBE_EXTRA_GOPATH:-} ]]; then
373373
GOPATH="${GOPATH}:${KUBE_EXTRA_GOPATH}"
374374
fi
375375

376+
# Make sure our own Go binaries are in PATH.
377+
export PATH="${KUBE_GOPATH}/bin:${PATH}"
378+
376379
# Change directories so that we are within the GOPATH. Some tools get really
377380
# upset if this is not true. We use a whole fake GOPATH here to collect the
378381
# resultant binaries. Go will not let us use GOBIN with `go install` and

vendor/k8s.io/kubernetes/hack/lib/init.sh pkg/kubernetes/hack/lib/init.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# Copyright 2014 The Kubernetes Authors.
3+
# Copyright 2017 The Kubernetes Authors.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -56,6 +56,7 @@ admissionregistration.k8s.io/v1alpha1 \
5656
admission.k8s.io/v1alpha1 \
5757
apps/v1beta1 \
5858
apps/v1beta2 \
59+
apps/v1 \
5960
authentication.k8s.io/v1 \
6061
authentication.k8s.io/v1beta1 \
6162
authorization.k8s.io/v1 \
@@ -169,4 +170,3 @@ kube::realpath() {
169170
fi
170171
kube::readlinkdashf "$1"
171172
}
172-

0 commit comments

Comments
 (0)