@@ -91,7 +91,7 @@ update_ips.mock_maximal() {
9191update_ips.mock_rclone_s3 () {
9292 update_ips.mock_minimal
9393
94- mock_set_output " ${mock_dig} " " 127.0.0.4" 4 # .networkPolicies.rcloneSync.destinationObjectStorageS3 .ips
94+ mock_set_output " ${mock_dig} " " 127.0.0.4" 4 # .networkPolicies.rclone.sync.objectStorage .ips
9595}
9696
9797update_ips.mock_rclone_s3_and_swift () {
@@ -101,8 +101,8 @@ update_ips.mock_rclone_s3_and_swift() {
101101 mock_set_output " ${mock_curl} " ' \n\n\n\n\n\n\n\n\n\n\n\n\n\n[{"catalog":[{"type": "object-store", "name": "swift", "endpoints": [{"interface":"public", "region": "swift-region", "url": "https://swift.foo.dev-ck8s.com"}]}]}]' 1
102102 mock_set_output " ${mock_curl} " " " 2 # DELETE /auth/tokens
103103
104- mock_set_output " ${mock_dig} " " 127.0.0.5" 5 # networkPolicies.rcloneSync.destinationObjectStorageSwift .ips keystone endpoint
105- mock_set_output " ${mock_dig} " " 127.0.0.6" 6 # networkPolicies.rcloneSync.destinationObjectStorageSwift .ips swift endpoint
104+ mock_set_output " ${mock_dig} " " 127.0.0.5" 5 # networkPolicies.rclone.sync.objectStorageSwift .ips keystone endpoint
105+ mock_set_output " ${mock_dig} " " 127.0.0.6" 6 # networkPolicies.rclone.sync.objectStorageSwift .ips swift endpoint
106106}
107107
108108update_ips.mock_rclone_swift () {
@@ -112,8 +112,8 @@ update_ips.mock_rclone_swift() {
112112 mock_set_output " ${mock_curl} " ' \n\n\n\n\n\n\n\n\n\n\n\n\n\n[{"catalog":[{"type": "object-store", "name": "swift", "endpoints": [{"interface":"public", "region": "swift-region", "url": "https://swift.foo.dev-ck8s.com"}]}]}]' 1
113113 mock_set_output " ${mock_curl} " " " 2 # DELETE /auth/tokens
114114
115- mock_set_output " ${mock_dig} " " 127.0.0.5" 4 # networkPolicies.rcloneSync.destinationObjectStorageSwift .ips keystone endpoint
116- mock_set_output " ${mock_dig} " " 127.0.0.6" 5 # networkPolicies.rcloneSync.destinationObjectStorageSwift .ips swift endpoint
115+ mock_set_output " ${mock_dig} " " 127.0.0.5" 4 # networkPolicies.rclone.sync.objectStorageSwift .ips keystone endpoint
116+ mock_set_output " ${mock_dig} " " 127.0.0.6" 5 # networkPolicies.rclone.sync.objectStorageSwift .ips swift endpoint
117117}
118118
119119update_ips.mock_swift () {
@@ -149,14 +149,14 @@ update_ips.populate_maximal() {
149149 yq_set sc .networkPolicies.global.objectStorageSwift.ips ' ["127.1.0.4/32", "127.1.0.5/32"]'
150150 yq_set sc .networkPolicies.global.objectStorageSwift.ports ' [5678, 91011]'
151151
152- yq_set sc .networkPolicies.rcloneSync.destinationObjectStorageS3 .ips ' ["127.1.0.6/32"]'
153- yq_set sc .networkPolicies.rcloneSync.destinationObjectStorageS3 .ports ' [1234]'
152+ yq_set sc .networkPolicies.rclone.sync.objectStorage .ips ' ["127.1.0.6/32"]'
153+ yq_set sc .networkPolicies.rclone.sync.objectStorage .ports ' [1234]'
154154
155- yq_set sc .networkPolicies.rcloneSync.destinationObjectStorageSwift .ips ' ["127.1.0.7/32", "127.1.0.8/32"]'
156- yq_set sc .networkPolicies.rcloneSync.destinationObjectStorageSwift .ports ' [443, 5678]'
155+ yq_set sc .networkPolicies.rclone.sync.objectStorageSwift .ips ' ["127.1.0.7/32", "127.1.0.8/32"]'
156+ yq_set sc .networkPolicies.rclone.sync.objectStorageSwift .ports ' [443, 5678]'
157157
158- yq_set sc .networkPolicies.rcloneSync .secondaryUrl.ips ' ["127.1.0.9/32"]'
159- yq_set sc .networkPolicies.rcloneSync .secondaryUrl.ports ' [1234]'
158+ yq_set sc .networkPolicies.rclone.sync .secondaryUrl.ips ' ["127.1.0.9/32"]'
159+ yq_set sc .networkPolicies.rclone.sync .secondaryUrl.ports ' [1234]'
160160}
161161
162162# --- asserts ----------------------------------------------------------------------------------------------------------
@@ -195,33 +195,33 @@ update_ips.assert_swift() {
195195}
196196
197197update_ips.assert_rclone_s3 () {
198- assert_equal " $( yq_dig sc ' .networkPolicies.rcloneSync.destinationObjectStorageS3 .ips | . style="flow"' ) " " [127.0.0.4/32]"
199- assert_equal " $( yq_dig sc ' .networkPolicies.rcloneSync.destinationObjectStorageS3 .ports | . style="flow"' ) " " [1234]"
198+ assert_equal " $( yq_dig sc ' .networkPolicies.rclone.sync.objectStorage .ips | . style="flow"' ) " " [127.0.0.4/32]"
199+ assert_equal " $( yq_dig sc ' .networkPolicies.rclone.sync.objectStorage .ports | . style="flow"' ) " " [1234]"
200200
201- assert_equal " $( yq4 ' .networkPolicies.rcloneSync.destinationObjectStorageSwift ' " ${CK8S_CONFIG_PATH} /sc-config.yaml" ) " " null"
201+ assert_equal " $( yq4 ' .networkPolicies.rclone.sync.objectStorageSwift ' " ${CK8S_CONFIG_PATH} /sc-config.yaml" ) " " null"
202202
203203 assert_equal " $( mock_get_call_num " ${mock_dig} " ) " 4
204204 assert_equal " $( mock_get_call_num " ${mock_kubectl} " ) " 16
205205 assert_equal " $( mock_get_call_num " ${mock_curl} " ) " 0
206206}
207207
208208update_ips.assert_rclone_s3_and_swift () {
209- assert_equal " $( yq4 ' .networkPolicies.rcloneSync.destinationObjectStorageS3 | .ips style="flow" | .ips' " ${CK8S_CONFIG_PATH} /sc-config.yaml" ) " " [127.0.0.4/32]"
210- assert_equal " $( yq4 ' .networkPolicies.rcloneSync.destinationObjectStorageS3 | .ports style="flow" | .ports' " ${CK8S_CONFIG_PATH} /sc-config.yaml" ) " " [1234]"
209+ assert_equal " $( yq4 ' .networkPolicies.rclone.sync.objectStorage | .ips style="flow" | .ips' " ${CK8S_CONFIG_PATH} /sc-config.yaml" ) " " [127.0.0.4/32]"
210+ assert_equal " $( yq4 ' .networkPolicies.rclone.sync.objectStorage | .ports style="flow" | .ports' " ${CK8S_CONFIG_PATH} /sc-config.yaml" ) " " [1234]"
211211
212- assert_equal " $( yq4 ' .networkPolicies.rcloneSync.destinationObjectStorageSwift | .ips style="flow" | .ips' " ${CK8S_CONFIG_PATH} /sc-config.yaml" ) " " [127.0.0.5/32, 127.0.0.6/32]"
213- assert_equal " $( yq4 ' .networkPolicies.rcloneSync.destinationObjectStorageSwift | .ports style="flow" | .ports' " ${CK8S_CONFIG_PATH} /sc-config.yaml" ) " " [443, 5678]"
212+ assert_equal " $( yq4 ' .networkPolicies.rclone.sync.objectStorageSwift | .ips style="flow" | .ips' " ${CK8S_CONFIG_PATH} /sc-config.yaml" ) " " [127.0.0.5/32, 127.0.0.6/32]"
213+ assert_equal " $( yq4 ' .networkPolicies.rclone.sync.objectStorageSwift | .ports style="flow" | .ports' " ${CK8S_CONFIG_PATH} /sc-config.yaml" ) " " [443, 5678]"
214214
215215 assert_equal " $( mock_get_call_num " ${mock_dig} " ) " 6
216216 assert_equal " $( mock_get_call_num " ${mock_kubectl} " ) " 16
217217 assert_equal " $( mock_get_call_num " ${mock_curl} " ) " 2
218218}
219219
220220update_ips.assert_rclone_swift () {
221- assert_equal " $( yq4 ' .networkPolicies.rcloneSync.destinationObjectStorageSwift | .ips style="flow" | .ips' " ${CK8S_CONFIG_PATH} /sc-config.yaml" ) " " [127.0.0.5/32, 127.0.0.6/32]"
222- assert_equal " $( yq4 ' .networkPolicies.rcloneSync.destinationObjectStorageSwift | .ports style="flow" | .ports' " ${CK8S_CONFIG_PATH} /sc-config.yaml" ) " " [443, 5678]"
221+ assert_equal " $( yq4 ' .networkPolicies.rclone.sync.objectStorageSwift | .ips style="flow" | .ips' " ${CK8S_CONFIG_PATH} /sc-config.yaml" ) " " [127.0.0.5/32, 127.0.0.6/32]"
222+ assert_equal " $( yq4 ' .networkPolicies.rclone.sync.objectStorageSwift | .ports style="flow" | .ports' " ${CK8S_CONFIG_PATH} /sc-config.yaml" ) " " [443, 5678]"
223223
224- assert_equal " $( yq4 ' .networkPolicies.rcloneSync.destinationObjectStorageS3 ' " ${CK8S_CONFIG_PATH} /sc-config.yaml" ) " " null"
224+ assert_equal " $( yq4 ' .networkPolicies.rclone.sync.objectStorage ' " ${CK8S_CONFIG_PATH} /sc-config.yaml" ) " " null"
225225
226226 # GET /auth/tokens
227227 mock_set_output " ${mock_curl} " ' \n\n\n\n\n\n\n\n\n\n\n\n\n\n[{"catalog":[{"type": "object-store", "name": "swift", "endpoints": [{"interface":"public", "region": "swift-region", "url": "https://swift.foo.dev-ck8s.com"}]}]}]' 1
0 commit comments