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

Upgrade to 1.7.0-rc.1 #1584

Closed
wants to merge 12 commits into from
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
3,790 changes: 2,194 additions & 1,596 deletions Godeps/Godeps.json

Large diffs are not rendered by default.

70 changes: 45 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ DEB_VERSION ?= $(VERSION_MAJOR).$(VERSION_MINOR)-$(VERSION_BUILD)
INSTALL_SIZE ?= $(shell du out/minikube-windows-amd64.exe | cut -f1)
BUILDROOT_BRANCH ?= 2017.02
REGISTRY?=gcr.io/k8s-minikube
DARWIN_BUILD_IMAGE ?= karalabe/xgo-1.8.3

MINIKUBE_BUILD_IMAGE ?= karalabe/xgo-1.8.3
LOCALKUBE_BUILD_IMAGE ?= gcr.io/google_containers/kube-cross:v1.8.3-1
ISO_BUILD_IMAGE ?= $(REGISTRY)/buildroot-image

# The iso will be versioned the same as minikube
ISO_VERSION ?= v0.20.0
ISO_BUCKET ?= minikube/iso

Expand All @@ -33,13 +34,6 @@ GOARCH ?= $(shell go env GOARCH)
BUILD_DIR ?= ./out
ORG := k8s.io
REPOPATH ?= $(ORG)/minikube
BUILD_IMAGE ?= gcr.io/google_containers/kube-cross:v1.7.1-0
IS_EXE ?=

ifeq ($(IN_DOCKER),1)
GOPATH := /go
export GOPATH
endif

# Use system python if it exists, otherwise use Docker.
PYTHON := $(shell command -v python || echo "docker run --rm -it -v $(shell pwd):/minikube -w /minikube python python")
Expand All @@ -58,32 +52,58 @@ LOCALKUBE_LDFLAGS := "$(K8S_VERSION_LDFLAGS) $(MINIKUBE_LDFLAGS) -s -w -extldfla
LOCALKUBEFILES := GOPATH=$(GOPATH) go list -f '{{join .Deps "\n"}}' ./cmd/localkube/ | grep k8s.io | GOPATH=$(GOPATH) xargs go list -f '{{ range $$file := .GoFiles }} {{$$.Dir}}/{{$$file}}{{"\n"}}{{end}}'
MINIKUBEFILES := GOPATH=$(GOPATH) go list -f '{{join .Deps "\n"}}' ./cmd/minikube/ | grep k8s.io | GOPATH=$(GOPATH) xargs go list -f '{{ range $$file := .GoFiles }} {{$$.Dir}}/{{$$file}}{{"\n"}}{{end}}'

MINIKUBE_ENV_LINUX := CGO_ENABLED=1 GOARCH=amd64 GOOS=linux
MINIKUBE_ENV_DARWIN := CC=o64-clang CXX=o64-clang++ CGO_ENABLED=1 GOARCH=amd64 GOOS=darwin
MINIKUBE_ENV_WINDOWS := CGO_ENABLED=0 GOARCH=amd64 GOOS=windows

MINIKUBE_DOCKER_CMD := docker run -e IN_DOCKER=1 --user $(shell id -u):$(shell id -g) --workdir /go/src/$(REPOPATH) --entrypoint /bin/bash -v $(PWD):/go/src/$(REPOPATH) $(MINIKUBE_BUILD_IMAGE) -c
KUBE_CROSS_DOCKER_CMD := docker run -w /go/src/$(REPOPATH) --user $(shell id -u):$(shell id -g) -e IN_DOCKER=1 -v $(shell pwd):/go/src/$(REPOPATH) --entrypoint /bin/bash $(LOCALKUBE_BUILD_IMAGE) -c

# $(call MINIKUBE_GO_BUILD_CMD, output file, OS)
define MINIKUBE_GO_BUILD_CMD
$($(shell echo MINIKUBE_ENV_$(2) | tr a-z A-Z)) go build --installsuffix cgo -ldflags="$(MINIKUBE_LDFLAGS) $(K8S_VERSION_LDFLAGS)" -o $(1) k8s.io/minikube/cmd/minikube
endef

