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
Switch pkg/image to use clientsets #16195
Switch pkg/image to use clientsets #16195
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: soltysh Assign the PR to them by writing The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
createImageSAR := authorizationutil.AddUserToSAR(user, &authorizationapi.SubjectAccessReview{ | ||
Spec: authorizationapi.SubjectAccessReviewSpec{ | ||
ResourceAttributes: &authorizationapi.ResourceAttributes{ | ||
Namespace: inputMeta.Namespace, |
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.
Was this namespace scoped before? images
are cluster scoped.
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.
This is imagestreamimport, not image. Iow. you create a resource that tells the server to import some data inside particular image stream.
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 take that back. Yes, you're right this should not be namespaced.
createImageStreamMappingSAR := authorizationutil.AddUserToSAR(user, &authorizationapi.SubjectAccessReview{ | ||
Spec: authorizationapi.SubjectAccessReviewSpec{ | ||
ResourceAttributes: &authorizationapi.ResourceAttributes{ | ||
Namespace: inputMeta.Namespace, |
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 expected this one to be namespace scoped, but it looks like it wasn't namespaced before. Was it?
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.
It was not, I'm removing the namespace parameter.
@@ -355,6 +350,11 @@ func JoinImageStreamTag(name, tag string) string { | |||
return fmt.Sprintf("%s:%s", name, tag) | |||
} | |||
|
|||
// JoinImageStreamImage creates a name for image stream image object from an image stream name and an id. | |||
func JoinImageStreamImage(name, id string) string { |
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.
Why the change? Make
reads better to me for this purpose.
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 wanted to make it consistent with the other helper JoinImageStreamTag
.
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'll split it to a separate commit.
return &imageDeleter{ | ||
images: images, | ||
} | ||
} | ||
|
||
func (p *imageDeleter) DeleteImage(image *imageapi.Image) error { | ||
glog.V(4).Infof("Deleting image %q", image.Name) | ||
return p.images.Delete(image.Name) | ||
return p.images.Images().Delete(image.Name, metav1.NewDeleteOptions(0)) |
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.
old code was this aggresive with the delete options?
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.
Hmmm... there was no such option in the old code, and since this is pruning I assumed this will be the best option.
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.
Hmmm... there was no such option in the old code, and since this is pruning I assumed this will be the best option.
pass nil or empty object. Pretty sure this one takes a nil.
errors look real. |
I think the questions are still outstanding. |
f8ded59
to
632db5f
Compare
@deads2k comments addressed, problems solved and rebase. ptal |
if err != nil { | ||
return nil, err | ||
} | ||
coreClient, err := coreclient.NewForConfig(c.CoreAPIServerClientConfig) | ||
authorizationClient, err := authorizationclient.NewForConfig(c.GenericConfig.LoopbackClientConfig) |
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.
preexisting, but this one should probably be CoreAPIServerClientConfig
The delete options and the client config bit. Otherwise, lgtm. After that feel free to tag it. |
632db5f
to
61c955d
Compare
Rebased, applying the label based on approval. |
61c955d
to
cd5fccb
Compare
Rebased, re-applying the label back. |
/retest |
Automatic merge from submit-queue |
@mfojtik @deads2k I hope this handles all of them, including the SAR bits we've talked about yesterday.