Skip to content

Commit 1cd2988

Browse files
author
Jeff Peeler
committed
Squashed 'cmd/service-catalog/go/src/github.com/kubernetes-incubator/service-catalog/' changes from 8f07b7b..7e650e7
7e650e7 origin build: add origin tooling f32eec2 unit test for ./pkg/rest/core/fake rest client, addresses #860 Test ready to be reviewed (#1113) e388aee explicitly always prefer latest OSBAPI Version (#1138) 962429e Merge branch 'pr/1135' b6ee7ef fix rbac cb1beb9 Merge branch 'pr/1131' ecc5c01 Update Code of Conduct (#1137) e7c5ab3 address one more PR comment ddcbbad address PR comments 652a83b fix test expectation to match the new error message for missing service class 33417cc address PR comments 565fccf Use the chart name instead of the namespace (#1102) bc61919 Add new terminal failure binding condition (#1057) 4e642d5 Added more detailed instructions on how to setup the repo (#1114) bdaea23 update unit tests (#1123) 88a9642 validate the apiserver options (#1116) b0af5fc fix whitespace in the copyright section dee796a generated type changes ef585c4 Rename the directory from default to defaultservicename to conform to go style guide. Wire admission controller into the apiserver 0b5d6c6 add firewall troubleshooting section (#1040) fd9e6bc Fix Typo in Events Code of Conduct (#1126) ebe6506 Fix Typo in Terminology (#1128) 0038b1e Merge branch 'pr/1122' 8411f31 make deprovisioning an instance asynchronously not fall-through to synchronous deprovision (#1067) 76c1d93 handle failures from list and test the not ready condition, cleanup 9241296 finish unit tests, passing ed75774 Minor fixes based on go report card 9911e8d Add GoReport Widget (#1121) dd24e5c clean up old cruft 08276c6 generated file changes 6489d90 Implement the default plan in admission controller a6bb576 Code: Instance/Binding parameters from secret (#1079) 10bb148 Update generated files (#1115) 5291e6f v0.0.15 (#1118) 28a1ea6 Merge branch 'pr/1104' bb4a2d2 Merge branch 'pr/1097' 1c14a90 push all arch images on release tags (#1108) b587b2c Improve log output for deprovision 8887561 Remove PodPreset embedding from Binding (#1030) 1abdcc8 Adjust helm/tiller installation instructions (#1091) f636f99 only skip tls verify if not behind the aggregator (#1101) 43b40ab controller_broker unit test bullet-proofing #1077 (#1099) bb596b8 Use data store instead of database (#1100) 04fa477 Implementation: Support for Bearer token auth between Service Catalog and brokers (#1053) 9e46d3c refactor Jenkins e2e tests (#1082) 1f0a41e remove old/misleading comments about only doing soft delete if it's "our turn--" i.e. only if the finalizer we care about is at the head of the finalizers list. 5c1d9b8 Update OSB client (#1085) a6e80ea Only do work for instances from a single queue (#1074) 2bd85d6 Merge branch 'pr/1076' e324287 Tweaks to the walkthrough for local-up-cluster d8b7899 Add a note to the walkthrough about getting bindings when using the aggregator (#1078) ea44cf1 msg on Environment Variables to set for e2e (#1070) d15554a Merge branch 'pr/1017' faf966e Add comment re: async race condition in integration tests ed2e096 v0.0.14 (#1071) fc84ffd more PR feedback 283bed4 Add integration tests and some error checking; PR feedback 903a7a7 Add terminal condition for instance and do not retry failed provisions REVERT: 8f07b7b origin: add required patches git-subtree-dir: cmd/service-catalog/go/src/github.com/kubernetes-incubator/service-catalog git-subtree-split: 7e650e7e39c3fc79a8ecc061cce2a70e899406ff
1 parent 099429c commit 1cd2988

File tree

80 files changed

+8661
-4526
lines changed

Some content is hidden

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

80 files changed

