Skip to content

Commit f3c7ab3

Browse files
Merge pull request #22907 from mfojtik/tsb-to-staging
staging: move template-service-broker to staging
2 parents 63918a0 + a8c8016 commit f3c7ab3

Some content is hidden

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

74 files changed

+2731
-262
lines changed

cmd/template-service-broker/tsb.go

-46
This file was deleted.

hack/import-restrictions.json

-36
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@
44
"github.com/openshift/origin/pkg"
55
],
66
"ignoredSubTrees": [
7-
"github.com/openshift/origin/pkg/templateservicebroker",
87
"github.com/openshift/origin/pkg/cmd/server/start"
98
],
10-
"forbiddenImportPackageRoots": [
11-
"github.com/openshift/origin/pkg/templateservicebroker"
12-
],
139
"allowedImportPackageRoots": [
1410
"vendor",
1511
""
@@ -403,38 +399,6 @@
403399
"allowedImportPackages": []
404400
},
405401

406-
{
407-
"checkedPackageRoots": [
408-
"github.com/openshift/origin/pkg/templateservicebroker"
409-
],
410-
"allowedImportPackageRoots": [
411-
"vendor/k8s.io/apimachinery",
412-
"vendor/k8s.io/apiserver",
413-
"vendor/k8s.io/client-go",
414-
"vendor/github.com/spf13/cobra",
415-
"vendor/golang.org",
416-
"vendor/github.com/openshift/api",
417-
"vendor/github.com/openshift/client-go",
418-
"github.com/openshift/origin/pkg/template/servicebroker"
419-
],
420-
"allowedImportPackages": [
421-
"vendor/k8s.io/klog",
422-
"vendor/k8s.io/api/core/v1",
423-
"vendor/k8s.io/api/authorization/v1",
424-
"vendor/k8s.io/kubernetes/pkg/apis/core",
425-
"vendor/k8s.io/kubernetes/pkg/apis/core/install",
426-
"vendor/github.com/emicklei/go-restful",
427-
"vendor/github.com/lestrrat/go-jsschema",
428-
"vendor/k8s.io/kube-aggregator/pkg/apiserver",
429-
"vendor/k8s.io/kubernetes/pkg/controller",
430-
"vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util",
431-
"github.com/openshift/origin/pkg/api",
432-
"github.com/openshift/origin/pkg/template/apis/template",
433-
"github.com/openshift/origin/pkg/template/apis/template/validation",
434-
"github.com/openshift/origin/pkg/api/legacy"
435-
]
436-
},
437-
438402
{
439403
"checkedPackageRoots": [
440404
"github.com/openshift/origin/pkg/oauthserver"

hack/update-generated-conversions.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ function codegen::join() { local IFS="$1"; shift; echo "$*"; }
1010

1111
# enumerate group versions
1212
ALL_FQ_APIS=(
13+
github.com/openshift/origin/staging/src/github.com/openshift/template-service-broker/apis/config/v1
14+
github.com/openshift/origin/staging/src/github.com/openshift/template-service-broker/apis/template/v1
15+
1316
github.com/openshift/origin/pkg/apps/apis/apps/v1
1417
github.com/openshift/origin/pkg/authorization/apis/authorization/v1
1518
github.com/openshift/origin/pkg/build/apis/build/v1
@@ -22,7 +25,6 @@ ALL_FQ_APIS=(
2225
github.com/openshift/origin/pkg/route/apis/route/v1
2326
github.com/openshift/origin/pkg/security/apis/security/v1
2427
github.com/openshift/origin/pkg/template/apis/template/v1
25-
github.com/openshift/origin/pkg/template/servicebroker/apis/config/v1
2628
github.com/openshift/origin/pkg/user/apis/user/v1
2729
)
2830

hack/update-generated-deep-copies.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ function codegen::join() { local IFS="$1"; shift; echo "$*"; }
1111

1212
# enumerate group versions
1313
ALL_FQ_APIS=(
14+
github.com/openshift/origin/staging/src/github.com/openshift/template-service-broker/apis/config
15+
github.com/openshift/origin/staging/src/github.com/openshift/template-service-broker/apis/config/v1
16+
github.com/openshift/origin/staging/src/github.com/openshift/template-service-broker/apis/template
17+
github.com/openshift/origin/staging/src/github.com/openshift/template-service-broker/apis/template/v1
18+
1419
github.com/openshift/origin/pkg/autoscaling/admission/apis/clusterresourceoverride
1520
github.com/openshift/origin/pkg/autoscaling/admission/apis/clusterresourceoverride/v1
1621
github.com/openshift/origin/pkg/autoscaling/admission/apis/runonceduration
@@ -29,8 +34,6 @@ ALL_FQ_APIS=(
2934
github.com/openshift/origin/pkg/network/admission/apis/externalipranger/v1
3035
github.com/openshift/origin/pkg/network/admission/apis/restrictedendpoints
3136
github.com/openshift/origin/pkg/network/admission/apis/restrictedendpoints/v1
32-
github.com/openshift/origin/pkg/template/servicebroker/apis/config
33-
github.com/openshift/origin/pkg/template/servicebroker/apis/config/v1
3437
github.com/openshift/origin/pkg/util/testing
3538
github.com/openshift/origin/pkg/apps/apis/apps
3639
github.com/openshift/origin/pkg/authorization/apis/authorization

hack/update-generated-defaulters.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ function codegen::join() { local IFS="$1"; shift; echo "$*"; }
1010

1111
# enumerate group versions
1212
ALL_FQ_APIS=(
13+
github.com/openshift/origin/staging/src/github.com/openshift/template-service-broker/apis/config/v1
1314
github.com/openshift/origin/pkg/apps/apis/apps/v1
1415
github.com/openshift/origin/pkg/authorization/apis/authorization/v1
1516
github.com/openshift/origin/pkg/build/apis/build/v1
@@ -22,7 +23,6 @@ ALL_FQ_APIS=(
2223
github.com/openshift/origin/pkg/route/apis/route/v1
2324
github.com/openshift/origin/pkg/security/apis/security/v1
2425
github.com/openshift/origin/pkg/template/apis/template/v1
25-
github.com/openshift/origin/pkg/template/servicebroker/apis/config/v1
2626
github.com/openshift/origin/pkg/user/apis/user/v1
2727
)
2828

hack/verify-imports.sh

+3
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,7 @@ os::cmd::expect_success "import-verifier ${OS_ROOT}/hack/import-restrictions.jso
2020
# quick and dirty check that nothing under vendored kubernetes imports something from origin
2121
os::cmd::expect_failure "egrep -r '\"github.com/openshift/origin/[^\"]+\"$' vendor/k8s.io/kubernetes"
2222

23+
# quick and dirty check that nothing under origin staging imports from openshift/origin
24+
os::cmd::expect_failure "go list -deps -test ./staging/src/github.com/openshift/... | grep 'openshift/origin/pkg'"
25+
2326
os::test::junit::declare_suite_end

images/template-service-broker/Dockerfile.rhel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.12 AS builder
22
WORKDIR /go/src/github.com/openshift/origin
33
COPY . .
4-
RUN make build WHAT=cmd/template-service-broker; \
4+
RUN make build WHAT=vendor/github.com/openshift/template-service-broker/cmd/template-service-broker; \
55
mkdir -p /tmp/build; \
66
cp /go/src/github.com/openshift/origin/_output/local/bin/linux/$(go env GOARCH)/template-service-broker /tmp/build/template-service-broker
77

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
reviewers:
2+
- smarterclayton
3+
- mfojtik
4+
- bparees
5+
- soltysh
6+
- adambkaplan
7+
approvers:
8+
- smarterclayton
9+
- mfojtik
10+
- bparees
11+
- soltysh
12+
- adambkaplan
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
### TODO: ADD README.md here

pkg/template/servicebroker/apis/config/install/install.go staging/src/github.com/openshift/template-service-broker/apis/config/install/install.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"k8s.io/apimachinery/pkg/runtime"
55
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
66

7-
configapi "github.com/openshift/origin/pkg/template/servicebroker/apis/config"
8-
configapiv1 "github.com/openshift/origin/pkg/template/servicebroker/apis/config/v1"
7+
configapi "github.com/openshift/template-service-broker/apis/config"
8+
configapiv1 "github.com/openshift/template-service-broker/apis/config/v1"
99
)
1010

1111
// Install registers the API group and adds types to a scheme

pkg/template/servicebroker/apis/config/v1/doc.go staging/src/github.com/openshift/template-service-broker/apis/config/v1/doc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// +k8s:deepcopy-gen=package,register
2-
// +k8s:conversion-gen=github.com/openshift/origin/pkg/template/servicebroker/apis/config
2+
// +k8s:conversion-gen=github.com/openshift/template-service-broker/apis/config
33
// +k8s:defaulter-gen=TypeMeta
44

55
// +groupName=config.templateservicebroker.openshift.io

pkg/template/servicebroker/apis/config/v1/zz_generated.conversion.go staging/src/github.com/openshift/template-service-broker/apis/config/v1/zz_generated.conversion.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package template
2+
3+
// annotation keys
4+
const (
5+
// IconClassAnnotation is the rss class of an icon representing a template
6+
IconClassAnnotation = "iconClass"
7+
8+
// ServiceBrokerRoot is the API root of the template service broker.
9+
ServiceBrokerRoot = "/brokers/template.openshift.io"
10+
11+
// ServiceMetadataIconClass is the key for the template iconClass as returned
12+
// in the services.metadata map from a service broker catalog response
13+
ServiceMetadataIconClass = "console.openshift.io/iconClass"
14+
15+
// TemplateUIDIndex is the name of an index on the generated template lister,
16+
// initialised and used by the template service broker.
17+
TemplateUIDIndex = "templateuid"
18+
19+
// ExposeAnnotationPrefix indicates that part of an object in a template
20+
// should be exposed in some way, for example implying that it should be
21+
// returned by the template service broker in the results of a bind call.
22+
// The rest of the annotation name following the prefix may be used by the
23+
// exposer as a key name. The annotation value is a Kubernetes JSONPath
24+
// template expression which the exposer uses to calculate the exposed
25+
// value. JSONPath expressions which return multiple and/or complex objects
26+
// are not permitted (with the exception of []byte, which is permitted).
27+
// Any []byte values returned are converted to strings.
28+
ExposeAnnotationPrefix = "template.openshift.io/expose-"
29+
30+
// Base64ExposeAnnotationPrefix is as ExposeAnnotationPrefix, except that
31+
// any []byte values returned are base64 encoded.
32+
Base64ExposeAnnotationPrefix = "template.openshift.io/base64-expose-"
33+
34+
// WaitForReadyAnnotation indicates that the TemplateInstance controller
35+
// should wait for the object to be ready before reporting the template
36+
// instantiation complete.
37+
WaitForReadyAnnotation = "template.alpha.openshift.io/wait-for-ready"
38+
39+
// BindableAnnotation indicates whether the template service broker should
40+
// advertise the template as being bindable (default is true)
41+
BindableAnnotation = "template.openshift.io/bindable"
42+
43+
// TemplateInstanceFinalizer is used to clean up the objects created by the template instance,
44+
// when the template instance is deleted.
45+
TemplateInstanceFinalizer = "template.openshift.io/finalizer"
46+
47+
// TemplateInstanceOwner is a label applied to all objects created from a template instance
48+
// which contains the uid of the template instance.
49+
TemplateInstanceOwner = "template.openshift.io/template-instance-owner"
50+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// +k8s:deepcopy-gen=package,register
2+
3+
// +groupName=template.openshift.io
4+
// Package api is the internal version of the API.
5+
package template
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package install
2+
3+
import (
4+
"k8s.io/apimachinery/pkg/runtime"
5+
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
6+
"k8s.io/kubernetes/pkg/api/legacyscheme"
7+
8+
templatev1 "github.com/openshift/api/template/v1"
9+
templateapiv1 "github.com/openshift/template-service-broker/apis/template/v1"
10+
)
11+
12+
func init() {
13+
Install(legacyscheme.Scheme)
14+
}
15+
16+
// Install registers the API group and adds types to a scheme
17+
func Install(scheme *runtime.Scheme) {
18+
utilruntime.Must(templateapiv1.Install(scheme))
19+
utilruntime.Must(scheme.SetVersionPriority(templatev1.GroupVersion))
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package template
2+
3+
import (
4+
"k8s.io/apimachinery/pkg/runtime"
5+
"k8s.io/apimachinery/pkg/runtime/schema"
6+
"k8s.io/kubernetes/pkg/apis/core"
7+
)
8+
9+
const (
10+
GroupName = "template.openshift.io"
11+
)
12+
13+
var (
14+
schemeBuilder = runtime.NewSchemeBuilder(
15+
addKnownTypes,
16+
core.AddToScheme,
17+
)
18+
Install = schemeBuilder.AddToScheme
19+
20+
// DEPRECATED kept for generated code
21+
SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}
22+
// DEPRECATED kept for generated code
23+
AddToScheme = schemeBuilder.AddToScheme
24+
)
25+
26+
// Resource kept for generated code
27+
// DEPRECATED
28+
func Resource(resource string) schema.GroupResource {
29+
return SchemeGroupVersion.WithResource(resource).GroupResource()
30+
}
31+
32+
// Adds the list of known types to api.Scheme.
33+
func addKnownTypes(scheme *runtime.Scheme) error {
34+
scheme.AddKnownTypes(SchemeGroupVersion,
35+
&Template{},
36+
&TemplateList{},
37+
&TemplateInstance{},
38+
&TemplateInstanceList{},
39+
&BrokerTemplateInstance{},
40+
&BrokerTemplateInstanceList{},
41+
)
42+
return nil
43+
}

0 commit comments

Comments
 (0)