Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Switch image details to get
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud committed May 27, 2022
1 parent f332e3b commit 915850c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 2 additions & 2 deletions pkg/client/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ func (c *client) ImageDetails(ctx context.Context, imageName string, opts *Image
imageName = strings.ReplaceAll(imageName, "/", "+")

detailsResult := &apiv1.ImageDetails{}
err := c.RESTClient.Post().
err := c.RESTClient.Get().
Namespace(c.Namespace).
Resource("images").
Name(imageName).
SubResource("details").
Body(&apiv1.ImageDetails{}).Do(ctx).Into(detailsResult)
Do(ctx).Into(detailsResult)
if err != nil {
return nil, err
}
Expand Down
9 changes: 1 addition & 8 deletions pkg/server/registry/images/detail.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apiserver/pkg/endpoints/request"
"k8s.io/apiserver/pkg/registry/rest"
"sigs.k8s.io/controller-runtime/pkg/client"
)

Expand All @@ -34,15 +33,9 @@ func (s *ImageDetails) New() runtime.Object {
return &apiv1.ImageDetails{}
}

func (s *ImageDetails) Create(ctx context.Context, name string, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error) {
func (s *ImageDetails) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error) {
name = strings.ReplaceAll(name, "+", "/")

if createValidation != nil {
if err := createValidation(ctx, obj); err != nil {
return nil, err
}
}

ns, _ := request.NamespaceFrom(ctx)
imageName := name

Expand Down

0 comments on commit 915850c

Please sign in to comment.