-
Notifications
You must be signed in to change notification settings - Fork 252
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
Bug 1732579: Best-effort loading #69
Bug 1732579: Best-effort loading #69
Conversation
@njhale: This pull request references an invalid Bugzilla bug:
Comment In response to this:
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. |
/bugzilla refresh |
@ecordell: This pull request references an invalid Bugzilla bug:
Comment In response to this:
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. |
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.
Looks good! A couple of foods for thought
pkg/sqlite/load.go
Outdated
} | ||
|
||
if err := s.addProvidedAPIs(tx, channelEntryCSV, currentID); err != nil { | ||
return err | ||
errs = append(errs, err) | ||
break |
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.
We should be able to continue processing even if the provided apis can't be added. It just means the registry won't be able to answer dependency questions about this particular bundle.
pkg/sqlite/load.go
Outdated
} | ||
|
||
skips, err := channelEntryCSV.GetSkips() | ||
if err != nil { | ||
return err | ||
errs = append(errs, err) | ||
break |
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.
We should be able to continue processing even if we can't find the skips
@njhale: This pull request references a valid Bugzilla bug. The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
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. |
/lgtm |
Support `oc` command
Make package loading best-effort by aggregating errors and continuing where applicable.
Make package and bundle loading best effort by aggregating errors and continuing where applicable.
Make package and bundle loading best effort by aggregating errors and continuing where applicable.
} | ||
|
||
if replaces == "" { | ||
// we've walked the channel until there was no replacement | ||
break | ||
} | ||
|
||
replaced, err := s.getCSV(tx, replaces) | ||
replacedChannelEntry, err := addChannelEntry.Exec(c.Name, manifest.PackageName, replaces, depth) |
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.
I would like to understand why the order of this changed?
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.
The change in ordering lets us add a channel entry for a "missing" replaced CSV.
cmd/appregistry-server/main.go
Outdated
logger.WithError(err).Warn("error loading app registry manifests") | ||
} | ||
if store == nil { | ||
logger.Fatal("store failed to initialize") |
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.
If there are no bundles that are valid this will crash loop correct? Wondering if it makes sense to expose an empty catalog instead?
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.
If there are no bundles, the store will not be nil
. It should only be nil
when there is an issue parsing the source and package names given in the command options. That signifies a misconfiguration of operator-registry itself, which I think should be fatal. I do think that option validation should be more explicit and done before Load
is called, but the appregistry code should be going away soon anyway, and the objective was to make this PR slim.
All that being said, my previous PR exposes an "Empty" Query
implementation. If you think it's best I can pull in that into this PR too.
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.
I added the empty querier just to be safe.
/retest |
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.
/lgtm
"github.com/sirupsen/logrus" | ||
"github.com/stretchr/testify/require" | ||
"gopkg.in/yaml.v2" |
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.
Can we either:
- Do this with the currently imported yaml library (ghodss) or the kube decoders
- Remove the currently imported libraries (ghodss) and replace with this one?
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.
At a cursory glance, there was no encoder to match the decoder in the k8s package.
I didn't look into the ghodss package. Will follow-up soon.
} | ||
} | ||
return tx.Commit() | ||
|
||
if err := tx.Commit(); err != nil { |
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.
We should revisit this, and probably have more granular transactions. This one failing would nullify a lot of the work above to load as much as possible.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ecordell, njhale 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 |
/cherry-pick release-4.1 |
@njhale: #69 failed to apply on top of branch "release-4.1":
In response to this:
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. |
This PR represents a more concise attempt to make appregistry-server more permissive of errors by allowing more operations to be best-effort; allowing loading to progress while aggregating errors (instead of stopping immediately). In lieu of simple logging, error aggregation is necessary to preserve the strict behavior of the configmap-server and initializer commands since appregistry-server uses both underlying load methods (configmap and directory) in various scenarios.