Skip to content

Not found errors must match object in migration - #15213

Merged
openshift-merge-robot merged 1 commit into
openshift:masterfrom
enj:enj/i/migrate_oprhaned_resources/15006
Sep 14, 2017
Merged

openshift-merge-robot merged 1 commit into
openshift:masterfrom
enj:enj/i/migrate_oprhaned_resources/15006

Conversation

@enj

@enj enj commented Jul 14, 2017 •

Copy link
Copy Markdown
Contributor

This change tightens the code to not tolerate not found errors that refer to a different object than what was being migrated. For example, the previous code would not error if the not found error refereed to the namespace being missing instead of the actual object. Thus we can detect objects that have been orphaned inside of a deleted namespace.

Signed-off-by: Monis Khan [email protected]

Fixes #15006

@openshift/security

@smarterclayton PTAL

[test]

$ oc adm migrate storage --include=serviceaccounts --confirm
error:     -n bahbah serviceaccounts/default: namespaces "bahbah" not found
summary: total=51 errors=1 ignored=0 unchanged=50 migrated=0
info: to rerun only failing resources, add --include=serviceaccounts
error: 1 resources failed to migrate

if details == nil {
return false
}
gvk := info.Object.GetObjectKind().GroupVersionKind()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

does this work correctly with not found errors for legacy group and new API groups?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I assume the group in the returned status would line up with info group (so legacy or new depending on which endpoint migrate was using).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I went ahead and special cased the legacy group and opened kubernetes/kubernetes/issues/48959 for the general problem. Maybe I should just ignore the group here?

@enj
enj force-pushed the enj/i/migrate_oprhaned_resources/15006 branch from de68322 to fb62005 Compare July 14, 2017 19:27
@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin test up to fb62005

@openshift-bot

Copy link
Copy Markdown
Contributor

continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/3164/) (Base Commit: 05b9ea8) (PR Branch Commit: fb62005)

@enj

enj commented Jul 20, 2017

Copy link
Copy Markdown
Contributor Author

@smarterclayton @liggitt Do we want to move forward with this?

@smarterclayton

smarterclayton commented Jul 20, 2017 via email •

Copy link
Copy Markdown
Contributor

@openshift-merge-robot openshift-merge-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 24, 2017
@openshift-merge-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: enj
We suggest the following additional approver: mfojtik

Assign the PR to them by writing /assign @mfojtik in a comment when ready.

Associated issue: 15006

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

Details Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 27, 2017
@openshift-merge-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: enj
We suggest the following additional approver: mfojtik

Assign the PR to them by writing /assign @mfojtik in a comment when ready.

Associated issue: 15006

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

Details Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 28, 2017
@openshift-merge-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: enj
We suggest the following additional approver: mfojtik

Assign the PR to them by writing /assign @mfojtik in a comment when ready.

Associated issue: 15006

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

Details Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

openshift-merge-robot added a commit that referenced this pull request Aug 13, 2017
Automatic merge from submit-queue (batch tested with PRs 15581, 15721)

Update etcd stores to use DefaultQualifiedResource

This field replaces QualifiedResource and serves as the default group resource info when the request does not provide that data.

Signed-off-by: Monis Khan <[email protected]>

xref: #15213 #15006 kubernetes/kubernetes/pull/49868
@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 19, 2017
@openshift-merge-robot openshift-merge-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 30, 2017
@enj
enj force-pushed the enj/i/migrate_oprhaned_resources/15006 branch from fb62005 to 9733451 Compare September 11, 2017 18:02
@openshift-merge-robot openshift-merge-robot removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 11, 2017
@enj

enj commented Sep 11, 2017

Copy link
Copy Markdown
Contributor Author

@smarterclayton @liggitt can we merge this now?

Comment thread pkg/oc/admin/migrate/migrator.go Outdated
return err
}

// isNotFoundForInfo returns true iff the error is a not found for the the specific info object.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the the

@smarterclayton

Copy link
Copy Markdown
Contributor

Looks fine to me except the one nit.

This change tightens the code to not tolerate not found errors that
refer to a different object than what was being migrated.  For
example, the previous code would not error if the not found error
refereed to the namespace being missing instead of the actual
object.  Thus we can detect objects that have been orphaned inside
of a deleted namespace.

Signed-off-by: Monis Khan <[email protected]>
@enj
enj force-pushed the enj/i/migrate_oprhaned_resources/15006 branch from 9733451 to e3b488e Compare September 13, 2017 21:33
@enj enj added 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. labels Sep 13, 2017
@enj

enj commented Sep 13, 2017

Copy link
Copy Markdown
Contributor Author

Addressed nit / added LGTM.

@openshift-merge-robot

Copy link
Copy Markdown
Contributor

Automatic merge from submit-queue (batch tested with PRs 15213, 16338)

@openshift-merge-robot
openshift-merge-robot merged commit 83c5b94 into openshift:master Sep 14, 2017
jupierce added a commit that referenced this pull request Sep 14, 2017
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/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants