Commit a687d09 1 parent 7839624 commit a687d09 Copy full SHA for a687d09
File tree 3 files changed +78
-8
lines changed
control-plane/subcommand/server-acl-init
3 files changed +78
-8
lines changed Original file line number Diff line number Diff line change
1
+ ```release-note:bug
2
+ connect-inject: fix issue where the ACL policy for the connect-injector included the `acl = "write"` rule twice when namespaces were not enabled.
3
+ ```
Original file line number Diff line number Diff line change @@ -310,11 +310,11 @@ partition "{{ .PartitionName }}" {
310
310
}
311
311
{{- if .EnableNamespaces }}
312
312
namespace_prefix "" {
313
+ acl = "write"
313
314
{{- end }}
314
315
{{- if .EnablePartitions }}
315
316
policy = "write"
316
317
{{- end }}
317
- acl = "write"
318
318
service_prefix "" {
319
319
policy = "write"
320
320
intentions = "write"
Original file line number Diff line number Diff line change @@ -883,7 +883,6 @@ func TestInjectRules(t *testing.T) {
883
883
node_prefix "" {
884
884
policy = "write"
885
885
}
886
- acl = "write"
887
886
service_prefix "" {
888
887
policy = "write"
889
888
intentions = "write"
@@ -917,7 +916,30 @@ func TestInjectRules(t *testing.T) {
917
916
}` ,
918
917
},
919
918
{
920
- EnableNamespaces : true ,
919
+ EnableNamespaces : false ,
920
+ EnablePartitions : true ,
921
+ EnablePeering : false ,
922
+ PartitionName : "part-1" ,
923
+ Expected : `
924
+ partition "part-1" {
925
+ mesh = "write"
926
+ acl = "write"
927
+ node_prefix "" {
928
+ policy = "write"
929
+ }
930
+ policy = "write"
931
+ service_prefix "" {
932
+ policy = "write"
933
+ intentions = "write"
934
+ }
935
+ identity_prefix "" {
936
+ policy = "write"
937
+ intentions = "write"
938
+ }
939
+ }` ,
940
+ },
941
+ {
942
+ EnableNamespaces : false ,
921
943
EnablePartitions : false ,
922
944
EnablePeering : true ,
923
945
Expected : `
@@ -928,17 +950,14 @@ func TestInjectRules(t *testing.T) {
928
950
node_prefix "" {
929
951
policy = "write"
930
952
}
931
- namespace_prefix "" {
932
- acl = "write"
933
953
service_prefix "" {
934
954
policy = "write"
935
955
intentions = "write"
936
956
}
937
957
identity_prefix "" {
938
958
policy = "write"
939
959
intentions = "write"
940
- }
941
- }` ,
960
+ }` ,
942
961
},
943
962
{
944
963
EnableNamespaces : true ,
@@ -953,7 +972,32 @@ partition "part-1" {
953
972
policy = "write"
954
973
}
955
974
namespace_prefix "" {
975
+ acl = "write"
956
976
policy = "write"
977
+ service_prefix "" {
978
+ policy = "write"
979
+ intentions = "write"
980
+ }
981
+ identity_prefix "" {
982
+ policy = "write"
983
+ intentions = "write"
984
+ }
985
+ }
986
+ }` ,
987
+ },
988
+ {
989
+ EnableNamespaces : true ,
990
+ EnablePartitions : false ,
991
+ EnablePeering : true ,
992
+ Expected : `
993
+ mesh = "write"
994
+ operator = "write"
995
+ acl = "write"
996
+ peering = "write"
997
+ node_prefix "" {
998
+ policy = "write"
999
+ }
1000
+ namespace_prefix "" {
957
1001
acl = "write"
958
1002
service_prefix "" {
959
1003
policy = "write"
@@ -963,7 +1007,30 @@ partition "part-1" {
963
1007
policy = "write"
964
1008
intentions = "write"
965
1009
}
1010
+ }` ,
1011
+ },
1012
+ {
1013
+ EnableNamespaces : false ,
1014
+ EnablePartitions : true ,
1015
+ EnablePeering : true ,
1016
+ PartitionName : "part-1" ,
1017
+ Expected : `
1018
+ partition "part-1" {
1019
+ mesh = "write"
1020
+ acl = "write"
1021
+ peering = "write"
1022
+ node_prefix "" {
1023
+ policy = "write"
966
1024
}
1025
+ policy = "write"
1026
+ service_prefix "" {
1027
+ policy = "write"
1028
+ intentions = "write"
1029
+ }
1030
+ identity_prefix "" {
1031
+ policy = "write"
1032
+ intentions = "write"
1033
+ }
967
1034
}` ,
968
1035
},
969
1036
{
@@ -980,8 +1047,8 @@ partition "part-1" {
980
1047
policy = "write"
981
1048
}
982
1049
namespace_prefix "" {
983
- policy = "write"
984
1050
acl = "write"
1051
+ policy = "write"
985
1052
service_prefix "" {
986
1053
policy = "write"
987
1054
intentions = "write"
You can’t perform that action at this time.
0 commit comments