File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 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 {
393393 set_cloud_armor_policy " ${RANGES} " || return
394394
395395 # 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
397398
398399 start_operator_gce || return
399400}
@@ -407,8 +408,8 @@ function start_operator_gce {
407408 SUFFIX=$( echo " ${PROJECT} -${CLUSTER_NAME} -${ZONE} " | sha1sum)
408409 POLICY_NAME=" kctf-policy-${SUFFIX: 0: 16} "
409410 # 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} \" " - \
412413 | " ${KCTF_BIN} /kubectl" apply -f - || return
413414 fi
414415}
You can’t perform that action at this time.
0 commit comments