|
816 | 816 |
|
817 | 817 | update_olm_images
|
818 | 818 | update_multus_images
|
| 819 | + update_kubeproxy_images |
819 | 820 |
|
820 | 821 | popd >/dev/null
|
821 | 822 | }
|
@@ -1118,6 +1119,44 @@ EOF
|
1118 | 1119 | done # for goarch
|
1119 | 1120 | }
|
1120 | 1121 |
|
| 1122 | +update_kubeproxy_images() { |
| 1123 | + title "Rebasing kube-proxy images" |
| 1124 | + |
| 1125 | + for goarch in amd64 arm64; do |
| 1126 | + arch=${GOARCH_TO_UNAME_MAP["${goarch}"]:-noarch} |
| 1127 | + |
| 1128 | + local release_file="${STAGING_DIR}/release_${goarch}.json" |
| 1129 | + local kustomization_arch_file="${REPOROOT}/assets/optional/kube-proxy/kustomization.${arch}.yaml" |
| 1130 | + local kubeproxy_release_json="${REPOROOT}/assets/optional/kube-proxy/release-kube-proxy-${arch}.json" |
| 1131 | + |
| 1132 | + local base_release |
| 1133 | + base_release=$(jq -r ".metadata.version" "${release_file}") |
| 1134 | + jq -n "{\"release\": {\"base\": \"$base_release\"}, \"images\": {}}" > "${kubeproxy_release_json}" |
| 1135 | + |
| 1136 | + # Create extra kustomization for each arch in separate file. |
| 1137 | + # Right file (depending on arch) should be appended during rpmbuild to kustomization.yaml. |
| 1138 | + cat <<EOF > "${kustomization_arch_file}" |
| 1139 | +
|
| 1140 | +images: |
| 1141 | +EOF |
| 1142 | + |
| 1143 | + for container in kube-proxy; do |
| 1144 | + local new_image |
| 1145 | + new_image=$(jq -r ".references.spec.tags[] | select(.name == \"${container}\") | .from.name" "${release_file}") |
| 1146 | + local new_image_name="${new_image%@*}" |
| 1147 | + local new_image_digest="${new_image#*@}" |
| 1148 | + |
| 1149 | + cat <<EOF >> "${kustomization_arch_file}" |
| 1150 | + - name: ${container} |
| 1151 | + newName: ${new_image_name} |
| 1152 | + digest: ${new_image_digest} |
| 1153 | +EOF |
| 1154 | + |
| 1155 | + yq -i -o json ".images += {\"${container}\": \"${new_image}\"}" "${kubeproxy_release_json}" |
| 1156 | + done # for container |
| 1157 | + done # for goarch |
| 1158 | +} |
| 1159 | + |
1121 | 1160 | check_for_manifests_changes() {
|
1122 | 1161 | # Changes to ignore:
|
1123 | 1162 | # - `release-$ARCH.json` files
|
|
0 commit comments