Skip to content

Commit d6baafa

Browse files
Merge pull request #58393 from deads2k/agg-02-ga
Automatic merge from submit-queue (batch tested with PRs 54071, 58393). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. promote aggregation API to v1 Finishing kubernetes/enhancements#263 as discussed in apimachinery The API has been available since 1.6 and beta since 1.7. Openshift has been using it for about a year and service catalog (@pmorie) and metrics server (@piosz @DirectXMan12) have both been using too. The feature and the API have both been stable over that time. @kubernetes/sig-api-machinery-api-reviews @kubernetes/api-approvers /assign lavalamp /assign smarterclayton ```release-note Promoting the apiregistration.k8s.io (aggregation) to GA ``` Kubernetes-commit: 35ed5338b104f41c91efb2b842e92fded6d0b509
2 parents 147d8cd + 67ffb7a commit d6baafa

Some content is hidden

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

42 files changed

+3263
-14
lines changed

BUILD

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ filegroup(
5050
"//staging/src/k8s.io/kube-aggregator/pkg/client/informers/externalversions:all-srcs",
5151
"//staging/src/k8s.io/kube-aggregator/pkg/client/informers/internalversion:all-srcs",
5252
"//staging/src/k8s.io/kube-aggregator/pkg/client/listers/apiregistration/internalversion:all-srcs",
53+
"//staging/src/k8s.io/kube-aggregator/pkg/client/listers/apiregistration/v1:all-srcs",
5354
"//staging/src/k8s.io/kube-aggregator/pkg/client/listers/apiregistration/v1beta1:all-srcs",
5455
"//staging/src/k8s.io/kube-aggregator/pkg/cmd/server:all-srcs",
5556
"//staging/src/k8s.io/kube-aggregator/pkg/controllers:all-srcs",

hack/update-codegen.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,20 @@ INPUT_BASE="--input-base ${PREFIX}"
4949
INPUT_APIS=(
5050
apiregistration/
5151
apiregistration/v1beta1
52+
apiregistration/v1
5253
)
5354
INPUT="--input ${INPUT_APIS[@]}"
5455
CLIENTSET_PATH="--output-package k8s.io/kube-aggregator/pkg/client/clientset_generated"
5556

5657
${CLIENTGEN} ${INPUT_BASE} ${INPUT} ${CLIENTSET_PATH} --output-base ${SCRIPT_BASE}
57-
${CLIENTGEN} --clientset-name="clientset" ${INPUT_BASE} --input apiregistration/v1beta1 ${CLIENTSET_PATH} --output-base ${SCRIPT_BASE}
58+
${CLIENTGEN} --clientset-name="clientset" ${INPUT_BASE} --input apiregistration/v1beta1,apiregistration/v1 ${CLIENTSET_PATH} --output-base ${SCRIPT_BASE}
5859

5960

6061
echo "Building lister-gen"
6162
listergen="${PWD}/lister-gen"
6263
go build -o "${listergen}" ${CODEGEN_PKG}/cmd/lister-gen
6364

64-
LISTER_INPUT="--input-dirs k8s.io/kube-aggregator/pkg/apis/apiregistration --input-dirs k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1"
65+
LISTER_INPUT="--input-dirs k8s.io/kube-aggregator/pkg/apis/apiregistration --input-dirs k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1,k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
6566
LISTER_PATH="--output-package k8s.io/kube-aggregator/pkg/client/listers"
6667
${listergen} ${LISTER_INPUT} ${LISTER_PATH} --output-base ${SCRIPT_BASE}
6768

@@ -72,7 +73,7 @@ go build -o "${informergen}" ${CODEGEN_PKG}/cmd/informer-gen
7273

7374
${informergen} \
7475
--output-base ${SCRIPT_BASE} \
75-
--input-dirs k8s.io/kube-aggregator/pkg/apis/apiregistration --input-dirs k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1 \
76+
--input-dirs k8s.io/kube-aggregator/pkg/apis/apiregistration --input-dirs k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1,k8s.io/kube-aggregator/pkg/apis/apiregistration/v1 \
7677
--versioned-clientset-package k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset \
7778
--internal-clientset-package k8s.io/kube-aggregator/pkg/client/clientset_generated/internalclientset \
7879
--listers-package k8s.io/kube-aggregator/pkg/client/listers \

pkg/apis/apiregistration/BUILD

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ filegroup(
3434
srcs = [
3535
":package-srcs",
3636
"//staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/install:all-srcs",
37+
"//staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1:all-srcs",
3738
"//staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1:all-srcs",
3839
"//staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/validation:all-srcs",
3940
],

pkg/apis/apiregistration/install/BUILD

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ go_library(
1515
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
1616
"//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library",
1717
"//vendor/k8s.io/kube-aggregator/pkg/apis/apiregistration:go_default_library",
18+
"//vendor/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1:go_default_library",
1819
"//vendor/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1:go_default_library",
1920
],
2021
)

pkg/apis/apiregistration/install/install.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"k8s.io/apimachinery/pkg/runtime"
2323
"k8s.io/apimachinery/pkg/util/sets"
2424
"k8s.io/kube-aggregator/pkg/apis/apiregistration"
25+
"k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
2526
"k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1"
2627
)
2728

