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

start: Initialize the payload and fail if it can't be read at startup #169

Merged
merged 1 commit into from
Apr 23, 2019

Conversation

smarterclayton
Copy link
Contributor

Avoid the possibility of a bad release image being created that can't
correctly read the payload by failing hard on startup if the payload is
invalid.

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 20, 2019
@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 20, 2019
@smarterclayton
Copy link
Contributor Author

/retest

func (optr *Operator) InitializeFromPayload() error {
update, err := payload.LoadUpdate(optr.defaultPayloadDir(), optr.releaseImage)
if err != nil {
return fmt.Errorf("the local release contents are invalid - no current version can be determined from disk: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit can we use already imported github.com/pkg/errors for wrapping the error?
return errors.Wrap(err, "failed to release image - no current version can be determined from disk")

return fmt.Errorf("the local release contents are invalid - no current version can be determined from disk: %v", err)
}
// XXX: set this to the cincinnati version in preference
if _, err := semver.Parse(update.ImageRef.Name); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

are we adding requirement for all release images must be semver ?

@abhinavdahiya
Copy link
Contributor

Can you point include in the commit message why we are moving to requirement that all release image versions must be semver? this is a requirement for CVO will Cincinnati support this constraint?

Avoid the possibility of a bad release image being created that can't
correctly read the payload by failing hard on startup if the payload is
invalid.

Both cincinnati and the release creation process require semantic
versions. The release controller will fail jobs that are not semver.
@smarterclayton
Copy link
Contributor Author

smarterclayton commented Apr 23, 2019 via email

@smarterclayton
Copy link
Contributor Author

smarterclayton commented Apr 23, 2019 via email

@abhinavdahiya
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 23, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya, smarterclayton

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:
  • OWNERS [abhinavdahiya,smarterclayton]

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

@openshift-merge-robot openshift-merge-robot merged commit 17881e4 into openshift:master Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants