File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -393,7 +393,8 @@ function kctf_cluster_ip_ranges {
393
393
set_cloud_armor_policy " ${RANGES} " || return
394
394
395
395
# stop the operator
396
- " ${KCTF_BIN} /kubectl" delete -f " ${KCTF_CTF_DIR} /kctf/resources/operator.yaml" || return
396
+ " ${KCTF_BIN} /yq" eval " select(.kind == \" Deployment\" )" " ${KCTF_CTF_DIR} /kctf/resources/operator.yaml" \
397
+ | " ${KCTF_BIN} /kubectl" delete -f - || return
397
398
398
399
start_operator_gce || return
399
400
}
@@ -407,8 +408,8 @@ function start_operator_gce {
407
408
SUFFIX=$( echo " ${PROJECT} -${CLUSTER_NAME} -${ZONE} " | sha1sum)
408
409
POLICY_NAME=" kctf-policy-${SUFFIX: 0: 16} "
409
410
# restart the operator with the new range
410
- " ${KCTF_BIN} /yq" eval " (((.| select(has( \" spec \" ))) .spec|select(has( \" template \" ))) .template.spec.containers[0]. env[] | select(.name == \" ALLOWED_IPS\" )) .value = \" ${RANGES} \" " " ${KCTF_CTF_DIR} /kctf/resources/operator.yaml" \
411
- | " ${KCTF_BIN} /yq" eval " (((.| select(has( \" spec \" ))) .spec|select(has( \" template \" ))) .template.spec.containers[0]. env[] | select(.name == \" SECURITY_POLICY\" )) .value = \" ${POLICY_NAME} \" " - \
411
+ " ${KCTF_BIN} /yq" eval " (select(.kind == \" Deployment \" ).spec.template.spec.containers[] | select(.name == \" manager \" ). env[] | select(.name == \" ALLOWED_IPS\" ).value) | = \" ${RANGES} \" " " ${KCTF_CTF_DIR} /kctf/resources/operator.yaml" \
412
+ | " ${KCTF_BIN} /yq" eval " (select(.kind == \" Deployment \" ).spec.template.spec.containers[] | select(.name == \" manager \" ). env[] | select(.name == \" SECURITY_POLICY\" ).value) | = \" ${POLICY_NAME} \" " - \
412
413
| " ${KCTF_BIN} /kubectl" apply -f - || return
413
414
fi
414
415
}
You can’t perform that action at this time.
0 commit comments