LOCALKUBE_BUILD_CMD := CGO_ENABLED=1 go build -tags static_build -ldflags=$(LOCALKUBE_LDFLAGS) -o $(BUILD_DIR)/localkube ./cmd/localkube

ifeq ($(BUILD_IN_DOCKER),y)
MINIKUBE_BUILD_IN_DOCKER=y
LOCALKUBE_BUILD_IN_DOCKER=y
endif

# If not on linux, localkube must be built in docker
ifneq ($(BUILD_OS),Linux)
LOCALKUBE_BUILD_IN_DOCKER=y
endif

ifeq ($(IN_DOCKER),1)
MINIKUBE_BUILD_IN_DOCKER=n
LOCALKUBE_BUILD_IN_DOCKER=n
endif

ifeq ($(GOOS),windows)
IS_EXE = ".exe"
endif
out/minikube$(IS_EXE): out/minikube-$(GOOS)-$(GOARCH)$(IS_EXE)
cp $(BUILD_DIR)/minikube-$(GOOS)-$(GOARCH)$(IS_EXE) $(BUILD_DIR)/minikube$(IS_EXE)
cp $(BUILD_DIR)/minikube-$(GOOS)-$(GOARCH) $(BUILD_DIR)/minikube$(IS_EXE)

out/localkube: $(shell $(LOCALKUBEFILES))
ifeq ($(BUILD_OS),Linux)
CGO_ENABLED=1 go build -tags static_build -ldflags=$(LOCALKUBE_LDFLAGS) -o $(BUILD_DIR)/localkube ./cmd/localkube
ifeq ($(LOCALKUBE_BUILD_IN_DOCKER),y)
$(KUBE_CROSS_DOCKER_CMD) '$(LOCALKUBE_BUILD_CMD)'
else
docker run -w /go/src/$(REPOPATH) -e IN_DOCKER=1 -v $(shell pwd):/go/src/$(REPOPATH) $(BUILD_IMAGE) make out/localkube
$(LOCALKUBE_BUILD_CMD)
endif

out/minikube-darwin-amd64: pkg/minikube/assets/assets.go $(shell $(MINIKUBEFILES))
ifeq ($(IN_DOCKER),1)
CC=o64-clang CXX=o64-clang++ CGO_ENABLED=1 GOARCH=amd64 GOOS=darwin go build --installsuffix cgo -ldflags="$(MINIKUBE_LDFLAGS) $(K8S_VERSION_LDFLAGS)" -a -o $(BUILD_DIR)/minikube-darwin-amd64 k8s.io/minikube/cmd/minikube
out/minikube-windows-amd64.exe: out/minikube-windows-amd64
mv out/minikube-windows-amd64 out/minikube-windows-amd64.exe

out/minikube-%-amd64: pkg/minikube/assets/assets.go $(shell $(MINIKUBEFILES))
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
$(MINIKUBE_DOCKER_CMD) '$(call MINIKUBE_GO_BUILD_CMD,$@,$*)'
else
docker run -e IN_DOCKER=1 --workdir /go/src/$(REPOPATH) --entrypoint /usr/bin/make -v $(PWD):/go/src/$(REPOPATH) $(DARWIN_BUILD_IMAGE) out/minikube-darwin-amd64
$(call MINIKUBE_GO_BUILD_CMD,$@,$*)
endif

out/minikube-linux-amd64: pkg/minikube/assets/assets.go $(shell $(MINIKUBEFILES))
CGO_ENABLED=1 GOARCH=amd64 GOOS=linux go build --installsuffix cgo -ldflags="$(MINIKUBE_LDFLAGS) $(K8S_VERSION_LDFLAGS)" -a -o $(BUILD_DIR)/minikube-linux-amd64 k8s.io/minikube/cmd/minikube

