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

OCI: Fix bundle reload and activation unconditionally #4658

Merged
merged 1 commit into from May 13, 2022
Merged

OCI: Fix bundle reload and activation unconditionally #4658

merged 1 commit into from May 13, 2022

Conversation

carabasdaniel
Copy link
Contributor

Using the etag in the OCI downloader to store the SHA fixes issue #4637

Copy link
Contributor

@srenatus srenatus left a comment

Choose a reason for hiding this comment

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

Code looks good -- just a test would be really nice. Also @ashutosh-narkar knows this code much better than I do, so I'll wait for him to have a look.

download/oci_dowload.go Outdated Show resolved Hide resolved
download/oci_dowload.go Outdated Show resolved Hide resolved
download/oci_dowload.go Show resolved Hide resolved
@srenatus srenatus self-requested a review May 11, 2022 12:39
Copy link
Contributor

@srenatus srenatus left a comment

Choose a reason for hiding this comment

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

Thanks for adding tests! I might have just missed it -- are we testing that we no longer unconditionally reload and activate?

t.Fatalf("expected true but got: %s", response)
}

expContains := "Bundle loaded and activated successfully"
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm perhaps we should also check that the second pull did not do this? 🤔 Maybe I'm missing something... 🔍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rebased and added a verification that the bundle is skipped also in the e2e OCI test if it's the same on the pooling mechanism. I had to set the log level to debug in the test as the skip message is shown only on debug mode.

srenatus
srenatus previously approved these changes May 12, 2022
Copy link
Contributor

@srenatus srenatus left a comment

Choose a reason for hiding this comment

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

Thank you!


time.Sleep(3 * time.Second) // wait for the downloader pooling mechanism to kick in
expContains := "Bundle loaded and activated successfully"
skipContains := "Bundle load skipped, server replied with not modified."
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm. not exactly on-point, but fair enough 🤔

@srenatus
Copy link
Contributor

Could you please rebase and squash the commits? 😃

…d not change

Signed-off-by: carabasdaniel <dani@aserto.com>
@srenatus srenatus merged commit 2c65069 into open-policy-agent:main May 13, 2022
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.

None yet

3 participants