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

Warn instead of fail on failure to validate against DB #2668

Closed
wants to merge 2 commits into from

Conversation

mheon
Copy link
Member

@mheon mheon commented Mar 15, 2019

When the database has somehow stored the empty string for a field we wish to validate against, we cannot perform any reasonable validation. Instead of making this a hard failure, print a warning that we cannot validate, and bad things may happen.

When the database has somehow stored the empty string for a field
we wish to validate against, we cannot perform any reasonable
validation. Instead of making this a hard failure, print a
warning that we cannot validate, and bad things may happen.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mheon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS labels Mar 15, 2019
// If DB value is the empty string, we ought to be fine.
// (Though I'm honestly not sure how we got this far
// with an empty-string DB config)
if string(keyBytes) == "" {
Copy link
Member

Choose a reason for hiding this comment

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

Should we update the data with the correct value?

Copy link
Member Author

Choose a reason for hiding this comment

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

The problem is that we don't really know the correct value here - the DB is supposed to know, and it doesn't, so we can only hope that we're using the right storage driver.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I've figured out why we're entering "" in the first place though. Going to fix that next.

@rhatdan
Copy link
Member

rhatdan commented Mar 15, 2019

One question, but I am fine with this change.

@giuseppe
Copy link
Member

LGTM

@mheon
Copy link
Member Author

mheon commented Mar 15, 2019

Added one more commit to not unconditionally overwrite storage defaults on a configuration being present when we run as root - I think this might resolve our empty-string storage driver issues

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
@mheon mheon force-pushed the fix_db_validation_emptystring branch from e9fb9a5 to 31b12dc Compare March 15, 2019 14:46
@TomSweeneyRedHat
Copy link
Member

LGTM

@@ -297,6 +297,9 @@ func GetDefaultStoreOptions() (storage.StoreOptions, error) {
err error
)
storageOpts := storage.DefaultStoreOptions
if !rootless.IsRootless() {
Copy link
Member

Choose a reason for hiding this comment

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

This code makes little sense. Above you set storageOpts to DefaultStoreOptions, then you overwrite it in both root and rootless mode.

@rhatdan
Copy link
Member

rhatdan commented Mar 21, 2019

@mheon Any update on this PR?

@mheon
Copy link
Member Author

mheon commented Mar 21, 2019

@rhatdan I think we're still good to proceed, unless this code already moved out into c/storage

@rh-atomic-bot
Copy link
Collaborator

☔ The latest upstream changes (presumably #2789) made this pull request unmergeable. Please resolve the merge conflicts.

@openshift-ci-robot
Copy link
Collaborator

@mheon: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 2, 2019
@TomSweeneyRedHat
Copy link
Member

@mheon, you still have a lingering comment here from @rhatdan

@TomSweeneyRedHat
Copy link
Member

and you need to merge too apparently

@mheon
Copy link
Member Author

mheon commented Apr 8, 2019

I'm having second thoughts about this one, might just close it...

@mheon
Copy link
Member Author

mheon commented Apr 30, 2019

This isn't worth doing, I think

@mheon mheon closed this Apr 30, 2019
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants