File tree 2 files changed +35
-0
lines changed
modules/common/client/cache/client/core
2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ func (in *Client) Secrets(namespace string) corev1.SecretInterface {
25
25
return newSecrets (in , namespace , in .token )
26
26
}
27
27
28
+ func (in * Client ) Namespaces () corev1.NamespaceInterface {
29
+ return newNamespaces (in , in .token )
30
+ }
31
+
28
32
func (in * Client ) Nodes () corev1.NodeInterface {
29
33
return newNodes (in , in .token )
30
34
}
Original file line number Diff line number Diff line change
1
+ package core
2
+
3
+ import (
4
+ "context"
5
+
6
+ corev1 "k8s.io/api/core/v1"
7
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
8
+ authorizationv1 "k8s.io/client-go/kubernetes/typed/authorization/v1"
9
+ v1 "k8s.io/client-go/kubernetes/typed/core/v1"
10
+
11
+ "k8s.io/dashboard/types"
12
+ )
13
+
14
+ type namespaces struct {
15
+ v1.NamespaceInterface
16
+
17
+ authorizationV1 authorizationv1.AuthorizationV1Interface
18
+ token string
19
+ }
20
+
21
+ func (in * namespaces ) List (ctx context.Context , opts metav1.ListOptions ) (* corev1.NamespaceList , error ) {
22
+ return NewCachedClusterScopedResourceLister [corev1.NamespaceList ](
23
+ in .authorizationV1 ,
24
+ in .token ,
25
+ types .ResourceKindNamespace ,
26
+ ).List (ctx , in .NamespaceInterface , opts )
27
+ }
28
+
29
+ func newNamespaces (c * Client , token string ) v1.NamespaceInterface {
30
+ return & namespaces {c .CoreV1Client .Namespaces (), c .authorizationV1 , token }
31
+ }
You can’t perform that action at this time.
0 commit comments