@@ -31,10 +32,11 @@ func Install(groupFactoryRegistry announced.APIGroupFactoryRegistry, registry *r
3132
&announced.GroupMetaFactoryArgs{
3233
GroupName: apiregistration.GroupName,
3334
RootScopedKinds: sets.NewString("APIService"),
34-
VersionPreferenceOrder: []string{v1beta1.SchemeGroupVersion.Version},
35+
VersionPreferenceOrder: []string{v1.SchemeGroupVersion.Version, v1beta1.SchemeGroupVersion.Version},
3536
AddInternalObjectsToScheme: apiregistration.AddToScheme,
3637
},
3738
announced.VersionToSchemeFunc{
39+
v1.SchemeGroupVersion.Version: v1.AddToScheme,
3840
v1beta1.SchemeGroupVersion.Version: v1beta1.AddToScheme,
3941
},
4042
).Announce(groupFactoryRegistry).RegisterAndEnable(registry, scheme); err != nil {

pkg/apis/apiregistration/v1/BUILD

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
load(
4+
"@io_bazel_rules_go//go:def.bzl",
5+
"go_library",
6+
)
7+
8+
go_library(
9+
name = "go_default_library",
10+
srcs = [
11+
"doc.go",
12+
"generated.pb.go",
13+
"register.go",
14+
"types.go",
15+
"zz_generated.conversion.go",
16+
"zz_generated.deepcopy.go",
17+
],
18+
importpath = "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1",
19+
deps = [
20+
"//vendor/github.com/gogo/protobuf/proto:go_default_library",
21+
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
22+
"//vendor/k8s.io/apimachinery/pkg/conversion:go_default_library",
23+
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
24+
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
25+
"//vendor/k8s.io/kube-aggregator/pkg/apis/apiregistration:go_default_library",
26+
],
27+
)
28+
29+
filegroup(
30+
name = "package-srcs",
31+
srcs = glob(["**"]),
32+
tags = ["automanaged"],
33+
visibility = ["//visibility:private"],
34+
)
35+
36+
filegroup(
37+
name = "all-srcs",
38+
srcs = [":package-srcs"],
39+
tags = ["automanaged"],
40+
)
41+
42+
filegroup(
43+
name = "go_default_library_protos",
44+
srcs = ["generated.proto"],
45+
visibility = ["//visibility:public"],
46+
)

pkg/apis/apiregistration/v1/doc.go

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
Copyright 2016 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// +k8s:deepcopy-gen=package
18+
// +k8s:conversion-gen=k8s.io/kube-aggregator/pkg/apis/apiregistration
19+
// +k8s:openapi-gen=true
20+
21+
// Package v1beta1 contains the API Registration API, which is responsible for
22+
// registering an API `Group`/`Version` with another kubernetes like API server.
23+
// The `APIService` holds information about the other API server in
24+
// `APIServiceSpec` type as well as general `TypeMeta` and `ObjectMeta`. The
25+
// `APIServiceSpec` type have the main configuration needed to do the
26+
// aggregation. Any request coming for specified `Group`/`Version` will be
27+
// directed to the service defined by `ServiceReference` (on port 443) after
28+
// validating the target using provided `CABundle` or skipping validation
29+
// if development flag `InsecureSkipTLSVerify` is set. `Priority` is controlling
30+
// the order of this API group in the overall discovery document.
31+
// The return status is a set of conditions for this aggregation. Currently
32+
// there is only one condition named "Available", if true, it means the
33+
// api/server requests will be redirected to specified API server.
34+
//
35+
// +groupName=apiregistration.k8s.io
36+
package v1 // import "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"

0 commit comments

Comments
 (0)