-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change daemonset images name to match the built one #108
Change daemonset images name to match the built one #108
Conversation
8cd9c5f
to
4f21f52
Compare
2d5e439
to
973430e
Compare
This PR should not affect the network operator CI, and only affects the sriov_antrea which passed the CI, and i think it is ready for review |
common/common_functions.sh
Outdated
local file="$3" | ||
|
||
let doc_num=0 | ||
changed="false" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
found
would serve as better variable for this case
common/common_functions.sh
Outdated
if [[ "$kind" == "DaemonSet" ]];then | ||
name=$(yq r -d "$doc_num" $file metadata.name) | ||
if [[ "$name" == "$daemonset_name" ]];then | ||
let container_index=0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try to refactor it to be more readable
if [[ "$kind" == "DaemonSet" ]];then
name=$(yq r -d "$doc_num" $file metadata.name)
.............
to
if [[ "$kind" != "DaemonSet" ]];then
continue
...
change_image_name antrea/antrea-ubuntu antrea/antrea-ubuntu:ci | ||
|
||
change_k8s_resource "DaemonSet" "antrea-agent" spec.template.spec.containers[*].image "antrea/antrea-ubuntu:ci" "$WORKSPACE/antrea-cni/build/yamls/antrea.yml" | ||
change_k8s_resource "DaemonSet" "antrea-agent" spec.template.spec.initContainers[*].image "antrea/antrea-ubuntu:ci" "$WORKSPACE/antrea-cni/build/yamls/antrea.yml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using kustomize
may help you simplify this, WDYT?
973430e
to
bd7bafb
Compare
@Mmduh-483 changed the patch so that it will be a simpler and more straight forward fix. please have a look |
This patch change the antrea.yml image to match the built image. This is needed because the latest antrea.yml uses different image than the image name that was used when scripting the CI.
bd7bafb
to
1b4488a
Compare
cp $WORKSPACE/antrea-cni/build/yamls/antrea.yml $ARTIFACTS | ||
|
||
sed -i "s;\(^ *image\:\).*;\1 antrea/antrea-ubuntu;" $ARTIFACTS/antrea.yml | ||
|
||
if [[ -z "$(grep hw-offload $WORKSPACE/antrea-cni/build/yamls/antrea.yml)" ]];then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think it is more clear to do grep in $ARTIFACTS folder.
Maybe it will be better to use --hw-offload as pattern for grep?
if condition can be simplified to remove subshell usage
if ! grep -q --hw-offload $ARTIFACTS/antrea-cni/build/yamls/antrea.yml; then
...
fi
@Mmduh-483 @ykulazhenkov can you have a look at antrea-io/antrea#2077 |
Won't this affect PR and daily CIs? |
PRs in the antrea already use that, dailies should be modified to use that as well, regarding the CI checks, they can be dropped for this project |
closed since it was fixed in the antrea repo directly |
This patch change the antrea.yml image to match the built image.
This is needed because the latest antrea.yml uses different image
than the image name that was used when scripting the CI.