| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
package v1 |
| 20 |
|
| 21 |
import ( |
| 22 |
context "context" |
| 23 |
|
| 24 |
rbacv1 "k8s.io/api/rbac/v1" |
| 25 |
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 26 |
types "k8s.io/apimachinery/pkg/types" |
| 27 |
watch "k8s.io/apimachinery/pkg/watch" |
| 28 |
applyconfigurationsrbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" |
| 29 |
gentype "k8s.io/client-go/gentype" |
| 30 |
scheme "k8s.io/client-go/kubernetes/scheme" |
| 31 |
) |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
type ClusterRolesGetter interface { |
| 36 |
ClusterRoles() ClusterRoleInterface |
| 37 |
} |
| 38 |
|
| 39 |
|
| 40 |
type ClusterRoleInterface interface { |
| 41 |
Create(ctx context.Context, clusterRole *rbacv1.ClusterRole, opts metav1.CreateOptions) (*rbacv1.ClusterRole, error) |
| 42 |
Update(ctx context.Context, clusterRole *rbacv1.ClusterRole, opts metav1.UpdateOptions) (*rbacv1.ClusterRole, error) |
| 43 |
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error |
| 44 |
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error |
| 45 |
Get(ctx context.Context, name string, opts metav1.GetOptions) (*rbacv1.ClusterRole, error) |
| 46 |
List(ctx context.Context, opts metav1.ListOptions) (*rbacv1.ClusterRoleList, error) |
| 47 |
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) |
| 48 |
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *rbacv1.ClusterRole, err error) |
| 49 |
Apply(ctx context.Context, clusterRole *applyconfigurationsrbacv1.ClusterRoleApplyConfiguration, opts metav1.ApplyOptions) (result *rbacv1.ClusterRole, err error) |
| 50 |
ClusterRoleExpansion |
| 51 |
} |
| 52 |
|
| 53 |
|
| 54 |
type clusterRoles struct { |
| 55 |
*gentype.ClientWithListAndApply[*rbacv1.ClusterRole, *rbacv1.ClusterRoleList, *applyconfigurationsrbacv1.ClusterRoleApplyConfiguration] |
| 56 |
} |
| 57 |
|
| 58 |
|
| 59 |
func newClusterRoles(c *RbacV1Client) *clusterRoles { |
| 60 |
return &clusterRoles{ |
| 61 |
gentype.NewClientWithListAndApply[*rbacv1.ClusterRole, *rbacv1.ClusterRoleList, *applyconfigurationsrbacv1.ClusterRoleApplyConfiguration]( |
| 62 |
"clusterroles", |
| 63 |
c.RESTClient(), |
| 64 |
scheme.ParameterCodec, |
| 65 |
"", |
| 66 |
func() *rbacv1.ClusterRole { return &rbacv1.ClusterRole{} }, |
| 67 |
func() *rbacv1.ClusterRoleList { return &rbacv1.ClusterRoleList{} }, |
| 68 |
gentype.PrefersProtobuf[*rbacv1.ClusterRole](), |
| 69 |
), |
| 70 |
} |
| 71 |
} |