+8661
-4526
lines changed

Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,15 @@ node {
110110

111111
// Run through the walkthrough on the cluster, once with an etcd-backed API server and once
112112
// with a TPR-backed one.
113-
sh """${env.ROOT}/contrib/hack/test_walkthrough.sh \
113+
sh """${env.ROOT}/contrib/jenkins/test_walkthrough.sh \
114114
--registry gcr.io/${test_project}/catalog/ \
115115
--version ${version} \
116116
--cleanup \
117117
--fix-auth \
118118
--create-artifacts
119119
"""
120120

121-
sh """${env.ROOT}/contrib/hack/test_walkthrough.sh \
121+
sh """${env.ROOT}/contrib/jenkins/test_walkthrough.sh \
122122
--registry gcr.io/${test_project}/catalog/ \
123123
--version ${version} \
124124
--with-tpr \

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ $(BINDIR)/e2e.test: .init
214214
.PHONY: verify verify-client-gen
215215
verify: .init .generate_files verify-client-gen
216216
@echo Running gofmt:
217-
@$(DOCKER_CMD) gofmt -l -s $(TOP_SRC_DIRS) > .out 2>&1 || true
217+
@$(DOCKER_CMD) gofmt -l -s $(TOP_TEST_DIRS) $(TOP_SRC_DIRS) &> .out || true
218218
@bash -c '[ "`cat .out`" == "" ] || \
219219
(echo -e "\n*** Please 'gofmt' the following:" ; cat .out ; echo ; false)'
220220
@rm .out

ORIGIN-SYNC-README.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
This is a how-to for syncing the latest code from service-catalog and merging
2+
it into the openshift/origin repository.
3+
4+
Prerequisite setup:
5+
- git clone of service-catalog repo from https://github.com/kubernetes-incubator/service-catalog.git
6+
- $ git remote add openshift [email protected]:openshift/service-catalog.git
7+
- ensure there aren't any patches in the openshift/origin repo that need to be
8+
put in the openshift/service-catalog:origin-patches branch (git log
9+
cmd/service-catalog)
10+
11+
If patches need bringing over from openshift/origin, put them in the
12+
service-catalog:origin-patches branch. Then squash all the changes into the
13+
service-catalog:origin-patches-squashed branch. The reason this is important
14+
to do is because once the subtree merge is performed, anything under
15+
cmd/service-catalog/... will be overwritten. Also, make sure to rebase the
16+
origin-patches branch as needed.
17+
18+
# syncs the openshift/service-catalog repo with the upstream tag
19+
# (in service-catalog repo)
20+
$ TAG=v0.0.10
21+
$ git pull origin
22+
$ git push openshift $TAG
23+
24+
# updates code to latest tag and adds origin patches on top
25+
# (in service-catalog repo)
26+
$ git branch $TAG $TAG+origin
27+
$ git checkout $TAG+origin
28+
$ git cherry-pick <sha of origin-patches-squashed>
29+
$ git push openshift
30+
31+
# pulls in code from openshift/service-catalog repo into OpenShift
32+
# (in origin repo)
33+
$ git pull
34+
$ git subtree pull --prefix cmd/service-catalog/go/src/github.com/kubernetes-incubator/service-catalog https://github.com/openshift/service-catalog $TAG+origin --squash -m "Merge version $TAG of Service Catalog from https://github.com/openshift/service-catalog:$TAG+origin"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![Build Status](https://travis-ci.org/kubernetes-incubator/service-catalog.svg?branch=master)](https://travis-ci.org/kubernetes-incubator/service-catalog "Travis")
44
[![Build Status](https://service-catalog-jenkins.appspot.com/buildStatus/icon?job=service-catalog-master-testing)](https://service-catalog-jenkins.appspot.com/job/service-catalog-master-testing/ "Jenkins")
5+
[![Go Report Card](https://goreportcard.com/badge/github.com/kubernetes-incubator/service-catalog)](https://goreportcard.com/report/github.com/kubernetes-incubator/service-catalog)
56

67
### Introduction
78

charts/catalog/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ chart and their default values.
3939

4040
| Parameter | Description | Default |
4141
|-----------|-------------|---------|
42-
| `apiserver.image` | apiserver image to use | `quay.io/kubernetes-service-catalog/apiserver:v0.0.13` |
42+
| `apiserver.image` | apiserver image to use | `quay.io/kubernetes-service-catalog/apiserver:v0.0.15` |
4343
| `apiserver.imagePullPolicy` | `imagePullPolicy` for the apiserver | `Always` |
4444
| `apiserver.tls.cert` | Base64-encoded x509 certificate | A self-signed certificate |
4545
| `apiserver.tls.key` | Base64-encoded private key | The private key for the certificate above |
@@ -53,7 +53,7 @@ chart and their default values.
5353
| `apiserver.storage.tpr.globalNamespace` | If storage type is `tpr`: Some service catalog resources are not namespaced, but third party resources must be; setting this designates a namespace that will be treated as a container for such resources | `servicecatalog` |
5454
| `apiserver.verbosity` | Log level; valid values are in the range 0 - 10 | `10` |
5555
| `apiserver.auth.enabled` | Enable authentication and authorization | `false` |
56-
| `controllerManager.image` | controller-manager image to use | `quay.io/kubernetes-service-catalog/controller-manager:v0.0.13` |
56+
| `controllerManager.image` | controller-manager image to use | `quay.io/kubernetes-service-catalog/controller-manager:v0.0.15` |
5757
| `controllerManager.imagePullPolicy` | `imagePullPolicy` for the controller-manager | `Always` |
5858
| `controllerManager.verbosity` | Log level; valid values are in the range 0 - 10 | `10` |
5959
| `controllerManager.resyncInterval` | How often the controller should resync informers; duration format (`20m`, `1h`, etc) | `5m` |

charts/catalog/templates/apiserver-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ spec:
3838
- {{ .Values.apiserver.audit.logPath }}
3939
{{- end}}
4040
- --admission-control
41-
- "KubernetesNamespaceLifecycle"
41+
- "KubernetesNamespaceLifecycle,DefaultServicePlan"
4242
- --secure-port
4343
- "8443"
4444
- --storage-type

charts/catalog/templates/controller-manager-deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ spec:
5555
- --service-catalog-api-server-url
5656
- https://{{ template "fullname" . }}-apiserver
5757
{{- end }}
58+
{{ if and (.Values.controllerManager.apiserverSkipVerify) (not .Values.useAggregator) -}}
5859
- "--service-catalog-insecure-skip-verify=true"
60+
{{- end }}
5961
- -v
6062
- "{{ .Values.controllerManager.verbosity }}"
6163
- --resync-interval

charts/catalog/templates/rbac.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ items:
114114
- apiVersion: rbac.authorization.k8s.io/v1beta1
115115
kind: Role
116116
metadata:
117-
name: "servicecatalog.k8s.io::leader-locking-controller-manager"
117+
name: "servicecatalog.k8s.io:leader-locking-controller-manager"
118118
namespace: kube-system
119119
rules:
120120
- apiGroups: [""]
@@ -132,7 +132,7 @@ items:
132132
roleRef:
133133
apiGroup: rbac.authorization.k8s.io
134134
kind: Role
135-
name: service-catalog-controller-manager
135+
name: "servicecatalog.k8s.io:leader-locking-controller-manager"
136136
subjects:
137137
- apiGroup: ""
138138
kind: ServiceAccount

charts/catalog/values.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Default values for Service Catalog
2+
# determines whether the API server should be registered with the kube-aggregator
3+
useAggregator: false
24
apiserver:
35
# apiserver image to use
4-
image: quay.io/kubernetes-service-catalog/apiserver:v0.0.13
6+
image: quay.io/kubernetes-service-catalog/apiserver:v0.0.15
57
# imagePullPolicy for the apiserver; valid values are "IfNotPresent",
68
# "Never", and "Always"
79
imagePullPolicy: Always
@@ -70,7 +72,7 @@ apiserver:
7072
serviceAccount: service-catalog-apiserver
7173
controllerManager:
7274
# controller-manager image to use
73-
image: quay.io/kubernetes-service-catalog/controller-manager:v0.0.13
75+
image: quay.io/kubernetes-service-catalog/controller-manager:v0.0.15
7476
# imagePullPolicy for the controller-manager; valid values are
7577
# "IfNotPresent", "Never", and "Always"
7678
imagePullPolicy: Always
@@ -93,4 +95,5 @@ controllerManager:
9395
# Whether the controller has option to set leader election namespace.
9496
activated: false
9597
serviceAccount: service-catalog-controller-manager
96-
useAggregator: false
98+
# Controls whether the API server's TLS verification should be skipped.
99+
apiserverSkipVerify: true

charts/ups-broker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Service Broker
3434

3535
| Parameter | Description | Default |
3636
|-----------|-------------|---------|
37-
| `image` | Image to use | `quay.io/kubernetes-service-catalog/user-broker:v0.0.13` |
37+
| `image` | Image to use | `quay.io/kubernetes-service-catalog/user-broker:v0.0.15` |
3838
| `imagePullPolicy` | `imagePullPolicy` for the ups-broker | `Always` |
3939

4040
Specify each parameter using the `--set key=value[,key=value]` argument to

charts/ups-broker/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Default values for User-Provided Service Broker
22
# Image to use
3-
image: quay.io/kubernetes-service-catalog/user-broker:v0.0.13
3+
image: quay.io/kubernetes-service-catalog/user-broker:v0.0.15
44
# ImagePullPolicy; valid values are "IfNotPresent", "Never", and "Always"
55
imagePullPolicy: Always

cmd/apiserver/app/plugins.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ package app
2222
import (
2323
// Admission policies
2424
_ "github.com/kubernetes-incubator/service-catalog/plugin/pkg/admission/namespace/lifecycle"
25+
_ "github.com/kubernetes-incubator/service-catalog/plugin/pkg/admission/serviceplan/defaultserviceplan"
2526
)

cmd/apiserver/app/server/options.go

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ package server
1919
import (
2020
"os"
2121

22+
"github.com/golang/glog"
2223
"github.com/kubernetes-incubator/service-catalog/pkg/registry/servicecatalog/server"
2324
"github.com/spf13/pflag"
25+
utilerrors "k8s.io/apimachinery/pkg/util/errors"
2426
genericserveroptions "k8s.io/apiserver/pkg/server/options"
2527
)
2628

@@ -52,6 +54,21 @@ type ServiceCatalogServerOptions struct {
5254
StandaloneMode bool
5355
}
5456

57+
// NewServiceCatalogServerOptions creates a new instances of
58+
// ServiceCatalogServerOptions with all sub-options filled in.
59+
func NewServiceCatalogServerOptions() *ServiceCatalogServerOptions {
60+
return &ServiceCatalogServerOptions{
61+
GenericServerRunOptions: genericserveroptions.NewServerRunOptions(),
62+
AdmissionOptions: genericserveroptions.NewAdmissionOptions(),
63+
SecureServingOptions: genericserveroptions.NewSecureServingOptions(),
64+
AuthenticationOptions: genericserveroptions.NewDelegatingAuthenticationOptions(),
65+
AuthorizationOptions: genericserveroptions.NewDelegatingAuthorizationOptions(),
66+
AuditOptions: genericserveroptions.NewAuditOptions(),
67+
EtcdOptions: NewEtcdOptions(),
68+
TPROptions: NewTPROptions(),
69+
}
70+
}
71+
5572
func (s *ServiceCatalogServerOptions) addFlags(flags *pflag.FlagSet) {
5673
flags.StringVar(
5774
&s.StorageTypeString,
@@ -83,6 +100,32 @@ func (s *ServiceCatalogServerOptions) StorageType() (server.StorageType, error)
83100
return server.StorageTypeFromString(s.StorageTypeString)
84101
}
85102

103+
// Validate checks all subOptions flags have been set and that they
104+
// have not been set in a conflictory manner.
105+
func (s *ServiceCatalogServerOptions) Validate() error {
106+
errors := []error{}
107+
// TODO uncomment after 1.8 rebase expecting
108+
// https://github.com/kubernetes/kubernetes/pull/50308/files
109+
// errors = append(errors, s.AdmissionOptions.Validate()...)
110+
errors = append(errors, s.SecureServingOptions.Validate()...)
111+
errors = append(errors, s.AuthenticationOptions.Validate()...)
112+
errors = append(errors, s.AuthorizationOptions.Validate()...)
113+
// etcd options
114+
if "etcd" == s.StorageTypeString {
115+
etcdErrs := s.EtcdOptions.Validate()
116+
if len(etcdErrs) > 0 {
117+
glog.Errorln("Error validating etcd options, do you have `--etcd-servers localhost` set?")
118+
}
119+
errors = append(errors, etcdErrs...)
120+
}
121+
// TODO add alternative storage validation
122+
// errors = append(errors, s.TPROptions.Validate()...)
123+
// TODO uncomment after 1.8 rebase expecting
124+
// https://github.com/kubernetes/kubernetes/pull/47043
125+
// errors = append(errors, s.AuditOptions.Validate()...)
126+
return utilerrors.NewAggregate(errors)
127+
}
128+
86129
// standaloneMode returns true if the env var SERVICE_CATALOG_STANALONE=true
87130
// If enabled, we will assume no integration with Kubernetes API server is performed.
88131
// It is intended for testing purposes only.

cmd/apiserver/app/server/run_server.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ func RunServer(opts *ServiceCatalogServerOptions) error {
4343
if there is a need to stop the API server */
4444
opts.StopCh = make(chan struct{})
4545
}
46+
47+
err = opts.Validate()
48+
if nil != err {
49+
return err
50+
}
51+
4652
if storageType == server.StorageTypeTPR {
4753
return runTPRServer(opts)
4854
}
@@ -102,12 +108,6 @@ func runEtcdServer(opts *ServiceCatalogServerOptions) error {
102108
return err
103109
}
104110

105-
// etcd options
106-
if errs := etcdOpts.Validate(); len(errs) > 0 {
107-
glog.Errorln("Error validating etcd options, do you have `--etcd-servers localhost` set?")
108-
return errs[0]
109-
}
110-
111111
glog.V(4).Infoln("Creating storage factory")
112112

113113
// The API server stores objects using a particular API version for each

cmd/apiserver/app/server/run_server_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929

3030
// make sure RunServer returns with an error when TPR fails to install
3131
func TestRunServerInstallTPRFails(t *testing.T) {
32-
options := &ServiceCatalogServerOptions{}
32+
options := NewServiceCatalogServerOptions()
3333

3434
fakeClientset := &kubeclientfake.Clientset{}
3535
fakeClientset.AddReactor("get", "thirdpartyresources", func(core.Action) (bool, runtime.Object, error) {

cmd/apiserver/app/server/server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/kubernetes-incubator/service-catalog/pkg"
2626
"github.com/kubernetes-incubator/service-catalog/pkg/registry/servicecatalog/server"
2727
"github.com/kubernetes-incubator/service-catalog/plugin/pkg/admission/namespace/lifecycle"
28+
"github.com/kubernetes-incubator/service-catalog/plugin/pkg/admission/serviceplan/defaultserviceplan"
2829
"github.com/spf13/cobra"
2930
"k8s.io/apimachinery/pkg/runtime/schema"
3031
"k8s.io/apiserver/pkg/admission"
@@ -135,4 +136,5 @@ func NewCommandServer(
135136
// registerAllAdmissionPlugins registers all admission plugins
136137
func registerAllAdmissionPlugins(plugins *admission.Plugins) {
137138
lifecycle.Register(plugins)
139+
defaultserviceplan.Register(plugins)
138140
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const (
5050
defaultLeaderElectionNamespace = "kube-system"
5151
)
5252

53-
var defaultOSBAPIPreferredVersion = osb.Version2_12().HeaderValue()
53+
var defaultOSBAPIPreferredVersion = osb.LatestAPIVersion().HeaderValue()
5454

5555
// NewControllerManagerServer creates a new ControllerManagerServer with a
5656
// default config.

code-of-conduct.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ The Kubernetes team does not condone any statements by speakers contrary to thes
5252
team reserves the right to deny entrance and/or eject from an event (without refund) any individual found to
5353
be engaging in discriminatory or offensive speech or actions.
5454

55-
Please bring any concerns to to the immediate attention of Kubernetes event staff
55+
Please bring any concerns to the immediate attention of Kubernetes event staff.
5656

5757

5858
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/code-of-conduct.md?pixel)]()

contrib/examples/apiserver/broker.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ metadata:
44
name: test-broker
55
spec:
66
url: http://beefco.de
7-
# put the basic auth for the broker in a secret, and reference the secret here.
8-
# service-catalog will use the contents of the secret. The secret should have "username"
9-
# and "password" keys
7+
# Put the basic auth for the broker in a secret, and reference the secret here.
8+
# Service Catalog will use the contents of the secret. The secret should have "username"
9+
# and "password" keys.
10+
# Alternatively you can use bearer token auth for which the secret should have a
11+
# "token" key with bearer token.
1012
authInfo:
11-
basicAuthSecret:
12-
namespace: some-namespace
13-
name: secret-name
13+
basic:
14+
secretRef:
15+
namespace: some-namespace
16+
name: secret-name

contrib/examples/walkthrough/ups-binding-pp.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: servicecatalog.k8s.io/v1alpha1
2+
kind: Instance
3+
metadata:
4+
name: ups-instance-default
5+
namespace: test-ns
6+
spec:
7+
serviceClassName: user-provided-service
8+
parameters:
9+
credentials:
10+
name: root
11+
password: letmein

0 commit comments

Comments
 (0)