-
Notifications
You must be signed in to change notification settings - Fork 8
implement image check for oci pull #635
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
base: master
Are you sure you want to change the base?
Changes from 6 commits
dacbfd7
b72964a
78341c2
ea8bd2b
f9486a4
cfe5e20
bdefed1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -175,7 +175,7 @@ func (r *partitionResource) createPartition(request *restful.Request, response * | |
| imageURL = *requestPayload.PartitionBootConfiguration.ImageURL | ||
| } | ||
|
|
||
| err = checkImageURL("image", imageURL) | ||
| err = checkImageURL("image", imageURL, nil) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here and within that file: is
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we don't have any registry yet that needs authentication, but still want to support it, I can't think of a better way than passing over Feel free to suggest a solution that's more to your liking and I'm happy to add it.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not right now. Could you create an issue for this? Then we can tackle this in the future. |
||
| if err != nil { | ||
| r.sendError(request, response, httperrors.BadRequest(err)) | ||
| return | ||
|
|
@@ -186,7 +186,7 @@ func (r *partitionResource) createPartition(request *restful.Request, response * | |
| kernelURL = *requestPayload.PartitionBootConfiguration.KernelURL | ||
| } | ||
|
|
||
| err = checkImageURL("kernel", kernelURL) | ||
| err = checkImageURL("kernel", kernelURL, nil) | ||
| if err != nil { | ||
| r.sendError(request, response, httperrors.BadRequest(err)) | ||
| return | ||
|
|
@@ -275,7 +275,10 @@ func (r *partitionResource) deletePartition(request *restful.Request, response * | |
| } | ||
|
|
||
| func (r *partitionResource) updatePartition(request *restful.Request, response *restful.Response) { | ||
| var requestPayload v1.PartitionUpdateRequest | ||
| var ( | ||
| requestPayload v1.PartitionUpdateRequest | ||
| ) | ||
|
|
||
| err := request.ReadEntity(&requestPayload) | ||
| if err != nil { | ||
| r.sendError(request, response, httperrors.BadRequest(err)) | ||
|
|
@@ -303,7 +306,7 @@ func (r *partitionResource) updatePartition(request *restful.Request, response * | |
| newPartition.Labels = requestPayload.Labels | ||
| } | ||
| if requestPayload.PartitionBootConfiguration.ImageURL != nil { | ||
| err = checkImageURL("image", *requestPayload.PartitionBootConfiguration.ImageURL) | ||
| err = checkImageURL("image", *requestPayload.PartitionBootConfiguration.ImageURL, nil) | ||
| if err != nil { | ||
| r.sendError(request, response, httperrors.BadRequest(err)) | ||
| return | ||
|
|
@@ -313,11 +316,12 @@ func (r *partitionResource) updatePartition(request *restful.Request, response * | |
| } | ||
|
|
||
| if requestPayload.PartitionBootConfiguration.KernelURL != nil { | ||
| err = checkImageURL("kernel", *requestPayload.PartitionBootConfiguration.KernelURL) | ||
| err = checkImageURL("kernel", *requestPayload.PartitionBootConfiguration.KernelURL, nil) | ||
| if err != nil { | ||
| r.sendError(request, response, httperrors.BadRequest(err)) | ||
| return | ||
| } | ||
|
|
||
| newPartition.BootConfiguration.KernelURL = *requestPayload.PartitionBootConfiguration.KernelURL | ||
| } | ||
| if requestPayload.PartitionBootConfiguration.CommandLine != nil { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.