File tree 2 files changed +4
-21
lines changed
internal/operator-controller/authentication
2 files changed +4
-21
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,11 @@ import (
8
8
ocv1 "github.com/operator-framework/operator-controller/api/v1"
9
9
)
10
10
11
- func SyntheticUserName (ext ocv1.ClusterExtension ) string {
11
+ func syntheticUserName (ext ocv1.ClusterExtension ) string {
12
12
return fmt .Sprintf ("olm:clusterextensions:%s" , ext .Name )
13
13
}
14
14
15
- func SyntheticGroups (_ ocv1.ClusterExtension ) []string {
15
+ func syntheticGroups (_ ocv1.ClusterExtension ) []string {
16
16
return []string {
17
17
"olm:clusterextensions" ,
18
18
"system:authenticated" ,
@@ -21,7 +21,7 @@ func SyntheticGroups(_ ocv1.ClusterExtension) []string {
21
21
22
22
func SyntheticImpersonationConfig (ext ocv1.ClusterExtension ) transport.ImpersonationConfig {
23
23
return transport.ImpersonationConfig {
24
- UserName : SyntheticUserName (ext ),
25
- Groups : SyntheticGroups (ext ),
24
+ UserName : syntheticUserName (ext ),
25
+ Groups : syntheticGroups (ext ),
26
26
}
27
27
}
Original file line number Diff line number Diff line change @@ -10,23 +10,6 @@ import (
10
10
"github.com/operator-framework/operator-controller/internal/operator-controller/authentication"
11
11
)
12
12
13
- func TestSyntheticUserName (t * testing.T ) {
14
- syntheticUserName := authentication .SyntheticUserName (ocv1.ClusterExtension {
15
- ObjectMeta : metav1.ObjectMeta {
16
- Name : "my-ext" ,
17
- },
18
- })
19
- require .Equal (t , "olm:clusterextensions:my-ext" , syntheticUserName )
20
- }
21
-
22
- func TestSyntheticGroups (t * testing.T ) {
23
- syntheticGroups := authentication .SyntheticGroups (ocv1.ClusterExtension {})
24
- require .Equal (t , []string {
25
- "olm:clusterextensions" ,
26
- "system:authenticated" ,
27
- }, syntheticGroups )
28
- }
29
-
30
13
func TestSyntheticImpersonationConfig (t * testing.T ) {
31
14
config := authentication .SyntheticImpersonationConfig (ocv1.ClusterExtension {
32
15
ObjectMeta : metav1.ObjectMeta {
You can’t perform that action at this time.
0 commit comments