Skip to content

Commit 2f45bcb

Browse files
Merge pull request #59495 from ericchiang/client-auth-exec
Automatic merge from submit-queue. 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>. client-go: add an exec-based client auth provider Updates kubernetes/enhancements#541 Implements kubernetes/community#1503 Closes kubernetes/kubernetes#57164 ```release-note client-go: alpha support for exec-based credential providers ``` /sig auth /kind feature Kubernetes-commit: cb9d6b51556a1677f262e35e4aded0051c424818
2 parents d902e7d + 29c5d6f commit 2f45bcb

33 files changed

+2003
-33
lines changed

Godeps/Godeps.json

+29-29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/clientauthentication/BUILD

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_library")
2+
3+
go_library(
4+
name = "go_default_library",
5+
srcs = [
6+
"doc.go",
7+
"register.go",
8+
"types.go",
9+
"zz_generated.deepcopy.go",
10+
],
11+
importpath = "k8s.io/client-go/pkg/apis/clientauthentication",
12+
visibility = ["//visibility:public"],
13+
deps = [
14+
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
15+
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
16+
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
17+
],
18+
)
19+
20+
filegroup(
21+
name = "package-srcs",
22+
srcs = glob(["**"]),
23+
tags = ["automanaged"],
24+
visibility = ["//visibility:private"],
25+
)
26+
27+
filegroup(
28+
name = "all-srcs",
29+
srcs = [
30+
":package-srcs",
31+
"//staging/src/k8s.io/client-go/pkg/apis/clientauthentication/install:all-srcs",
32+
"//staging/src/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1:all-srcs",
33+
],
34+
tags = ["automanaged"],
35+
visibility = ["//visibility:public"],
36+
)

pkg/apis/clientauthentication/doc.go

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
Copyright 2018 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+
// +groupName=client.authentication.k8s.io
19+
package clientauthentication // import "k8s.io/client-go/pkg/apis/clientauthentication"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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 = ["install.go"],
11+
importpath = "k8s.io/client-go/pkg/apis/clientauthentication/install",
12+
deps = [
13+
"//vendor/k8s.io/apimachinery/pkg/apimachinery/announced:go_default_library",
14+
"//vendor/k8s.io/apimachinery/pkg/apimachinery/registered:go_default_library",
15+
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
16+
"//vendor/k8s.io/client-go/pkg/apis/clientauthentication:go_default_library",
17+
"//vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1:go_default_library",
18+
],
19+
)
20+
21+
filegroup(
22+
name = "package-srcs",
23+
srcs = glob(["**"]),
24+
tags = ["automanaged"],
25+
visibility = ["//visibility:private"],
26+
)
27+
28+
filegroup(
29+
name = "all-srcs",
30+
srcs = [":package-srcs"],
31+
tags = ["automanaged"],
32+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
Copyright 2017 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+
// Package install installs the experimental API group, making it available as
18+
// an option to all of the API encoding/decoding machinery.
19+
package install
20+
21+
import (
22+
"k8s.io/apimachinery/pkg/apimachinery/announced"
23+
"k8s.io/apimachinery/pkg/apimachinery/registered"
24+
"k8s.io/apimachinery/pkg/runtime"
25+
"k8s.io/client-go/pkg/apis/clientauthentication"
26+
"k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1"
27+
)
28+
29+
// Install registers the API group and adds types to a scheme
30+
func Install(groupFactoryRegistry announced.APIGroupFactoryRegistry, registry *registered.APIRegistrationManager, scheme *runtime.Scheme) {
31+
if err := announced.NewGroupMetaFactory(
32+
&announced.GroupMetaFactoryArgs{
33+
GroupName: clientauthentication.GroupName,
34+
VersionPreferenceOrder: []string{v1alpha1.SchemeGroupVersion.Version},
35+
AddInternalObjectsToScheme: clientauthentication.AddToScheme,
36+
},
37+
announced.VersionToSchemeFunc{
38+
v1alpha1.SchemeGroupVersion.Version: v1alpha1.AddToScheme,
39+
},
40+
).Announce(groupFactoryRegistry).RegisterAndEnable(registry, scheme); err != nil {
41+
panic(err)
42+
}
43+
}
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
Copyright 2018 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+
package clientauthentication
18+
19+
import (
20+
"k8s.io/apimachinery/pkg/runtime"
21+
"k8s.io/apimachinery/pkg/runtime/schema"
22+
)
23+
24+
// GroupName is the group name use in this package
25+
const GroupName = "client.authentication.k8s.io"
26+
27+
// SchemeGroupVersion is group version used to register these objects
28+
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}
29+
30+
// Kind takes an unqualified kind and returns a Group qualified GroupKind
31+
func Kind(kind string) schema.GroupKind {
32+
return SchemeGroupVersion.WithKind(kind).GroupKind()
33+
}
34+
35+
// Resource takes an unqualified resource and returns a Group qualified GroupResource
36+
func Resource(resource string) schema.GroupResource {
37+
return SchemeGroupVersion.WithResource(resource).GroupResource()
38+
}
39+
40+
var (
41+
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
42+
AddToScheme = SchemeBuilder.AddToScheme
43+
)
44+
45+
func addKnownTypes(scheme *runtime.Scheme) error {
46+
scheme.AddKnownTypes(SchemeGroupVersion,
47+
&ExecCredential{},
48+
)
49+
return nil
50+
}

0 commit comments

Comments
 (0)