mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
vendor update for E2E framework
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
49
vendor/k8s.io/kubernetes/pkg/apis/rbac/v1/defaults.go
generated
vendored
Normal file
49
vendor/k8s.io/kubernetes/pkg/apis/rbac/v1/defaults.go
generated
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
rbacv1 "k8s.io/api/rbac/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
func addDefaultingFuncs(scheme *runtime.Scheme) error {
|
||||
return RegisterDefaults(scheme)
|
||||
}
|
||||
|
||||
func SetDefaults_ClusterRoleBinding(obj *rbacv1.ClusterRoleBinding) {
|
||||
if len(obj.RoleRef.APIGroup) == 0 {
|
||||
obj.RoleRef.APIGroup = GroupName
|
||||
}
|
||||
}
|
||||
func SetDefaults_RoleBinding(obj *rbacv1.RoleBinding) {
|
||||
if len(obj.RoleRef.APIGroup) == 0 {
|
||||
obj.RoleRef.APIGroup = GroupName
|
||||
}
|
||||
}
|
||||
func SetDefaults_Subject(obj *rbacv1.Subject) {
|
||||
if len(obj.APIGroup) == 0 {
|
||||
switch obj.Kind {
|
||||
case rbacv1.ServiceAccountKind:
|
||||
obj.APIGroup = ""
|
||||
case rbacv1.UserKind:
|
||||
obj.APIGroup = GroupName
|
||||
case rbacv1.GroupKind:
|
||||
obj.APIGroup = GroupName
|
||||
}
|
||||
}
|
||||
}
|
25
vendor/k8s.io/kubernetes/pkg/apis/rbac/v1/doc.go
generated
vendored
Normal file
25
vendor/k8s.io/kubernetes/pkg/apis/rbac/v1/doc.go
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/rbac
|
||||
// +k8s:conversion-gen-external-types=k8s.io/api/rbac/v1
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
// +k8s:defaulter-gen-input=../../../../vendor/k8s.io/api/rbac/v1
|
||||
// +k8s:deepcopy-gen=package
|
||||
|
||||
// +groupName=rbac.authorization.k8s.io
|
||||
|
||||
package v1 // import "k8s.io/kubernetes/pkg/apis/rbac/v1"
|
179
vendor/k8s.io/kubernetes/pkg/apis/rbac/v1/evaluation_helpers.go
generated
vendored
Normal file
179
vendor/k8s.io/kubernetes/pkg/apis/rbac/v1/evaluation_helpers.go
generated
vendored
Normal file
@ -0,0 +1,179 @@
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
rbacv1 "k8s.io/api/rbac/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
func RoleRefGroupKind(roleRef rbacv1.RoleRef) schema.GroupKind {
|
||||
return schema.GroupKind{Group: roleRef.APIGroup, Kind: roleRef.Kind}
|
||||
}
|
||||
|
||||
func VerbMatches(rule *rbacv1.PolicyRule, requestedVerb string) bool {
|
||||
for _, ruleVerb := range rule.Verbs {
|
||||
if ruleVerb == rbacv1.VerbAll {
|
||||
return true
|
||||
}
|
||||
if ruleVerb == requestedVerb {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func APIGroupMatches(rule *rbacv1.PolicyRule, requestedGroup string) bool {
|
||||
for _, ruleGroup := range rule.APIGroups {
|
||||
if ruleGroup == rbacv1.APIGroupAll {
|
||||
return true
|
||||
}
|
||||
if ruleGroup == requestedGroup {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func ResourceMatches(rule *rbacv1.PolicyRule, combinedRequestedResource, requestedSubresource string) bool {
|
||||
for _, ruleResource := range rule.Resources {
|
||||
// if everything is allowed, we match
|
||||
if ruleResource == rbacv1.ResourceAll {
|
||||
return true
|
||||
}
|
||||
// if we have an exact match, we match
|
||||
if ruleResource == combinedRequestedResource {
|
||||
return true
|
||||
}
|
||||
|
||||
// We can also match a */subresource.
|
||||
// if there isn't a subresource, then continue
|
||||
if len(requestedSubresource) == 0 {
|
||||
continue
|
||||
}
|
||||
// if the rule isn't in the format */subresource, then we don't match, continue
|
||||
if len(ruleResource) == len(requestedSubresource)+2 &&
|
||||
strings.HasPrefix(ruleResource, "*/") &&
|
||||
strings.HasSuffix(ruleResource, requestedSubresource) {
|
||||
return true
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func ResourceNameMatches(rule *rbacv1.PolicyRule, requestedName string) bool {
|
||||
if len(rule.ResourceNames) == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
for _, ruleName := range rule.ResourceNames {
|
||||
if ruleName == requestedName {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func NonResourceURLMatches(rule *rbacv1.PolicyRule, requestedURL string) bool {
|
||||
for _, ruleURL := range rule.NonResourceURLs {
|
||||
if ruleURL == rbacv1.NonResourceAll {
|
||||
return true
|
||||
}
|
||||
if ruleURL == requestedURL {
|
||||
return true
|
||||
}
|
||||
if strings.HasSuffix(ruleURL, "*") && strings.HasPrefix(requestedURL, strings.TrimRight(ruleURL, "*")) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// subjectsStrings returns users, groups, serviceaccounts, unknown for display purposes.
|
||||
func SubjectsStrings(subjects []rbacv1.Subject) ([]string, []string, []string, []string) {
|
||||
users := []string{}
|
||||
groups := []string{}
|
||||
sas := []string{}
|
||||
others := []string{}
|
||||
|
||||
for _, subject := range subjects {
|
||||
switch subject.Kind {
|
||||
case rbacv1.ServiceAccountKind:
|
||||
sas = append(sas, fmt.Sprintf("%s/%s", subject.Namespace, subject.Name))
|
||||
|
||||
case rbacv1.UserKind:
|
||||
users = append(users, subject.Name)
|
||||
|
||||
case rbacv1.GroupKind:
|
||||
groups = append(groups, subject.Name)
|
||||
|
||||
default:
|
||||
others = append(others, fmt.Sprintf("%s/%s/%s", subject.Kind, subject.Namespace, subject.Name))
|
||||
}
|
||||
}
|
||||
|
||||
return users, groups, sas, others
|
||||
}
|
||||
|
||||
func String(r rbacv1.PolicyRule) string {
|
||||
return "PolicyRule" + CompactString(r)
|
||||
}
|
||||
|
||||
// CompactString exposes a compact string representation for use in escalation error messages
|
||||
func CompactString(r rbacv1.PolicyRule) string {
|
||||
formatStringParts := []string{}
|
||||
formatArgs := []interface{}{}
|
||||
if len(r.APIGroups) > 0 {
|
||||
formatStringParts = append(formatStringParts, "APIGroups:%q")
|
||||
formatArgs = append(formatArgs, r.APIGroups)
|
||||
}
|
||||
if len(r.Resources) > 0 {
|
||||
formatStringParts = append(formatStringParts, "Resources:%q")
|
||||
formatArgs = append(formatArgs, r.Resources)
|
||||
}
|
||||
if len(r.NonResourceURLs) > 0 {
|
||||
formatStringParts = append(formatStringParts, "NonResourceURLs:%q")
|
||||
formatArgs = append(formatArgs, r.NonResourceURLs)
|
||||
}
|
||||
if len(r.ResourceNames) > 0 {
|
||||
formatStringParts = append(formatStringParts, "ResourceNames:%q")
|
||||
formatArgs = append(formatArgs, r.ResourceNames)
|
||||
}
|
||||
if len(r.Verbs) > 0 {
|
||||
formatStringParts = append(formatStringParts, "Verbs:%q")
|
||||
formatArgs = append(formatArgs, r.Verbs)
|
||||
}
|
||||
formatString := "{" + strings.Join(formatStringParts, ", ") + "}"
|
||||
return fmt.Sprintf(formatString, formatArgs...)
|
||||
}
|
||||
|
||||
type SortableRuleSlice []rbacv1.PolicyRule
|
||||
|
||||
func (s SortableRuleSlice) Len() int { return len(s) }
|
||||
func (s SortableRuleSlice) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
|
||||
func (s SortableRuleSlice) Less(i, j int) bool {
|
||||
return strings.Compare(s[i].String(), s[j].String()) < 0
|
||||
}
|
247
vendor/k8s.io/kubernetes/pkg/apis/rbac/v1/helpers.go
generated
vendored
Normal file
247
vendor/k8s.io/kubernetes/pkg/apis/rbac/v1/helpers.go
generated
vendored
Normal file
@ -0,0 +1,247 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
rbacv1 "k8s.io/api/rbac/v1"
|
||||
|
||||
"sort"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// +k8s:deepcopy-gen=false
|
||||
|
||||
// PolicyRuleBuilder let's us attach methods. A no-no for API types.
|
||||
// We use it to construct rules in code. It's more compact than trying to write them
|
||||
// out in a literal and allows us to perform some basic checking during construction
|
||||
type PolicyRuleBuilder struct {
|
||||
PolicyRule rbacv1.PolicyRule `protobuf:"bytes,1,opt,name=policyRule"`
|
||||
}
|
||||
|
||||
func NewRule(verbs ...string) *PolicyRuleBuilder {
|
||||
return &PolicyRuleBuilder{
|
||||
PolicyRule: rbacv1.PolicyRule{Verbs: verbs},
|
||||
}
|
||||
}
|
||||
|
||||
func (r *PolicyRuleBuilder) Groups(groups ...string) *PolicyRuleBuilder {
|
||||
r.PolicyRule.APIGroups = append(r.PolicyRule.APIGroups, groups...)
|
||||
return r
|
||||
}
|
||||
|
||||
func (r *PolicyRuleBuilder) Resources(resources ...string) *PolicyRuleBuilder {
|
||||
r.PolicyRule.Resources = append(r.PolicyRule.Resources, resources...)
|
||||
return r
|
||||
}
|
||||
|
||||
func (r *PolicyRuleBuilder) Names(names ...string) *PolicyRuleBuilder {
|
||||
r.PolicyRule.ResourceNames = append(r.PolicyRule.ResourceNames, names...)
|
||||
return r
|
||||
}
|
||||
|
||||
func (r *PolicyRuleBuilder) URLs(urls ...string) *PolicyRuleBuilder {
|
||||
r.PolicyRule.NonResourceURLs = append(r.PolicyRule.NonResourceURLs, urls...)
|
||||
return r
|
||||
}
|
||||
|
||||
func (r *PolicyRuleBuilder) RuleOrDie() rbacv1.PolicyRule {
|
||||
ret, err := r.Rule()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func (r *PolicyRuleBuilder) Rule() (rbacv1.PolicyRule, error) {
|
||||
if len(r.PolicyRule.Verbs) == 0 {
|
||||
return rbacv1.PolicyRule{}, fmt.Errorf("verbs are required: %#v", r.PolicyRule)
|
||||
}
|
||||
|
||||
switch {
|
||||
case len(r.PolicyRule.NonResourceURLs) > 0:
|
||||
if len(r.PolicyRule.APIGroups) != 0 || len(r.PolicyRule.Resources) != 0 || len(r.PolicyRule.ResourceNames) != 0 {
|
||||
return rbacv1.PolicyRule{}, fmt.Errorf("non-resource rule may not have apiGroups, resources, or resourceNames: %#v", r.PolicyRule)
|
||||
}
|
||||
case len(r.PolicyRule.Resources) > 0:
|
||||
if len(r.PolicyRule.NonResourceURLs) != 0 {
|
||||
return rbacv1.PolicyRule{}, fmt.Errorf("resource rule may not have nonResourceURLs: %#v", r.PolicyRule)
|
||||
}
|
||||
if len(r.PolicyRule.APIGroups) == 0 {
|
||||
// this a common bug
|
||||
return rbacv1.PolicyRule{}, fmt.Errorf("resource rule must have apiGroups: %#v", r.PolicyRule)
|
||||
}
|
||||
default:
|
||||
return rbacv1.PolicyRule{}, fmt.Errorf("a rule must have either nonResourceURLs or resources: %#v", r.PolicyRule)
|
||||
}
|
||||
|
||||
sort.Strings(r.PolicyRule.Resources)
|
||||
sort.Strings(r.PolicyRule.ResourceNames)
|
||||
sort.Strings(r.PolicyRule.APIGroups)
|
||||
sort.Strings(r.PolicyRule.NonResourceURLs)
|
||||
sort.Strings(r.PolicyRule.Verbs)
|
||||
return r.PolicyRule, nil
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen=false
|
||||
|
||||
// ClusterRoleBindingBuilder let's us attach methods. A no-no for API types.
|
||||
// We use it to construct bindings in code. It's more compact than trying to write them
|
||||
// out in a literal.
|
||||
type ClusterRoleBindingBuilder struct {
|
||||
ClusterRoleBinding rbacv1.ClusterRoleBinding `protobuf:"bytes,1,opt,name=clusterRoleBinding"`
|
||||
}
|
||||
|
||||
func NewClusterBinding(clusterRoleName string) *ClusterRoleBindingBuilder {
|
||||
return &ClusterRoleBindingBuilder{
|
||||
ClusterRoleBinding: rbacv1.ClusterRoleBinding{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: clusterRoleName},
|
||||
RoleRef: rbacv1.RoleRef{
|
||||
APIGroup: GroupName,
|
||||
Kind: "ClusterRole",
|
||||
Name: clusterRoleName,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (r *ClusterRoleBindingBuilder) Groups(groups ...string) *ClusterRoleBindingBuilder {
|
||||
for _, group := range groups {
|
||||
r.ClusterRoleBinding.Subjects = append(r.ClusterRoleBinding.Subjects, rbacv1.Subject{APIGroup: rbacv1.GroupName, Kind: rbacv1.GroupKind, Name: group})
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
func (r *ClusterRoleBindingBuilder) Users(users ...string) *ClusterRoleBindingBuilder {
|
||||
for _, user := range users {
|
||||
r.ClusterRoleBinding.Subjects = append(r.ClusterRoleBinding.Subjects, rbacv1.Subject{APIGroup: rbacv1.GroupName, Kind: rbacv1.UserKind, Name: user})
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
func (r *ClusterRoleBindingBuilder) SAs(namespace string, serviceAccountNames ...string) *ClusterRoleBindingBuilder {
|
||||
for _, saName := range serviceAccountNames {
|
||||
r.ClusterRoleBinding.Subjects = append(r.ClusterRoleBinding.Subjects, rbacv1.Subject{Kind: rbacv1.ServiceAccountKind, Namespace: namespace, Name: saName})
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
func (r *ClusterRoleBindingBuilder) BindingOrDie() rbacv1.ClusterRoleBinding {
|
||||
ret, err := r.Binding()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func (r *ClusterRoleBindingBuilder) Binding() (rbacv1.ClusterRoleBinding, error) {
|
||||
if len(r.ClusterRoleBinding.Subjects) == 0 {
|
||||
return rbacv1.ClusterRoleBinding{}, fmt.Errorf("subjects are required: %#v", r.ClusterRoleBinding)
|
||||
}
|
||||
|
||||
return r.ClusterRoleBinding, nil
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen=false
|
||||
|
||||
// RoleBindingBuilder let's us attach methods. It is similar to
|
||||
// ClusterRoleBindingBuilder above.
|
||||
type RoleBindingBuilder struct {
|
||||
RoleBinding rbacv1.RoleBinding
|
||||
}
|
||||
|
||||
// NewRoleBinding creates a RoleBinding builder that can be used
|
||||
// to define the subjects of a role binding. At least one of
|
||||
// the `Groups`, `Users` or `SAs` method must be called before
|
||||
// calling the `Binding*` methods.
|
||||
func NewRoleBinding(roleName, namespace string) *RoleBindingBuilder {
|
||||
return &RoleBindingBuilder{
|
||||
RoleBinding: rbacv1.RoleBinding{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: roleName,
|
||||
Namespace: namespace,
|
||||
},
|
||||
RoleRef: rbacv1.RoleRef{
|
||||
APIGroup: GroupName,
|
||||
Kind: "Role",
|
||||
Name: roleName,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func NewRoleBindingForClusterRole(roleName, namespace string) *RoleBindingBuilder {
|
||||
return &RoleBindingBuilder{
|
||||
RoleBinding: rbacv1.RoleBinding{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: roleName,
|
||||
Namespace: namespace,
|
||||
},
|
||||
RoleRef: rbacv1.RoleRef{
|
||||
APIGroup: GroupName,
|
||||
Kind: "ClusterRole",
|
||||
Name: roleName,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// Groups adds the specified groups as the subjects of the RoleBinding.
|
||||
func (r *RoleBindingBuilder) Groups(groups ...string) *RoleBindingBuilder {
|
||||
for _, group := range groups {
|
||||
r.RoleBinding.Subjects = append(r.RoleBinding.Subjects, rbacv1.Subject{Kind: rbacv1.GroupKind, APIGroup: GroupName, Name: group})
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// Users adds the specified users as the subjects of the RoleBinding.
|
||||
func (r *RoleBindingBuilder) Users(users ...string) *RoleBindingBuilder {
|
||||
for _, user := range users {
|
||||
r.RoleBinding.Subjects = append(r.RoleBinding.Subjects, rbacv1.Subject{Kind: rbacv1.UserKind, APIGroup: GroupName, Name: user})
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// SAs adds the specified service accounts as the subjects of the
|
||||
// RoleBinding.
|
||||
func (r *RoleBindingBuilder) SAs(namespace string, serviceAccountNames ...string) *RoleBindingBuilder {
|
||||
for _, saName := range serviceAccountNames {
|
||||
r.RoleBinding.Subjects = append(r.RoleBinding.Subjects, rbacv1.Subject{Kind: rbacv1.ServiceAccountKind, Namespace: namespace, Name: saName})
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// BindingOrDie calls the binding method and panics if there is an error.
|
||||
func (r *RoleBindingBuilder) BindingOrDie() rbacv1.RoleBinding {
|
||||
ret, err := r.Binding()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
// Binding builds and returns the RoleBinding API object from the builder
|
||||
// object.
|
||||
func (r *RoleBindingBuilder) Binding() (rbacv1.RoleBinding, error) {
|
||||
if len(r.RoleBinding.Subjects) == 0 {
|
||||
return rbacv1.RoleBinding{}, fmt.Errorf("subjects are required: %#v", r.RoleBinding)
|
||||
}
|
||||
|
||||
return r.RoleBinding, nil
|
||||
}
|
44
vendor/k8s.io/kubernetes/pkg/apis/rbac/v1/register.go
generated
vendored
Normal file
44
vendor/k8s.io/kubernetes/pkg/apis/rbac/v1/register.go
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
rbacv1 "k8s.io/api/rbac/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
const GroupName = "rbac.authorization.k8s.io"
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
|
||||
var (
|
||||
localSchemeBuilder = &rbacv1.SchemeBuilder
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
func init() {
|
||||
// We only register manually written functions here. The registration of the
|
||||
// generated functions takes place in the generated files. The separation
|
||||
// makes the code compile even when the generated files are missing.
|
||||
localSchemeBuilder.Register(addDefaultingFuncs)
|
||||
}
|
449
vendor/k8s.io/kubernetes/pkg/apis/rbac/v1/zz_generated.conversion.go
generated
vendored
Normal file
449
vendor/k8s.io/kubernetes/pkg/apis/rbac/v1/zz_generated.conversion.go
generated
vendored
Normal file
@ -0,0 +1,449 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by conversion-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
unsafe "unsafe"
|
||||
|
||||
v1 "k8s.io/api/rbac/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
conversion "k8s.io/apimachinery/pkg/conversion"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
rbac "k8s.io/kubernetes/pkg/apis/rbac"
|
||||
)
|
||||
|
||||
func init() {
|
||||
localSchemeBuilder.Register(RegisterConversions)
|
||||
}
|
||||
|
||||
// RegisterConversions adds conversion functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
func RegisterConversions(s *runtime.Scheme) error {
|
||||
if err := s.AddGeneratedConversionFunc((*v1.AggregationRule)(nil), (*rbac.AggregationRule)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_AggregationRule_To_rbac_AggregationRule(a.(*v1.AggregationRule), b.(*rbac.AggregationRule), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*rbac.AggregationRule)(nil), (*v1.AggregationRule)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_rbac_AggregationRule_To_v1_AggregationRule(a.(*rbac.AggregationRule), b.(*v1.AggregationRule), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.ClusterRole)(nil), (*rbac.ClusterRole)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_ClusterRole_To_rbac_ClusterRole(a.(*v1.ClusterRole), b.(*rbac.ClusterRole), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*rbac.ClusterRole)(nil), (*v1.ClusterRole)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_rbac_ClusterRole_To_v1_ClusterRole(a.(*rbac.ClusterRole), b.(*v1.ClusterRole), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.ClusterRoleBinding)(nil), (*rbac.ClusterRoleBinding)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_ClusterRoleBinding_To_rbac_ClusterRoleBinding(a.(*v1.ClusterRoleBinding), b.(*rbac.ClusterRoleBinding), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*rbac.ClusterRoleBinding)(nil), (*v1.ClusterRoleBinding)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_rbac_ClusterRoleBinding_To_v1_ClusterRoleBinding(a.(*rbac.ClusterRoleBinding), b.(*v1.ClusterRoleBinding), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.ClusterRoleBindingList)(nil), (*rbac.ClusterRoleBindingList)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_ClusterRoleBindingList_To_rbac_ClusterRoleBindingList(a.(*v1.ClusterRoleBindingList), b.(*rbac.ClusterRoleBindingList), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*rbac.ClusterRoleBindingList)(nil), (*v1.ClusterRoleBindingList)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_rbac_ClusterRoleBindingList_To_v1_ClusterRoleBindingList(a.(*rbac.ClusterRoleBindingList), b.(*v1.ClusterRoleBindingList), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.ClusterRoleList)(nil), (*rbac.ClusterRoleList)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_ClusterRoleList_To_rbac_ClusterRoleList(a.(*v1.ClusterRoleList), b.(*rbac.ClusterRoleList), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*rbac.ClusterRoleList)(nil), (*v1.ClusterRoleList)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_rbac_ClusterRoleList_To_v1_ClusterRoleList(a.(*rbac.ClusterRoleList), b.(*v1.ClusterRoleList), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.PolicyRule)(nil), (*rbac.PolicyRule)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_PolicyRule_To_rbac_PolicyRule(a.(*v1.PolicyRule), b.(*rbac.PolicyRule), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*rbac.PolicyRule)(nil), (*v1.PolicyRule)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_rbac_PolicyRule_To_v1_PolicyRule(a.(*rbac.PolicyRule), b.(*v1.PolicyRule), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.Role)(nil), (*rbac.Role)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_Role_To_rbac_Role(a.(*v1.Role), b.(*rbac.Role), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*rbac.Role)(nil), (*v1.Role)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_rbac_Role_To_v1_Role(a.(*rbac.Role), b.(*v1.Role), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.RoleBinding)(nil), (*rbac.RoleBinding)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_RoleBinding_To_rbac_RoleBinding(a.(*v1.RoleBinding), b.(*rbac.RoleBinding), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*rbac.RoleBinding)(nil), (*v1.RoleBinding)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_rbac_RoleBinding_To_v1_RoleBinding(a.(*rbac.RoleBinding), b.(*v1.RoleBinding), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.RoleBindingList)(nil), (*rbac.RoleBindingList)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_RoleBindingList_To_rbac_RoleBindingList(a.(*v1.RoleBindingList), b.(*rbac.RoleBindingList), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*rbac.RoleBindingList)(nil), (*v1.RoleBindingList)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_rbac_RoleBindingList_To_v1_RoleBindingList(a.(*rbac.RoleBindingList), b.(*v1.RoleBindingList), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.RoleList)(nil), (*rbac.RoleList)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_RoleList_To_rbac_RoleList(a.(*v1.RoleList), b.(*rbac.RoleList), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*rbac.RoleList)(nil), (*v1.RoleList)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_rbac_RoleList_To_v1_RoleList(a.(*rbac.RoleList), b.(*v1.RoleList), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.RoleRef)(nil), (*rbac.RoleRef)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_RoleRef_To_rbac_RoleRef(a.(*v1.RoleRef), b.(*rbac.RoleRef), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*rbac.RoleRef)(nil), (*v1.RoleRef)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_rbac_RoleRef_To_v1_RoleRef(a.(*rbac.RoleRef), b.(*v1.RoleRef), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.Subject)(nil), (*rbac.Subject)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_Subject_To_rbac_Subject(a.(*v1.Subject), b.(*rbac.Subject), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*rbac.Subject)(nil), (*v1.Subject)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_rbac_Subject_To_v1_Subject(a.(*rbac.Subject), b.(*v1.Subject), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_v1_AggregationRule_To_rbac_AggregationRule(in *v1.AggregationRule, out *rbac.AggregationRule, s conversion.Scope) error {
|
||||
out.ClusterRoleSelectors = *(*[]metav1.LabelSelector)(unsafe.Pointer(&in.ClusterRoleSelectors))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_AggregationRule_To_rbac_AggregationRule is an autogenerated conversion function.
|
||||
func Convert_v1_AggregationRule_To_rbac_AggregationRule(in *v1.AggregationRule, out *rbac.AggregationRule, s conversion.Scope) error {
|
||||
return autoConvert_v1_AggregationRule_To_rbac_AggregationRule(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_rbac_AggregationRule_To_v1_AggregationRule(in *rbac.AggregationRule, out *v1.AggregationRule, s conversion.Scope) error {
|
||||
out.ClusterRoleSelectors = *(*[]metav1.LabelSelector)(unsafe.Pointer(&in.ClusterRoleSelectors))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_rbac_AggregationRule_To_v1_AggregationRule is an autogenerated conversion function.
|
||||
func Convert_rbac_AggregationRule_To_v1_AggregationRule(in *rbac.AggregationRule, out *v1.AggregationRule, s conversion.Scope) error {
|
||||
return autoConvert_rbac_AggregationRule_To_v1_AggregationRule(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_ClusterRole_To_rbac_ClusterRole(in *v1.ClusterRole, out *rbac.ClusterRole, s conversion.Scope) error {
|
||||
out.ObjectMeta = in.ObjectMeta
|
||||
out.Rules = *(*[]rbac.PolicyRule)(unsafe.Pointer(&in.Rules))
|
||||
out.AggregationRule = (*rbac.AggregationRule)(unsafe.Pointer(in.AggregationRule))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_ClusterRole_To_rbac_ClusterRole is an autogenerated conversion function.
|
||||
func Convert_v1_ClusterRole_To_rbac_ClusterRole(in *v1.ClusterRole, out *rbac.ClusterRole, s conversion.Scope) error {
|
||||
return autoConvert_v1_ClusterRole_To_rbac_ClusterRole(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_rbac_ClusterRole_To_v1_ClusterRole(in *rbac.ClusterRole, out *v1.ClusterRole, s conversion.Scope) error {
|
||||
out.ObjectMeta = in.ObjectMeta
|
||||
out.Rules = *(*[]v1.PolicyRule)(unsafe.Pointer(&in.Rules))
|
||||
out.AggregationRule = (*v1.AggregationRule)(unsafe.Pointer(in.AggregationRule))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_rbac_ClusterRole_To_v1_ClusterRole is an autogenerated conversion function.
|
||||
func Convert_rbac_ClusterRole_To_v1_ClusterRole(in *rbac.ClusterRole, out *v1.ClusterRole, s conversion.Scope) error {
|
||||
return autoConvert_rbac_ClusterRole_To_v1_ClusterRole(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_ClusterRoleBinding_To_rbac_ClusterRoleBinding(in *v1.ClusterRoleBinding, out *rbac.ClusterRoleBinding, s conversion.Scope) error {
|
||||
out.ObjectMeta = in.ObjectMeta
|
||||
out.Subjects = *(*[]rbac.Subject)(unsafe.Pointer(&in.Subjects))
|
||||
if err := Convert_v1_RoleRef_To_rbac_RoleRef(&in.RoleRef, &out.RoleRef, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_ClusterRoleBinding_To_rbac_ClusterRoleBinding is an autogenerated conversion function.
|
||||
func Convert_v1_ClusterRoleBinding_To_rbac_ClusterRoleBinding(in *v1.ClusterRoleBinding, out *rbac.ClusterRoleBinding, s conversion.Scope) error {
|
||||
return autoConvert_v1_ClusterRoleBinding_To_rbac_ClusterRoleBinding(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_rbac_ClusterRoleBinding_To_v1_ClusterRoleBinding(in *rbac.ClusterRoleBinding, out *v1.ClusterRoleBinding, s conversion.Scope) error {
|
||||
out.ObjectMeta = in.ObjectMeta
|
||||
out.Subjects = *(*[]v1.Subject)(unsafe.Pointer(&in.Subjects))
|
||||
if err := Convert_rbac_RoleRef_To_v1_RoleRef(&in.RoleRef, &out.RoleRef, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_rbac_ClusterRoleBinding_To_v1_ClusterRoleBinding is an autogenerated conversion function.
|
||||
func Convert_rbac_ClusterRoleBinding_To_v1_ClusterRoleBinding(in *rbac.ClusterRoleBinding, out *v1.ClusterRoleBinding, s conversion.Scope) error {
|
||||
return autoConvert_rbac_ClusterRoleBinding_To_v1_ClusterRoleBinding(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_ClusterRoleBindingList_To_rbac_ClusterRoleBindingList(in *v1.ClusterRoleBindingList, out *rbac.ClusterRoleBindingList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]rbac.ClusterRoleBinding)(unsafe.Pointer(&in.Items))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_ClusterRoleBindingList_To_rbac_ClusterRoleBindingList is an autogenerated conversion function.
|
||||
func Convert_v1_ClusterRoleBindingList_To_rbac_ClusterRoleBindingList(in *v1.ClusterRoleBindingList, out *rbac.ClusterRoleBindingList, s conversion.Scope) error {
|
||||
return autoConvert_v1_ClusterRoleBindingList_To_rbac_ClusterRoleBindingList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_rbac_ClusterRoleBindingList_To_v1_ClusterRoleBindingList(in *rbac.ClusterRoleBindingList, out *v1.ClusterRoleBindingList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]v1.ClusterRoleBinding)(unsafe.Pointer(&in.Items))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_rbac_ClusterRoleBindingList_To_v1_ClusterRoleBindingList is an autogenerated conversion function.
|
||||
func Convert_rbac_ClusterRoleBindingList_To_v1_ClusterRoleBindingList(in *rbac.ClusterRoleBindingList, out *v1.ClusterRoleBindingList, s conversion.Scope) error {
|
||||
return autoConvert_rbac_ClusterRoleBindingList_To_v1_ClusterRoleBindingList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_ClusterRoleList_To_rbac_ClusterRoleList(in *v1.ClusterRoleList, out *rbac.ClusterRoleList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]rbac.ClusterRole)(unsafe.Pointer(&in.Items))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_ClusterRoleList_To_rbac_ClusterRoleList is an autogenerated conversion function.
|
||||
func Convert_v1_ClusterRoleList_To_rbac_ClusterRoleList(in *v1.ClusterRoleList, out *rbac.ClusterRoleList, s conversion.Scope) error {
|
||||
return autoConvert_v1_ClusterRoleList_To_rbac_ClusterRoleList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_rbac_ClusterRoleList_To_v1_ClusterRoleList(in *rbac.ClusterRoleList, out *v1.ClusterRoleList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]v1.ClusterRole)(unsafe.Pointer(&in.Items))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_rbac_ClusterRoleList_To_v1_ClusterRoleList is an autogenerated conversion function.
|
||||
func Convert_rbac_ClusterRoleList_To_v1_ClusterRoleList(in *rbac.ClusterRoleList, out *v1.ClusterRoleList, s conversion.Scope) error {
|
||||
return autoConvert_rbac_ClusterRoleList_To_v1_ClusterRoleList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_PolicyRule_To_rbac_PolicyRule(in *v1.PolicyRule, out *rbac.PolicyRule, s conversion.Scope) error {
|
||||
out.Verbs = *(*[]string)(unsafe.Pointer(&in.Verbs))
|
||||
out.APIGroups = *(*[]string)(unsafe.Pointer(&in.APIGroups))
|
||||
out.Resources = *(*[]string)(unsafe.Pointer(&in.Resources))
|
||||
out.ResourceNames = *(*[]string)(unsafe.Pointer(&in.ResourceNames))
|
||||
out.NonResourceURLs = *(*[]string)(unsafe.Pointer(&in.NonResourceURLs))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_PolicyRule_To_rbac_PolicyRule is an autogenerated conversion function.
|
||||
func Convert_v1_PolicyRule_To_rbac_PolicyRule(in *v1.PolicyRule, out *rbac.PolicyRule, s conversion.Scope) error {
|
||||
return autoConvert_v1_PolicyRule_To_rbac_PolicyRule(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_rbac_PolicyRule_To_v1_PolicyRule(in *rbac.PolicyRule, out *v1.PolicyRule, s conversion.Scope) error {
|
||||
out.Verbs = *(*[]string)(unsafe.Pointer(&in.Verbs))
|
||||
out.APIGroups = *(*[]string)(unsafe.Pointer(&in.APIGroups))
|
||||
out.Resources = *(*[]string)(unsafe.Pointer(&in.Resources))
|
||||
out.ResourceNames = *(*[]string)(unsafe.Pointer(&in.ResourceNames))
|
||||
out.NonResourceURLs = *(*[]string)(unsafe.Pointer(&in.NonResourceURLs))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_rbac_PolicyRule_To_v1_PolicyRule is an autogenerated conversion function.
|
||||
func Convert_rbac_PolicyRule_To_v1_PolicyRule(in *rbac.PolicyRule, out *v1.PolicyRule, s conversion.Scope) error {
|
||||
return autoConvert_rbac_PolicyRule_To_v1_PolicyRule(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_Role_To_rbac_Role(in *v1.Role, out *rbac.Role, s conversion.Scope) error {
|
||||
out.ObjectMeta = in.ObjectMeta
|
||||
out.Rules = *(*[]rbac.PolicyRule)(unsafe.Pointer(&in.Rules))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_Role_To_rbac_Role is an autogenerated conversion function.
|
||||
func Convert_v1_Role_To_rbac_Role(in *v1.Role, out *rbac.Role, s conversion.Scope) error {
|
||||
return autoConvert_v1_Role_To_rbac_Role(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_rbac_Role_To_v1_Role(in *rbac.Role, out *v1.Role, s conversion.Scope) error {
|
||||
out.ObjectMeta = in.ObjectMeta
|
||||
out.Rules = *(*[]v1.PolicyRule)(unsafe.Pointer(&in.Rules))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_rbac_Role_To_v1_Role is an autogenerated conversion function.
|
||||
func Convert_rbac_Role_To_v1_Role(in *rbac.Role, out *v1.Role, s conversion.Scope) error {
|
||||
return autoConvert_rbac_Role_To_v1_Role(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_RoleBinding_To_rbac_RoleBinding(in *v1.RoleBinding, out *rbac.RoleBinding, s conversion.Scope) error {
|
||||
out.ObjectMeta = in.ObjectMeta
|
||||
out.Subjects = *(*[]rbac.Subject)(unsafe.Pointer(&in.Subjects))
|
||||
if err := Convert_v1_RoleRef_To_rbac_RoleRef(&in.RoleRef, &out.RoleRef, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_RoleBinding_To_rbac_RoleBinding is an autogenerated conversion function.
|
||||
func Convert_v1_RoleBinding_To_rbac_RoleBinding(in *v1.RoleBinding, out *rbac.RoleBinding, s conversion.Scope) error {
|
||||
return autoConvert_v1_RoleBinding_To_rbac_RoleBinding(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_rbac_RoleBinding_To_v1_RoleBinding(in *rbac.RoleBinding, out *v1.RoleBinding, s conversion.Scope) error {
|
||||
out.ObjectMeta = in.ObjectMeta
|
||||
out.Subjects = *(*[]v1.Subject)(unsafe.Pointer(&in.Subjects))
|
||||
if err := Convert_rbac_RoleRef_To_v1_RoleRef(&in.RoleRef, &out.RoleRef, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_rbac_RoleBinding_To_v1_RoleBinding is an autogenerated conversion function.
|
||||
func Convert_rbac_RoleBinding_To_v1_RoleBinding(in *rbac.RoleBinding, out *v1.RoleBinding, s conversion.Scope) error {
|
||||
return autoConvert_rbac_RoleBinding_To_v1_RoleBinding(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_RoleBindingList_To_rbac_RoleBindingList(in *v1.RoleBindingList, out *rbac.RoleBindingList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]rbac.RoleBinding)(unsafe.Pointer(&in.Items))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_RoleBindingList_To_rbac_RoleBindingList is an autogenerated conversion function.
|
||||
func Convert_v1_RoleBindingList_To_rbac_RoleBindingList(in *v1.RoleBindingList, out *rbac.RoleBindingList, s conversion.Scope) error {
|
||||
return autoConvert_v1_RoleBindingList_To_rbac_RoleBindingList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_rbac_RoleBindingList_To_v1_RoleBindingList(in *rbac.RoleBindingList, out *v1.RoleBindingList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]v1.RoleBinding)(unsafe.Pointer(&in.Items))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_rbac_RoleBindingList_To_v1_RoleBindingList is an autogenerated conversion function.
|
||||
func Convert_rbac_RoleBindingList_To_v1_RoleBindingList(in *rbac.RoleBindingList, out *v1.RoleBindingList, s conversion.Scope) error {
|
||||
return autoConvert_rbac_RoleBindingList_To_v1_RoleBindingList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_RoleList_To_rbac_RoleList(in *v1.RoleList, out *rbac.RoleList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]rbac.Role)(unsafe.Pointer(&in.Items))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_RoleList_To_rbac_RoleList is an autogenerated conversion function.
|
||||
func Convert_v1_RoleList_To_rbac_RoleList(in *v1.RoleList, out *rbac.RoleList, s conversion.Scope) error {
|
||||
return autoConvert_v1_RoleList_To_rbac_RoleList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_rbac_RoleList_To_v1_RoleList(in *rbac.RoleList, out *v1.RoleList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]v1.Role)(unsafe.Pointer(&in.Items))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_rbac_RoleList_To_v1_RoleList is an autogenerated conversion function.
|
||||
func Convert_rbac_RoleList_To_v1_RoleList(in *rbac.RoleList, out *v1.RoleList, s conversion.Scope) error {
|
||||
return autoConvert_rbac_RoleList_To_v1_RoleList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_RoleRef_To_rbac_RoleRef(in *v1.RoleRef, out *rbac.RoleRef, s conversion.Scope) error {
|
||||
out.APIGroup = in.APIGroup
|
||||
out.Kind = in.Kind
|
||||
out.Name = in.Name
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_RoleRef_To_rbac_RoleRef is an autogenerated conversion function.
|
||||
func Convert_v1_RoleRef_To_rbac_RoleRef(in *v1.RoleRef, out *rbac.RoleRef, s conversion.Scope) error {
|
||||
return autoConvert_v1_RoleRef_To_rbac_RoleRef(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_rbac_RoleRef_To_v1_RoleRef(in *rbac.RoleRef, out *v1.RoleRef, s conversion.Scope) error {
|
||||
out.APIGroup = in.APIGroup
|
||||
out.Kind = in.Kind
|
||||
out.Name = in.Name
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_rbac_RoleRef_To_v1_RoleRef is an autogenerated conversion function.
|
||||
func Convert_rbac_RoleRef_To_v1_RoleRef(in *rbac.RoleRef, out *v1.RoleRef, s conversion.Scope) error {
|
||||
return autoConvert_rbac_RoleRef_To_v1_RoleRef(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_Subject_To_rbac_Subject(in *v1.Subject, out *rbac.Subject, s conversion.Scope) error {
|
||||
out.Kind = in.Kind
|
||||
out.APIGroup = in.APIGroup
|
||||
out.Name = in.Name
|
||||
out.Namespace = in.Namespace
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_Subject_To_rbac_Subject is an autogenerated conversion function.
|
||||
func Convert_v1_Subject_To_rbac_Subject(in *v1.Subject, out *rbac.Subject, s conversion.Scope) error {
|
||||
return autoConvert_v1_Subject_To_rbac_Subject(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_rbac_Subject_To_v1_Subject(in *rbac.Subject, out *v1.Subject, s conversion.Scope) error {
|
||||
out.Kind = in.Kind
|
||||
out.APIGroup = in.APIGroup
|
||||
out.Name = in.Name
|
||||
out.Namespace = in.Namespace
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_rbac_Subject_To_v1_Subject is an autogenerated conversion function.
|
||||
func Convert_rbac_Subject_To_v1_Subject(in *rbac.Subject, out *v1.Subject, s conversion.Scope) error {
|
||||
return autoConvert_rbac_Subject_To_v1_Subject(in, out, s)
|
||||
}
|
94
vendor/k8s.io/kubernetes/pkg/apis/rbac/v1/zz_generated.deepcopy.go
generated
vendored
Normal file
94
vendor/k8s.io/kubernetes/pkg/apis/rbac/v1/zz_generated.deepcopy.go
generated
vendored
Normal file
@ -0,0 +1,94 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by deepcopy-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterRoleBindingBuilder) DeepCopyInto(out *ClusterRoleBindingBuilder) {
|
||||
*out = *in
|
||||
in.ClusterRoleBinding.DeepCopyInto(&out.ClusterRoleBinding)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRoleBindingBuilder.
|
||||
func (in *ClusterRoleBindingBuilder) DeepCopy() *ClusterRoleBindingBuilder {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterRoleBindingBuilder)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PolicyRuleBuilder) DeepCopyInto(out *PolicyRuleBuilder) {
|
||||
*out = *in
|
||||
in.PolicyRule.DeepCopyInto(&out.PolicyRule)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyRuleBuilder.
|
||||
func (in *PolicyRuleBuilder) DeepCopy() *PolicyRuleBuilder {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PolicyRuleBuilder)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RoleBindingBuilder) DeepCopyInto(out *RoleBindingBuilder) {
|
||||
*out = *in
|
||||
in.RoleBinding.DeepCopyInto(&out.RoleBinding)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleBindingBuilder.
|
||||
func (in *RoleBindingBuilder) DeepCopy() *RoleBindingBuilder {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(RoleBindingBuilder)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in SortableRuleSlice) DeepCopyInto(out *SortableRuleSlice) {
|
||||
{
|
||||
in := &in
|
||||
*out = make(SortableRuleSlice, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SortableRuleSlice.
|
||||
func (in SortableRuleSlice) DeepCopy() SortableRuleSlice {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(SortableRuleSlice)
|
||||
in.DeepCopyInto(out)
|
||||
return *out
|
||||
}
|
67
vendor/k8s.io/kubernetes/pkg/apis/rbac/v1/zz_generated.defaults.go
generated
vendored
Normal file
67
vendor/k8s.io/kubernetes/pkg/apis/rbac/v1/zz_generated.defaults.go
generated
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by defaulter-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "k8s.io/api/rbac/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// RegisterDefaults adds defaulters functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
// All generated defaulters are covering - they call all nested defaulters.
|
||||
func RegisterDefaults(scheme *runtime.Scheme) error {
|
||||
scheme.AddTypeDefaultingFunc(&v1.ClusterRoleBinding{}, func(obj interface{}) { SetObjectDefaults_ClusterRoleBinding(obj.(*v1.ClusterRoleBinding)) })
|
||||
scheme.AddTypeDefaultingFunc(&v1.ClusterRoleBindingList{}, func(obj interface{}) { SetObjectDefaults_ClusterRoleBindingList(obj.(*v1.ClusterRoleBindingList)) })
|
||||
scheme.AddTypeDefaultingFunc(&v1.RoleBinding{}, func(obj interface{}) { SetObjectDefaults_RoleBinding(obj.(*v1.RoleBinding)) })
|
||||
scheme.AddTypeDefaultingFunc(&v1.RoleBindingList{}, func(obj interface{}) { SetObjectDefaults_RoleBindingList(obj.(*v1.RoleBindingList)) })
|
||||
return nil
|
||||
}
|
||||
|
||||
func SetObjectDefaults_ClusterRoleBinding(in *v1.ClusterRoleBinding) {
|
||||
SetDefaults_ClusterRoleBinding(in)
|
||||
for i := range in.Subjects {
|
||||
a := &in.Subjects[i]
|
||||
SetDefaults_Subject(a)
|
||||
}
|
||||
}
|
||||
|
||||
func SetObjectDefaults_ClusterRoleBindingList(in *v1.ClusterRoleBindingList) {
|
||||
for i := range in.Items {
|
||||
a := &in.Items[i]
|
||||
SetObjectDefaults_ClusterRoleBinding(a)
|
||||
}
|
||||
}
|
||||
|
||||
func SetObjectDefaults_RoleBinding(in *v1.RoleBinding) {
|
||||
SetDefaults_RoleBinding(in)
|
||||
for i := range in.Subjects {
|
||||
a := &in.Subjects[i]
|
||||
SetDefaults_Subject(a)
|
||||
}
|
||||
}
|
||||
|
||||
func SetObjectDefaults_RoleBindingList(in *v1.RoleBindingList) {
|
||||
for i := range in.Items {
|
||||
a := &in.Items[i]
|
||||
SetObjectDefaults_RoleBinding(a)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user