out/minikube-windows-amd64.exe: pkg/minikube/assets/assets.go $(shell $(MINIKUBEFILES))
CGO_ENABLED=0 GOARCH=amd64 GOOS=windows go build --installsuffix cgo -ldflags="$(MINIKUBE_LDFLAGS) $(K8S_VERSION_LDFLAGS)" -a -o $(BUILD_DIR)/minikube-windows-amd64.exe k8s.io/minikube/cmd/minikube

minikube_iso: # old target kept for making tests happy
echo $(ISO_VERSION) > deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/etc/VERSION
if [ ! -d $(BUILD_DIR)/buildroot ]; then \
Expand All @@ -98,7 +118,7 @@ out/minikube.iso: $(shell find deploy/iso/minikube-iso -type f)
ifeq ($(IN_DOCKER),1)
$(MAKE) minikube_iso
else
docker run --rm --workdir /mnt --volume $(CURDIR):/mnt $(ISO_DOCKER_EXTRA_ARGS) \
docker run --rm --workdir /mnt --volume $(CURDIR):/mnt \
--user $(shell id -u):$(shell id -g) --env HOME=/tmp --env IN_DOCKER=1 \
$(ISO_BUILD_IMAGE) /usr/bin/make out/minikube.iso
endif
Expand Down Expand Up @@ -191,7 +211,7 @@ localkube-image: out/localkube

buildroot-image: $(ISO_BUILD_IMAGE) # convenient alias to build the docker container
$(ISO_BUILD_IMAGE): deploy/iso/minikube-iso/Dockerfile
docker build $(ISO_DOCKER_EXTRA_ARGS) -t $@ -f $< $(dir $<)
docker build -t $@ -f $< $(dir $<)
@echo ""
@echo "$(@) successfully built"

