File tree Expand file tree Collapse file tree 2 files changed +4
-21
lines changed
internal/operator-controller/authentication Expand file tree Collapse file tree 2 files changed +4
-21
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,11 @@ import (
88 ocv1 "github.com/operator-framework/operator-controller/api/v1"
99)
1010
11- func SyntheticUserName (ext ocv1.ClusterExtension ) string {
11+ func syntheticUserName (ext ocv1.ClusterExtension ) string {
1212 return fmt .Sprintf ("olm:clusterextensions:%s" , ext .Name )
1313}
1414
15- func SyntheticGroups (_ ocv1.ClusterExtension ) []string {
15+ func syntheticGroups (_ ocv1.ClusterExtension ) []string {
1616 return []string {
1717 "olm:clusterextensions" ,
1818 "system:authenticated" ,
@@ -21,7 +21,7 @@ func SyntheticGroups(_ ocv1.ClusterExtension) []string {
2121
2222func SyntheticImpersonationConfig (ext ocv1.ClusterExtension ) transport.ImpersonationConfig {
2323 return transport.ImpersonationConfig {
24- UserName : SyntheticUserName (ext ),
25- Groups : SyntheticGroups (ext ),
24+ UserName : syntheticUserName (ext ),
25+ Groups : syntheticGroups (ext ),
2626 }
2727}
Original file line number Diff line number Diff line change @@ -10,23 +10,6 @@ import (
1010 "github.com/operator-framework/operator-controller/internal/operator-controller/authentication"
1111)
1212
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-
3013func TestSyntheticImpersonationConfig (t * testing.T ) {
3114 config := authentication .SyntheticImpersonationConfig (ocv1.ClusterExtension {
3215 ObjectMeta : metav1.ObjectMeta {
You can’t perform that action at this time.
0 commit comments