Skip to content

Conversation

mythi
Copy link
Contributor

@mythi mythi commented Apr 27, 2023

No description provided.

@mythi
Copy link
Contributor Author

mythi commented Apr 27, 2023

@hj-johannes-lee please check this proposal and test it out

/cc @chaitanya1731

@mythi mythi requested a review from hj-johannes-lee April 27, 2023 04:45
@codecov-commenter
Copy link

codecov-commenter commented Apr 27, 2023

Codecov Report

Merging #1396 (a4cfb74) into main (f037c8b) will not change coverage.
The diff coverage is n/a.

❗ Current head a4cfb74 differs from pull request most recent head 5bab034. Consider uploading reports for the commit 5bab034 to get more accurate results

@@           Coverage Diff           @@
##             main    #1396   +/-   ##
=======================================
  Coverage   50.95%   50.95%           
=======================================
  Files          44       44           
  Lines        4985     4985           
=======================================
  Hits         2540     2540           
  Misses       2300     2300           
  Partials      145      145           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mythi mythi force-pushed the PR-2023-020 branch 2 times, most recently from b6e3eb8 to cbf61ad Compare April 27, 2023 16:58
@hj-johannes-lee
Copy link
Contributor

hj-johannes-lee commented Apr 27, 2023

For others also see, let me put the test results.

Before:

$ kubectl apply -f deployments/operator/samples/deviceplugin_v1_dlbdeviceplugin.yaml 
Error from server (unable to parse version "@sha256:aa8a24770fa459fea7e8dea830d761c2a0435fcae76e4211712715a72a86e952": could not parse "@sha256:aa8a24770fa459fea7e8dea830d761c2a0435fcae76e4211712715a72a86e952" as version): error when creating "deployments/operator/samples/deviceplugin_v1_dlbdeviceplugin.yaml": admission webhook "vdlbdeviceplugin.kb.io" denied the request: unable to parse version "@sha256:aa8a24770fa459fea7e8dea830d761c2a0435fcae76e4211712715a72a86e952": could not parse "@sha256:aa8a24770fa459fea7e8dea830d761c2a0435fcae76e4211712715a72a86e952" as version

After:

$ kubectl apply -f deployments/operator/samples/deviceplugin_v1_dlbdeviceplugin.yaml 
dlbdeviceplugin.deviceplugin.intel.com/dlbdeviceplugin-sample created

In case of wrong image name:

$ kubectl apply -f deployments/operator/samples/deviceplugin_v1_dlbdeviceplugin.yaml 
Error from server (incorrect image name "intel-dlb-initcontainer-wrong". Make sure you use '/intel-dlb-initcontainer.): error when creating "deployments/operator/samples/deviceplugin_v1_dlbdeviceplugin.yaml": admission webhook "vdlbdeviceplugin.kb.io" denied the request: incorrect image name "intel-dlb-initcontainer-wrong". Make sure you use '/intel-dlb-initcontainer'.

@chaitanya1731
Copy link

Similar test results on OCP too..

CRs deploy successfully with SHAs (correct image name and SHA).

For incorrect SHA length (random SHA key with length longer than expected) -

image

For incorrect image name -

image
image

For incorrect SHA (with correct SHA length) -

CR is deployed but cannot pull image which is expected.. gives ErrImagePull
image

@mythi mythi marked this pull request as ready for review April 28, 2023 06:40
@mythi mythi requested review from bart0sh and tkatila as code owners April 28, 2023 06:40
@mythi
Copy link
Contributor Author

mythi commented Apr 28, 2023

@hj-johannes-lee @chaitanya1731 thanks! I improved the error handling / UX for the faulty SHA digests still. PTAL

tkatila
tkatila previously approved these changes Apr 28, 2023
Copy link
Contributor

@tkatila tkatila left a comment

Choose a reason for hiding this comment

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

Looks good!

tkatila
tkatila previously approved these changes Apr 28, 2023
@mythi mythi added this to the 0.26.1 milestone Apr 28, 2023
@mythi mythi dismissed stale reviews from hj-johannes-lee and tkatila via 5bab034 April 28, 2023 11:59
@chaitanya1731
Copy link

@mythi
Done some testing again and the errors messages looks much better now -

For incorrect SHA length

Fix the following errors:
admission webhook "vsgxdeviceplugin.kb.io" denied the request: unable to parse version "055aa2fd127920b5fe8cfd73f8c2df13080093f1eab3ae8b19db0ea4b10739b1sadsda". Make sure it's either valid SHA digest or semver tag.: illegal version string "055aa2fd127920b5fe8cfd73f8c2df13080093f1eab3ae8b19db0ea4b10739b1sadsda"

For incorrect image name

Fix the following errors:
admission webhook "vsgxdeviceplugin.kb.io" denied the request: incorrect image name "intel-sgx-plugin-wrong@sha256". Make sure you use '/intel-sgx-plugin'.

@hj-johannes-lee hj-johannes-lee merged commit 4f74bc4 into intel:main Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants