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

storage/kubernetes: fix conflict error detection in TRP creation #823

Merged
merged 1 commit into from
Feb 27, 2017

Conversation

ericchiang
Copy link
Contributor

@ericchiang ericchiang commented Feb 27, 2017

PR #815 fixed the Kubernetes storage implementation by correctly
returning storage.ErrAlreadyExists on POST conflicts. This caused a
regression in TPR creation (#822) when some, but not all, of the
resources already existed. E.g. for users upgrading from old
versions of dex.

Fixes #822

cli.logger.Errorf("third party resource already created %q", r.ObjectMeta.Name)
continue
}
if err == storage.ErrAlreadyExists {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to have a similar check for storage.ErrNotFound and have a separate message for that too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

storage.ErrNotFound would mean that TPRs weren't enabled on the server. hmmm, maybe? Let me go add that.

PR dexidp#815 fixed the Kubernetes storage implementation by correctly
returning storage.ErrAlreadyExists on POST conflicts. This caused a
regression in TPR creation (dexidp#822) when some, but not all, of the
resources already existed. E.g. for users upgrading from old
versions of dex.

Fixes dexidp#822
@ericchiang
Copy link
Contributor Author

@rithujohn191 updated the logging message.

Copy link
Contributor

@rithujohn191 rithujohn191 left a comment

Choose a reason for hiding this comment

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

LGTM!

@rithujohn191 rithujohn191 merged commit bb896a8 into dexidp:master Feb 27, 2017
@ericchiang ericchiang deleted the tpr-already-exists branch February 27, 2017 19:24
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.

error resources: ID already exists.
2 participants