Expand Down
2 changes: 1 addition & 1 deletion cmd/localkube/cmd/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func AddFlags(s *localkube.LocalkubeServer) {
flag.StringVar(&s.APIServerName, "apiserver-name", s.APIServerName, "The apiserver name which is used in the generated certificate for localkube/kubernetes. This can be used if you want to make the API server available from outside the machine")

flag.BoolVar(&s.ShouldGenerateCerts, "generate-certs", s.ShouldGenerateCerts, "If localkube should generate it's own certificates")
flag.BoolVar(&s.ShowVersion, "version", s.ShowVersion, "If localkube should just print the version and exit.")
flag.BoolVar(&s.ShowVersion, "show-version", s.ShowVersion, "If localkube should just print the version and exit.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a bug where the kubernetes components are registering their flags. A component added their own version flag.

It's polluting the localkube flag namespace

Usage of ./out/localkube:
      --allow_verification_with_non_compliant_keys   Allow a SignatureVerifier to use keys which are technically non-compliant with RFC6962.
      --alsologtostderr                              log to standard error as well as files
      --apiserver-address ip                         The address the apiserver will listen securely on (default 0.0.0.0)
      --apiserver-insecure-address ip                The address the apiserver will listen insecurely on (default 127.0.0.1)
      --apiserver-insecure-port int                  The port the apiserver will listen insecurely on (default 8080)
      --apiserver-name string                        The apiserver name which is used in the generated certificate for localkube/kubernetes.  This can be used if you want to make the API server available from outside the machine (default "minikubeCA")
      --apiserver-port int                           The port the apiserver will listen securely on (default 8443)
      --application_metrics_count_limit int          Max number of application metrics to store (per container) (default 100)
      --azure-container-registry-config string       Path to the file container Azure container registry configuration information.
      --boot_id_file string                          Comma-separated list of files to check for boot-id. Use the first one that exists. (default "/proc/sys/kernel/random/boot_id")
      --cloud-provider-gce-lb-src-cidrs cidrs        CIDRS opened in GCE firewall for LB traffic proxy & health checks (default 130.211.0.0/22,35.191.0.0/16,209.85.152.0/22,209.85.204.0/22)
      --container-runtime string                     The container runtime to be used
      --container_hints string                       location of the container hints file (default "/etc/cadvisor/container_hints.json")
      --containerized                                If kubelet should run in containerized mode
      --default-not-ready-toleration-seconds int     Indicates the tolerationSeconds of the toleration for notReady:NoExecute that is added by default to every pod that does not already have such a toleration. (default 300)
      --default-unreachable-toleration-seconds int   Indicates the tolerationSeconds of the toleration for unreachable:NoExecute that is added by default to every pod that does not already have such a toleration. (default 300)
      --dns-domain string                            The cluster dns domain (default "cluster.local")
      --dns-ip ip                                    The cluster dns IP (default 10.0.0.10)
      --docker string                                docker endpoint (default "unix:///var/run/docker.sock")
      --docker_env_metadata_whitelist string         a comma-separated list of environment variable keys that needs to be collected for docker containers
      --docker_only                                  Only report docker containers in addition to root stats
      --docker_root string                           DEPRECATED: docker root is read from docker info (this is a fallback, default: /var/lib/docker) (default "/var/lib/docker")
      --enable-dns                                   DEPRECATED: Please run kube-dns as a cluster addon
      --enable_load_reader                           Whether to enable cpu load reader
      --event_storage_age_limit string               Max length of time for which to store events (per type). Value is a comma separated list of key values, where the keys are event types (e.g.: creation, oom) or "default" and the value is a duration. Default is applied to all non-specified event types (default "default=0")
      --event_storage_event_limit string             Max number of events to store (per type). Value is a comma separated list of key values, where the keys are event types (e.g.: creation, oom) or "default" and the value is an integer. Default is applied to all non-specified event types (default "default=0")
      --extra-config ExtraOption                     A set of key=value pairs that describe configuration that may be passed to different components. The key should be '.' separated, and the first part before the dot is the component to apply the configuration to.
      --feature-gates string                         A set of key=value pairs that describe feature gates for alpha/experimental features.
      --generate-certs                               If localkube should generate it's own certificates (default true)
      --global_housekeeping_interval duration        Interval between global housekeepings (default 1m0s)
      --host-ip                                      If localkube should just print the host IP and exit.
      --housekeeping_interval duration               Interval between container housekeepings (default 10s)
      --ir-data-source string                        Data source used by InitialResources. Supported options: influxdb, gcm. (default "influxdb")
      --ir-dbname string                             InfluxDB database name which contains metrics required by InitialResources (default "k8s")
      --ir-hawkular string                           Hawkular configuration URL
      --ir-influxdb-host string                      Address of InfluxDB which contains metrics required by InitialResources (default "localhost:8080/api/v1/namespaces/kube-system/services/monitoring-influxdb:api/proxy")
      --ir-namespace-only                            Whether the estimation should be made only based on data from the same namespace.
      --ir-password string                           Password used for connecting to InfluxDB (default "root")
      --ir-percentile int                            Which percentile of samples should InitialResources use when estimating resources. For experiment purposes. (default 90)
      --ir-user string                               User used for connecting to InfluxDB (default "root")
      --localkube-directory string                   The directory localkube will store files in (default "/var/lib/localkube")
      --log_backtrace_at traceLocation               when logging hits line file:N, emit a stack trace (default :0)
      --log_cadvisor_usage                           Whether to log the usage of the cAdvisor container
      --log_dir string                               If non-empty, write log files in this directory
      --loglevel int                                 Log level (0 = DEBUG, 5 = FATAL) (default 1)
      --logtostderr                                  log to standard error instead of files
      --machine_id_file string                       Comma-separated list of files to check for machine-id. Use the first one that exists. (default "/etc/machine-id,/var/lib/dbus/machine-id")
      --network-plugin string                        The name of the network plugin
      --node-ip ip                                   IP address of the node. If set, kubelet will use this IP address for the node.
      --runtime-config mapStringString               A set of key=value pairs that describe runtime configuration that may be passed to apiserver. apis/<groupVersion> key can be used to turn on/off specific api versions. apis/<groupVersion>/<resource> can be used to turn on/off specific resources. api/all and api/legacy are special keys to control all and legacy api versions respectively. (default api/all=true)
      --service-cluster-ip-range ipNet               The service-cluster-ip-range for the apiserver (default 10.0.0.0/24)
      --show-version                                 If localkube should just print the version and exit.
      --stderrthreshold severity                     logs at or above this threshold go to stderr (default 2)
      --storage_driver_buffer_duration duration      Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction (default 1m0s)
      --storage_driver_db string                     database name (default "cadvisor")
      --storage_driver_host string                   database host:port (default "localhost:8086")
      --storage_driver_password string               database password (default "root")
      --storage_driver_secure                        use secure connection with database
      --storage_driver_table string                  table name (default "stats")
      --storage_driver_user string                   database username (default "root")
  -v, --v Level                                      log level for V logs
      --version version[=true]                       Print version information and quit
      --vmodule moduleSpec                           comma-separated list of pattern=N settings for file-filtered logging

I think this is happening at HEAD also, but the version flag didn't exist.

flag.BoolVar(&s.ShowHostIP, "host-ip", s.ShowHostIP, "If localkube should just print the host IP and exit.")
flag.Var(&s.RuntimeConfig, "runtime-config", "A set of key=value pairs that describe runtime configuration that may be passed to apiserver. apis/<groupVersion> key can be used to turn on/off specific api versions. apis/<groupVersion>/<resource> can be used to turn on/off specific resources. api/all and api/legacy are special keys to control all and legacy api versions respectively.")
flag.IPVar(&s.NodeIP, "node-ip", s.NodeIP, "IP address of the node. If set, kubelet will use this IP address for the node.")
Expand Down
6 changes: 0 additions & 6 deletions cmd/localkube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"os"
"os/signal"

"github.com/coreos/pkg/capnslog"
"github.com/golang/glog"
"k8s.io/apiserver/pkg/util/feature"

Expand All @@ -47,11 +46,6 @@ func StartLocalkube() {
os.Exit(0)
}

// Get the etcd logger for the api repo
apiRepoLogger := capnslog.MustRepoLogger("github.com/coreos/etcd/etcdserver/api")
// Set the logging level to NOTICE as there is an INFO lvl log statement that runs every few seconds -> log spam
apiRepoLogger.SetRepoLogLevel(capnslog.NOTICE)

// TODO: Require root

SetupServer(Server)
Expand Down
2 changes: 1 addition & 1 deletion deploy/addons/addon-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
hostNetwork: true
containers:
- name: kube-addon-manager
image: gcr.io/google-containers/kube-addon-manager:v6.4-beta.1
image: gcr.io/google-containers/kube-addon-manager:v6.4-beta.2
imagePullPolicy: IfNotPresent
resources:
requests:
Expand Down
6 changes: 3 additions & 3 deletions deploy/addons/kube-dns/kube-dns-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
optional: true
containers:
- name: kubedns
image: gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.2
image: gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.4
resources:
# TODO: Set memory limits when we've profiled the container for large
# clusters, then set request = limit to keep this container in
Expand Down Expand Up @@ -95,7 +95,7 @@ spec:
- name: kube-dns-config
mountPath: /kube-dns-config
- name: dnsmasq
image: gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.2
image: gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.4
livenessProbe:
httpGet:
path: /healthcheck/dnsmasq
Expand Down Expand Up @@ -133,7 +133,7 @@ spec:
- name: kube-dns-config
mountPath: /etc/k8s/dns/dnsmasq-nanny
- name: sidecar
image: gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.2
image: gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.4
livenessProbe:
httpGet:
path: /metrics
Expand Down
2 changes: 1 addition & 1 deletion docs/contributors/releasing_minikube.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Send a PR for the Makefile change and wait until it is merged. Once the commit
Run this command:

```shell
make cross checksum
BUILD_IN_DOCKER=y make cross checksum
```

## Add the version to the releases.json file
Expand Down
8 changes: 6 additions & 2 deletions hack/get_k8s_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from datetime import datetime

K8S_PACKAGE = 'k8s.io/kubernetes/'
X_ARG_BASE = '-X k8s.io/minikube/vendor/k8s.io/kubernetes/pkg/version.'
X_ARGS = ['-X k8s.io/minikube/vendor/k8s.io/kubernetes/pkg/version.', '-X k8s.io/minikube/vendor/k8s.io/client-go/pkg/version.']

def get_rev():
return 'gitCommit=%s' % get_from_godep('Rev')
Expand Down Expand Up @@ -52,7 +52,11 @@ def main():
if len(sys.argv) > 1 and sys.argv[1] == "--k8s-version-only":
return get_from_godep('Comment')
args = [get_rev(), get_version(), get_tree_state(), get_build_date()]
return ' '.join([X_ARG_BASE + arg for arg in args])
ret = ''
for xarg in X_ARGS:
for arg in args:
ret += xarg + arg + " "
return ret

if __name__ == '__main__':
sys.exit(main())
6 changes: 1 addition & 5 deletions hack/godeps/godep-restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@ if [ ! -d "${KUBE_ROOT}" ]; then
popd >/dev/null
fi

pushd ${KUBE_ROOT} >/dev/null
git checkout ${KUBE_VERSION}
./hack/godep-restore.sh
popd >/dev/null
godep::restore_kubernetes

godep::sync_staging
pushd ${MINIKUBE_ROOT} >/dev/null
godep restore ./...
popd >/dev/null
7 changes: 6 additions & 1 deletion hack/godeps/godep-save.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ godep::sync_staging

rm -rf ${MINIKUBE_ROOT}/vendor ${MINIKUBE_ROOT}/Godeps
godep save ./...
cp ${KUBE_ROOT}/pkg/generated/openapi/zz_generated.openapi.go ${MINIKUBE_ROOT}/vendor/k8s.io/kubernetes/pkg/generated/openapi

godep::remove_staging_from_json
git checkout -- ${MINIKUBE_ROOT}/vendor/golang.org/x/sys/windows

git apply ${MINIKUBE_ROOT}/hack/tpr-patch.diff
pushd ${MINIKUBE_ROOT} >/dev/null
git apply ${MINIKUBE_ROOT}/hack/tpr-patch.diff
git apply ${MINIKUBE_ROOT}/hack/kube-proxy-patch.diff
popd >/dev/null

25 changes: 25 additions & 0 deletions hack/godeps/godep-update-k8s.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Copyright 2016 The Kubernetes Authors 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.

K8S_ORG_ROOT=${GOPATH}/src/k8s.io
MINIKUBE_ROOT=${K8S_ORG_ROOT}/minikube
KUBE_ROOT=${K8S_ORG_ROOT}/kubernetes
KUBE_VERSION=${KUBE_VERSION:=$(python ${MINIKUBE_ROOT}/hack/get_k8s_version.py --k8s-version-only 2>&1)}

source ${MINIKUBE_ROOT}/hack/godeps/utils.sh

godep::restore_kubernetes
${MINIKUBE_ROOT}/hack/godeps/godep-save.sh
27 changes: 14 additions & 13 deletions hack/godeps/godeps-json-updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,20 @@ package main

import (
"encoding/json"
"io/ioutil"
"log"
"os"
"path"
"strings"

flag "github.com/spf13/pflag"
)

var (
godepsFile = flag.String("godeps-file", "", "absolute path to Godeps.json")
godepsFile = flag.String("godeps-file", "", "absolute path to Godeps.json")
kubernetesPath = flag.String("kubernetes-dir", "", "absolute path to the kubernetes folder")
)

var ignoredPrefixes = []string{
"k8s.io/client-go",
"k8s.io/apimachinery",
"k8s.io/apiserver",
"k8s.io/kube-aggregator",
"k8s.io/kube-apiextensions-server",
"k8s.io/metrics",
}

type Dependency struct {
ImportPath string
Comment string `json:",omitempty"`
Expand All @@ -55,7 +49,7 @@ type Godeps struct {
func main() {
flag.Parse()
var g Godeps
if len(*godepsFile) == 0 {
if godepsFile == nil || kubernetesPath == nil {
log.Fatalf("absolute path to Godeps.json is required")
}
f, err := os.OpenFile(*godepsFile, os.O_RDWR, 0666)
Expand All @@ -68,11 +62,18 @@ func main() {
log.Fatalf("Unable to parse %q: %v", *godepsFile, err)
}

k8sStagingDir := path.Join(*kubernetesPath, "staging", "src", "k8s.io")
stagedRepos, err := ioutil.ReadDir(k8sStagingDir)
if err != nil {
log.Fatalf("Couldn't read kubernetes staging repo: %v", err)
}

i := 0
for _, dep := range g.Deps {
ignored := false
for _, ignoredPrefix := range ignoredPrefixes {
if strings.HasPrefix(dep.ImportPath, ignoredPrefix) {
for _, stagedRepo := range stagedRepos {
importPrefix := path.Join("k8s.io", stagedRepo.Name())
if strings.HasPrefix(dep.ImportPath, importPrefix) {
ignored = true
}
}
Expand Down
11 changes: 10 additions & 1 deletion hack/godeps/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ for repo in $(ls ${KUBE_ROOT}/staging/src/k8s.io); do
done
}

godep::restore_kubernetes() {
pushd ${KUBE_ROOT} >/dev/null
git checkout ${KUBE_VERSION}
./hack/godep-restore.sh
bazel build //pkg/generated/openapi:zz_generated.openapi
popd >/dev/null
godep::sync_staging
}

godep::remove_staging_from_json() {
go run ${MINIKUBE_ROOT}/hack/godeps/godeps-json-updater.go --godeps-file ${MINIKUBE_ROOT}/Godeps/Godeps.json
go run ${MINIKUBE_ROOT}/hack/godeps/godeps-json-updater.go --godeps-file ${MINIKUBE_ROOT}/Godeps/Godeps.json --kubernetes-dir ${KUBE_ROOT}
}
2 changes: 1 addition & 1 deletion hack/jenkins/minikube_cross_build_and_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fi
export GOPATH=~/go

# Build all platforms (Windows, Linux, OSX)
make cross
BUILD_IN_DOCKER=y make cross

# Build the e2e test target for Darwin and Linux. We don't run tests on Windows yet.
# We build these on Linux, but run the tests on different platforms.
Expand Down
2 changes: 1 addition & 1 deletion hack/jenkins/release_build_and_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cat Makefile | grep "VERSION_MINOR ?=" | grep $VERSION_MINOR
cat Makefile | grep "VERSION_BUILD ?=" | grep $VERSION_BUILD

# Build and upload
make cross checksum
BUILD_IN_DOCKER=y make cross checksum

gsutil cp out/minikube-linux-amd64 gs://$BUCKET/releases/$TAGNAME/
gsutil cp out/minikube-linux-amd64.sha256 gs://$BUCKET/releases/$TAGNAME/
Expand Down
13 changes: 13 additions & 0 deletions hack/kube-proxy-patch.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server.go b/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server.go
index 8d1ae7774..8745a176f 100644
--- a/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server.go
+++ b/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server.go
@@ -422,7 +422,7 @@ func NewProxyServer(config *componentconfig.KubeProxyConfiguration, cleanupAndEx
if c, err := configz.New("componentconfig"); err == nil {
c.Set(config)
} else {
- return nil, fmt.Errorf("unable to register configz: %s", err)
+ glog.Errorf("unable to register configz: %s", err)
}

protocol := utiliptables.ProtocolIpv4
Loading