File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
operator/internal/manifests Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -944,6 +944,9 @@ func TestConfigureDeploymentForMode(t *testing.T) {
944944 Containers : []corev1.Container {
945945 {
946946 Name : gatewayContainerName ,
947+ Args : []string {
948+ "--logs.auth.extract-selectors=SrcK8S_Namespace,DstK8S_Namespace" ,
949+ },
947950 },
948951 {
949952 Name : "opa" ,
@@ -1051,6 +1054,9 @@ func TestConfigureDeploymentForMode(t *testing.T) {
10511054 Containers : []corev1.Container {
10521055 {
10531056 Name : gatewayContainerName ,
1057+ Args : []string {
1058+ "--logs.auth.extract-selectors=SrcK8S_Namespace,DstK8S_Namespace" ,
1059+ },
10541060 },
10551061 {
10561062 Name : "opa" ,
Original file line number Diff line number Diff line change @@ -73,15 +73,23 @@ func ConfigureGatewayDeployment(
7373 return kverrors .Wrap (err , "failed to merge sidecar container spec " )
7474 }
7575
76- if mode == lokiv1 .OpenshiftLogging {
76+ if mode == lokiv1 .OpenshiftLogging || mode == lokiv1 . OpenshiftNetwork {
7777 // enable extraction of namespace selector
7878 for i , c := range d .Spec .Template .Spec .Containers {
7979 if c .Name != "gateway" {
8080 continue
8181 }
8282
83+ var authSelectors string
84+ switch mode {
85+ case lokiv1 .OpenshiftLogging :
86+ authSelectors = opaDefaultLabelMatchers
87+ case lokiv1 .OpenshiftNetwork :
88+ authSelectors = opaNetworkLabelMatchers
89+ }
90+
8391 d .Spec .Template .Spec .Containers [i ].Args = append (d .Spec .Template .Spec .Containers [i ].Args ,
84- fmt .Sprintf ("--logs.auth.extract-selectors=%s" , opaDefaultLabelMatchers ),
92+ fmt .Sprintf ("--logs.auth.extract-selectors=%s" , authSelectors ),
8593 )
8694 }
8795 }
You can’t perform that action at this time.
0 commit comments