Skip to content

Commit

Permalink
Squashed 'cmd/service-catalog/go/src/github.com/kubernetes-incubator/…
Browse files Browse the repository at this point in the history
…service-catalog/' changes from b758460ba7..c3e3071633

c3e3071633 origin build: add origin tooling
97ddbab chart changes for v0.1.9 (openshift#1776)
b5168a7 Add unit tests for class, instance, plan backends in svcat (openshift#1763)
97d11cb prometheus: only return catalog specific metrics (openshift#1774)
0fb00e3 Bump dependency on go-open-service-broker-client to 0.0.4 (openshift#1775)
0a9f1e4 Reset RemovedFromBrokerCatalog when broker re-adds a removed service class (openshift#1770)
28ec5ed Bump dependency on go-open-service-broker-client to 0.0.3 (openshift#1768)
ca83d18 handle binding deletion that occurs during async bind (openshift#1760)
858d467 2 of 4 fixes for golang 1.10 (openshift#1764)
656156b Add unit tests for binding and broker backends in svcat
ec05486 In svcat verify service instance exists on unbind (openshift#1750)
e6315a4 fix indentation from openshift#1725 (openshift#1759)
62284da Publish svcat binaries during build (openshift#1725)
8f986ae also build with golang tip and allow tip to fail (openshift#1734)
127561e use pvc for etcd volume (openshift#1684)
7d155e5 Ensure only href-checker runs on docs only commit (openshift#1693)
4ea44c4 log the version and build date on server startup (openshift#1746)
0db9519 allow getting and describing plans with class/plan name combo in svcat (openshift#1743)
b1da783 print schemas when describing plan in svcat (openshift#1740)
7a7fcce Add constraint for go-open-service-broker-client (openshift#1738)
3070003 Increase timeout for broker condition polling in e2e (openshift#1745)
b6878f7 Avoid Setting Authentication header twice (openshift#1685)
5317111 wrap "rm -rf" with docker (openshift#1735)
d7c0bf2 Allow upper case letters in Plan names (openshift#1668)
6b27ba6  Add a constraint on go-autorest  (openshift#1732)
b3de6ec Added validation for ServiceBinding spec ParametersFrom
REVERT: b758460ba7 origin build: modify hard coded path
REVERT: 871582f73a origin build: add origin tooling

git-subtree-dir: cmd/service-catalog/go/src/github.com/kubernetes-incubator/service-catalog
git-subtree-split: c3e3071633b91541cf9f1000d2d5115cdd31de1b
  • Loading branch information
jpeeler committed Mar 8, 2018
1 parent 241246a commit fc02f43
Show file tree
Hide file tree
Showing 76 changed files with 2,314 additions and 145 deletions.
30 changes: 28 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
language: generic
env:
- GO_VERSION=1.9
- GO_VERSION=rc
matrix:
allow_failures:
- env: GO_VERSION=rc
fast_finish: true
sudo: required
services:
- docker
Expand All @@ -9,10 +16,29 @@ stages:
- test
- name: deploy
if: type != pull_request
before_install:
- |
if [[ -z "$TRAVIS_COMMIT_RANGE" ]]; then
# Builds triggered by initial commit of a new branch.
DOCS_ONLY=0
else
DOCS_REGEX='(OWNERS|LICENSE)|(\.md$)|(^docs/)'
[[ -z "$(git diff --name-only $TRAVIS_COMMIT_RANGE | grep -vE $DOCS_REGEX)" ]]
DOCS_ONLY=$?
fi
# Test
script:
- |
if (( $DOCS_ONLY == 0 )); then
echo "Running verify-docs"
make verify-docs
else
echo "Running full build"
make verify build build-integration build-e2e test images svcat-all
fi
jobs:
include:
# Test
- script: make verify build build-integration build-e2e test images svcat
# Test is implicit from the build matrix
# Deploy
- stage: deploy
deploy:
Expand Down
5 changes: 3 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


# Force dep to vendor the code generators, which aren't imported just used at dev time.
# Picking a subpackage with Go code won't be necessary once https://github.com/golang/dep/issues/1306 is implemented.
# Picking a subpackage with Go code won't be necessary once https://github.com/golang/dep/pull/1545 is merged.
required = [
"github.com/jteeuwen/go-bindata/go-bindata",
"k8s.io/code-generator/cmd/defaulter-gen",
Expand Down Expand Up @@ -41,6 +41,10 @@ required = [
name = "github.com/golang/glog"
revision = "44145f04b68cf362d9c4df2182967c2275eaefed"

[[constraint]]
name = "github.com/Azure/go-autorest"
version = "^9.1.0"

[[constraint]]
name = "github.com/spf13/viper"
version = "~1.0.0"
Expand All @@ -65,6 +69,10 @@ required = [
name = "k8s.io/code-generator"
version = "kubernetes-1.9.1"

[[constraint]]
name = "github.com/pmorie/go-open-service-broker-client"
version = "0.0.4"

[prune]
non-go = true
go-tests = true
Expand Down
71 changes: 52 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ SRC_DIRS = $(shell sh -c "find $(TOP_SRC_DIRS) -name \\*.go \
-exec dirname {} \\; | sort | uniq")
TEST_DIRS ?= $(shell sh -c "find $(TOP_SRC_DIRS) -name \\*_test.go \
-exec dirname {} \\; | sort | uniq")
# Either the tag name, e.g. v1.2.3 or the commit hash for untagged commits, e.g. abc123
VERSION ?= $(shell git describe --always --abbrev=7 --dirty)
# Either the tag name, e.g. v1.2.3 or a combination of the closest tag combined with the commit hash, e.g. v1.2.3-2-gabc123
TAG_VERSION ?= $(shell git describe --tags --abbrev=7 --dirty)
BUILD_LDFLAGS = $(shell build/version.sh $(ROOT) $(SC_PKG))
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)

Expand All @@ -57,10 +60,19 @@ TYPES_FILES = $(shell find pkg/apis -name types.go)
GO_VERSION ?= 1.9

ALL_ARCH=amd64 arm arm64 ppc64le s390x
ALL_CLIENT_PLATFORM=darwin linux windows

PLATFORM ?= linux
# This is the current platform, so that we can build a native client binary by default
CLIENT_PLATFORM?=$(shell uname -s | tr A-Z a-z)
ARCH ?= amd64

ifeq ($(PLATFORM),windows)
FILE_EXT=.exe
else
FILE_EXT=
endif

# TODO: Consider using busybox instead of debian
BASEIMAGE?=gcr.io/google-containers/debian-base-$(ARCH):0.2

Expand Down Expand Up @@ -95,7 +107,7 @@ ifdef NO_DOCKER
else
# Mount .pkg as pkg so that we save our cached "go build" output files
DOCKER_CMD = docker run --security-opt label:disable --rm -v $(PWD):/go/src/$(SC_PKG) \
-v $(PWD)/.pkg:/go/pkg scbuildimage
-v $(PWD)/.pkg:/go/pkg --env AZURE_STORAGE_CONNECTION_STRING scbuildimage
scBuildImageTarget = .scBuildImage
endif

Expand Down Expand Up @@ -176,8 +188,8 @@ $(BINDIR)/e2e.test: .init

# Util targets
##############
.PHONY: verify verify-generated verify-client-gen
verify: .init .generate_files verify-generated verify-client-gen verify-vendor
.PHONY: verify verify-generated verify-client-gen verify-docs
verify: .init .generate_files verify-generated verify-client-gen verify-docs verify-vendor
@echo Running gofmt:
@$(DOCKER_CMD) gofmt -l -s $(TOP_TEST_DIRS) $(TOP_SRC_DIRS)>.out 2>&1||true
@[ ! -s .out ] || \
Expand All @@ -204,13 +216,15 @@ verify: .init .generate_files verify-generated verify-client-gen verify-vendor
@[ ! -s .out ] || (cat .out && rm .out && false)
@rm .out
@#
@echo Running href checker$(SKIP_COMMENT):
@$(DOCKER_CMD) verify-links.sh -s .pkg -t $(SKIP_HTTP) .
@echo Running errexit checker:
@$(DOCKER_CMD) build/verify-errexit.sh
@echo Running tag verification:
@$(DOCKER_CMD) build/verify-tags.sh

verify-docs: .init
@echo Running href checker$(SKIP_COMMENT):
@$(DOCKER_CMD) verify-links.sh -s .pkg -t $(SKIP_HTTP) .

verify-generated: .init .generate_files
$(DOCKER_CMD) $(BUILD_DIR)/update-apiserver-gen.sh --verify-only

Expand Down Expand Up @@ -255,8 +269,8 @@ test-integration: .init $(scBuildImageTarget) build build-integration
# golang integration tests
$(DOCKER_CMD) test/integration.sh $(INT_TEST_FLAGS)

clean-e2e:
rm -f $(BINDIR)/e2e.test
clean-e2e: .init $(scBuildImageTarget)
$(DOCKER_CMD) rm -f $(BINDIR)/e2e.test

build-e2e: .generate_files $(BINDIR)/e2e.test

Expand All @@ -265,12 +279,12 @@ test-e2e: build-e2e

clean: clean-bin clean-build-image clean-generated clean-coverage

clean-bin:
rm -rf $(BINDIR)
clean-bin: .init $(scBuildImageTarget)
$(DOCKER_CMD) rm -rf $(BINDIR)
rm -f .generate_exes

clean-build-image:
rm -rf .pkg
clean-build-image: .init $(scBuildImageTarget)
$(DOCKER_CMD) rm -rf .pkg
rm -f .scBuildImage
docker rmi -f scbuildimage > /dev/null 2>&1 || true

Expand All @@ -289,11 +303,13 @@ clean-generated:
git checkout -- pkg/openapi/openapi_generated.go

# purge-generated removes generated files from the filesystem.
purge-generated:
find $(TOP_SRC_DIRS) -name zz_generated* -exec rm {} \;
find $(TOP_SRC_DIRS) -type d -name *_generated -exec rm -rf {} \;
rm -f pkg/openapi/openapi_generated.go
purge-generated: .init $(scBuildImageTarget)
find $(TOP_SRC_DIRS) -name zz_generated* -exec $(DOCKER_CMD) rm {} \;
find $(TOP_SRC_DIRS) -depth -type d -name *_generated \
-exec $(DOCKER_CMD) rm -rf {} \;
$(DOCKER_CMD) rm -f pkg/openapi/openapi_generated.go
echo 'package v1beta1' > pkg/apis/servicecatalog/v1beta1/types.generated.go
rm -f .generate_files

clean-coverage:
rm -f $(COVERAGE)
Expand Down Expand Up @@ -363,13 +379,30 @@ release-push-%:
$(MAKE) ARCH=$* build
$(MAKE) ARCH=$* push

# SvCat Kubectl plugin stuff
# svcat kubectl plugin
############################
.PHONY: $(BINDIR)/svcat
svcat: $(BINDIR)/svcat
$(BINDIR)/svcat: .init .generate_files cmd/svcat/main.go
.PHONY: $(BINDIR)/svcat/$(TAG_VERSION)/$(PLATFORM)/$(ARCH)/svcat$(FILE_EXT)
svcat:
# Compile a native binary for local dev/test
$(MAKE) svcat-for-$(CLIENT_PLATFORM)
cp $(BINDIR)/svcat/$(TAG_VERSION)/$(CLIENT_PLATFORM)/$(ARCH)/svcat$(FILE_EXT) $(BINDIR)/svcat/

svcat-all: $(addprefix svcat-for-,$(ALL_CLIENT_PLATFORM))

svcat-for-%:
$(MAKE) PLATFORM=$* VERSION=$(TAG_VERSION) svcat-xbuild

svcat-xbuild: $(BINDIR)/svcat/$(TAG_VERSION)/$(PLATFORM)/$(ARCH)/svcat$(FILE_EXT)
$(BINDIR)/svcat/$(TAG_VERSION)/$(PLATFORM)/$(ARCH)/svcat$(FILE_EXT): .init .generate_files
$(DOCKER_CMD) $(GO_BUILD) -o $@ $(SC_PKG)/cmd/svcat

svcat-publish: clean-bin svcat-all
# Download the latest client with https://download.svcat.sh/cli/latest/darwin/amd64/svcat
# Download an older client with https://download.svcat.sh/cli/VERSION/darwin/amd64/svcat
cp -R $(BINDIR)/svcat/$(TAG_VERSION) $(BINDIR)/svcat/$(MUTABLE_TAG)
# AZURE_STORAGE_CONNECTION_STRING will be used for auth in the following command
$(DOCKER_CMD) az storage blob upload-batch -d cli -s $(BINDIR)/svcat

# Dependency management via dep (https://golang.github.io/dep)
.PHONY: verify-vendor test-dep
verify-vendor: .init
Expand Down
6 changes: 6 additions & 0 deletions build/build-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ RUN go get -u github.com/golang/lint/golint
RUN git clone https://github.com/duglin/vlinker.git /vlinker
ENV PATH=$PATH:/vlinker/bin

# Install the azure client, used to publish svcat binaries
ENV AZCLI_VERSION=2.0.25
RUN apt-get update && apt-get install -y python-pip && \
rm -rf /var/lib/apt/lists/*
RUN pip install --disable-pip-version-check --no-cache-dir --upgrade cryptography azure-cli==${AZCLI_VERSION}

# Create the full dir tree that we'll mount our src into when we run the image
RUN mkdir -p /go/src/github.com/kubernetes-incubator/service-catalog

Expand Down
2 changes: 1 addition & 1 deletion charts/catalog/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: catalog
description: service-catalog API server and controller-manager helm chart
version: 0.1.8
version: 0.1.9
6 changes: 5 additions & 1 deletion charts/catalog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,18 @@ chart and their default values.

| Parameter | Description | Default |
|-----------|-------------|---------|
| `image` | apiserver image to use | `quay.io/kubernetes-service-catalog/service-catalog:v0.1.8` |
| `image` | apiserver image to use | `quay.io/kubernetes-service-catalog/service-catalog:v0.1.9` |
| `imagePullPolicy` | `imagePullPolicy` for the service catalog | `Always` |
| `apiserver.tls.requestHeaderCA` | Base64-encoded CA used to validate request-header authentication, when receiving delegated authentication from an aggregator. If not set, the service catalog API server will inherit this CA from the `extension-apiserver-authentication` ConfigMap if available. | `nil` |
| `apiserver.service.type` | Type of service; valid values are `LoadBalancer` and `NodePort` | `NodePort` |
| `apiserver.service.nodePort.securePort` | If service type is `NodePort`, specifies a port in allowable range (e.g. 30000 - 32767 on minikube); The TLS-enabled endpoint will be exposed here | `30443` |
| `apiserver.storage.type` | The storage backend to use; the only valid value is `etcd`, left for other storages support in future, e.g. `crd` | `etcd` |
| `apiserver.storage.etcd.useEmbedded` | If storage type is `etcd`: Whether to embed an etcd container in the apiserver pod; THIS IS INADEQUATE FOR PRODUCTION USE! | `true` |
| `apiserver.storage.etcd.servers` | If storage type is `etcd`: etcd URL(s); override this if NOT using embedded etcd | `http://localhost:2379` |
| `apiserver.storage.etcd.persistence.enabled` | Enable persistence using PVC | `false` |
| `apiserver.storage.etcd.persistence.storageClass` | PVC Storage Class | `nil` (uses alpha storage class annotation) |
| `apiserver.storage.etcd.persistence.accessMode` | PVC Access Mode | `ReadWriteOnce` |
| `apiserver.storage.etcd.persistence.size` | PVC Storage Request | `4Gi` |
| `apiserver.verbosity` | Log level; valid values are in the range 0 - 10 | `10` |
| `apiserver.auth.enabled` | Enable authentication and authorization | `true` |
| `controllerManager.verbosity` | Log level; valid values are in the range 0 - 10 | `10` |
Expand Down
7 changes: 6 additions & 1 deletion charts/catalog/templates/apiserver-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@ spec:
- key: requestheader-ca.crt
path: requestheader-ca.crt
{{- end }}
{{- if eq .Values.apiserver.storage.type "etcd" }}
{{- if and (eq .Values.apiserver.storage.type "etcd") .Values.apiserver.storage.etcd.useEmbedded }}
- name: etcd-data-dir
{{- if .Values.apiserver.storage.etcd.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.apiserver.storage.etcd.persistence.existingClaim | default (printf "%s-%s" (include "fullname" .) "etcd") }}
{{- else }}
emptyDir: {}
{{- end }}
{{- end }}
24 changes: 24 additions & 0 deletions charts/catalog/templates/etcd-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- if and (eq .Values.apiserver.storage.type "etcd") .Values.apiserver.storage.etcd.useEmbedded .Values.apiserver.storage.etcd.persistence.enabled (not .Values.apiserver.storage.etcd.persistence.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "fullname" . }}-etcd
labels:
app: {{ template "fullname" . }}-etcd
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
accessModes:
- {{ .Values.apiserver.storage.etcd.persistence.accessMode | quote }}
resources:
requests:
storage: {{ .Values.apiserver.storage.etcd.persistence.size | quote }}
{{- if .Values.apiserver.storage.etcd.persistence.storageClass }}
{{- if (eq "-" .Values.apiserver.storage.etcd.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.apiserver.storage.etcd.persistence.storageClass }}"
{{- end }}
{{- end }}
{{- end }}
14 changes: 13 additions & 1 deletion charts/catalog/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Default values for Service Catalog
# service-catalog image to use
image: quay.io/kubernetes-service-catalog/service-catalog:v0.1.8
image: quay.io/kubernetes-service-catalog/service-catalog:v0.1.9
# imagePullPolicy for the service-catalog; valid values are "IfNotPresent",
# "Never", and "Always"
imagePullPolicy: Always
Expand Down Expand Up @@ -56,6 +56,18 @@ apiserver:
useEmbedded: true
# etcd URL(s); override this if NOT using embedded etcd
servers: http://localhost:2379
# etcd persistence options IF using embedded etcd
persistence:
enabled: false
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, AWS & OpenStack)
##
# storageClass: "-"
accessMode: ReadWriteOnce
size: 4Gi
# Log level; valid values are in the range 0 - 10
verbosity: 10
auth:
Expand Down
2 changes: 1 addition & 1 deletion charts/ups-broker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Service Broker

| Parameter | Description | Default |
|-----------|-------------|---------|
| `image` | Image to use | `quay.io/kubernetes-service-catalog/user-broker:v0.1.8` |
| `image` | Image to use | `quay.io/kubernetes-service-catalog/user-broker:v0.1.9` |
| `imagePullPolicy` | `imagePullPolicy` for the ups-broker | `Always` |

Specify each parameter using the `--set key=value[,key=value]` argument to
Expand Down
2 changes: 1 addition & 1 deletion charts/ups-broker/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Default values for User-Provided Service Broker
# Image to use
image: quay.io/kubernetes-service-catalog/user-broker:v0.1.8
image: quay.io/kubernetes-service-catalog/user-broker:v0.1.9
# ImagePullPolicy; valid values are "IfNotPresent", "Never", and "Always"
imagePullPolicy: Always
# Certificate details to use for TLS. Leave blank to not use TLS
Expand Down
Loading

0 comments on commit fc02f43

Please sign in to comment.