Skip to content
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

Add checksum of windows config files as annotations #5545

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

Atish-iaf
Copy link
Contributor

When the ConfigMap is generated with suffix by kustomize, it will generate a manifest with new ConfigMap like 'antrea-windows-config-***'. When a new manifest is applied, it will leave stale ConfigMaps. To avoid stale ConfigMaps, here we add checksum of windows configuration files as annotations.

@Atish-iaf Atish-iaf added the area/OS/windows Issues or PRs related to the Windows operating system. label Oct 4, 2023
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this change. Do you think there is anything preventing us from using Helm to generate the Windows YAML manifests (like we do for Linux)? Is it too complicated because of the different configurations that we have?

hack/update-checksum-windows.sh Show resolved Hide resolved
@Atish-iaf
Copy link
Contributor Author

I'm fine with this change. Do you think there is anything preventing us from using Helm to generate the Windows YAML manifests (like we do for Linux)? Is it too complicated because of the different configurations that we have?

Thanks for the suggestion, I can try to do this after #5440 as it will bring some changes in manifest, so i think we can wait for it.

@rajnkamr rajnkamr added this to the Antrea v1.14 release milestone Oct 5, 2023
WINDOWS_DIR="${YAMLS_DIR}"/windows
WINDOWS_YAMLS="${YAMLS_DIR}/antrea-windows.yml ${YAMLS_DIR}/antrea-windows-containerd.yml ${YAMLS_DIR}/antrea-windows-containerd-with-ovs.yml"

checksum_windows_config=$(cat ${WINDOWS_DIR}/base/conf/antrea-agent.conf ${WINDOWS_DIR}/base/conf/antrea-cni.conflist | sha256sum | cut -d " " -f 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can check if files exists before calculating checksum, some files might get removed/renamed etc in future, similar for others for error handling etc
if [ -f "${WINDOWS_DIR}/base/conf/antrea-agent.conf" ] && [ -f "${WINDOWS_DIR}/base/conf/antrea-cni.conflist" ]; then

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the script should definitely fail if a file is missing though, it should not silently ignore the missing file

Copy link
Contributor

@luolanzone luolanzone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one nit.

hack/update-checksum-windows.sh Outdated Show resolved Hide resolved
@rajnkamr
Copy link
Contributor

I'm fine with this change. Do you think there is anything preventing us from using Helm to generate the Windows YAML manifests (like we do for Linux)? Is it too complicated because of the different configurations that we have?

#5564 is created to explore using helm for generating windows manifests after completion of #5440

hack/update-checksum-windows.sh Outdated Show resolved Hide resolved
hack/update-checksum-windows.sh Outdated Show resolved Hide resolved
When the ConfigMap is generated with suffix by kustomize, it will
generate a manifest with new ConfigMap like 'antrea-windows-config-***'.
When a new manifest is applied, it will leave stale ConfigMaps.
To avoid stale ConfigMaps, here we add checksum of windows configuration
files as annotations.

Signed-off-by: Kumar Atish <atish.iaf@gmail.com>
@antoninbas
Copy link
Contributor

/test-windows-all

@Atish-iaf
Copy link
Contributor Author

/test-windows-all

@Atish-iaf
Copy link
Contributor Author

/test-windows-e2e
/test-windows-conformance
/test-windows-networkpolicy

@Atish-iaf
Copy link
Contributor Author

/test-windows-containerd-e2e
/test-windows-containerd-conformance
/test-windows-containerd-networkpolicy

@Atish-iaf
Copy link
Contributor Author

/test-windows-containerd-e2e

@Atish-iaf
Copy link
Contributor Author

/test-windows-containerd-conformance
/test-windows-containerd-networkpolicy
/test-windows-e2e

@Atish-iaf
Copy link
Contributor Author

@antoninbas could you please help to merge this PR ? Thanks.

@antoninbas antoninbas added the action/release-note Indicates a PR that should be included in release notes. label Oct 16, 2023
@antoninbas antoninbas merged commit bb59347 into antrea-io:main Oct 16, 2023
49 of 59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/release-note Indicates a PR that should be included in release notes. area/OS/windows Issues or PRs related to the Windows operating system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants