From 57b40515d478ff7f92f203dc675344d25b4f0d76 Mon Sep 17 00:00:00 2001 From: bupd Date: Mon, 9 Dec 2024 15:53:52 +0530 Subject: [PATCH] fix lint Signed-off-by: bupd --- .../reg/adapter/harborsatellite/adapter.go | 43 +++++++++++++------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/src/pkg/reg/adapter/harborsatellite/adapter.go b/src/pkg/reg/adapter/harborsatellite/adapter.go index 261a092104c..c7cbd232ccf 100644 --- a/src/pkg/reg/adapter/harborsatellite/adapter.go +++ b/src/pkg/reg/adapter/harborsatellite/adapter.go @@ -1,3 +1,17 @@ +// Copyright Project Harbor Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package harborsatellite import ( @@ -9,6 +23,7 @@ import ( "net/url" "github.com/docker/distribution" + "github.com/goharbor/harbor/src/common/secret" "github.com/goharbor/harbor/src/lib/config" "github.com/goharbor/harbor/src/lib/errors" @@ -175,59 +190,59 @@ func (a adapter) HealthCheck() (string, error) { return model.Healthy, nil } -func (a adapter) FetchArtifacts(filters []*model.Filter) ([]*model.Resource, error) { +func (a adapter) FetchArtifacts(_ []*model.Filter) ([]*model.Resource, error) { return nil, nil } -func (a adapter) ManifestExist(repository, reference string) (exist bool, desc *distribution.Descriptor, err error) { +func (a adapter) ManifestExist(_, _ string) (exist bool, desc *distribution.Descriptor, err error) { return true, nil, nil } -func (a adapter) PullManifest(repository, reference string, accepttedMediaTypes ...string) (manifest distribution.Manifest, digest string, err error) { +func (a adapter) PullManifest(_, _ string, _ ...string) (manifest distribution.Manifest, digest string, err error) { return nil, "", ErrNotImplemented } -func (a adapter) PushManifest(repository, reference, mediaType string, payload []byte) (string, error) { +func (a adapter) PushManifest(_, _, _ string, _ []byte) (string, error) { return "", nil } -func (a adapter) DeleteManifest(repository, reference string) error { +func (a adapter) DeleteManifest(_, _ string) error { return ErrNotImplemented } -func (a adapter) BlobExist(repository, digest string) (exist bool, err error) { +func (a adapter) BlobExist(_, _ string) (exist bool, err error) { return true, nil } -func (a adapter) PullBlob(repository, digest string) (size int64, blob io.ReadCloser, err error) { +func (a adapter) PullBlob(_, _ string) (size int64, blob io.ReadCloser, err error) { return 0, nil, ErrNotImplemented } -func (a adapter) PullBlobChunk(repository, digest string, blobSize, start, end int64) (size int64, blob io.ReadCloser, err error) { +func (a adapter) PullBlobChunk(_, _ string, _, _, _ int64) (size int64, blob io.ReadCloser, err error) { return 0, nil, ErrNotImplemented } -func (a adapter) PushBlobChunk(repository, digest string, size int64, chunk io.Reader, start, end int64, location string) (nextUploadLocation string, endRange int64, err error) { +func (a adapter) PushBlobChunk(_, _ string, _ int64, _ io.Reader, _, _ int64, _ string) (nextUploadLocation string, endRange int64, err error) { return "", 0, ErrNotImplemented } -func (a adapter) PushBlob(repository, digest string, size int64, blob io.Reader) error { +func (a adapter) PushBlob(_, _ string, _ int64, _ io.Reader) error { return nil } -func (a adapter) MountBlob(srcRepository, digest, dstRepository string) (err error) { +func (a adapter) MountBlob(_, _, _ string) (err error) { return nil } -func (a adapter) CanBeMount(digest string) (mount bool, repository string, err error) { +func (a adapter) CanBeMount(_ string) (mount bool, repository string, err error) { return false, "", ErrNotImplemented } -func (a adapter) DeleteTag(repository, tag string) error { +func (a adapter) DeleteTag(_, _ string) error { return ErrNotImplemented } -func (a adapter) ListTags(repository string) (tags []string, err error) { +func (a adapter) ListTags(_ string) (tags []string, err error) { return nil, nil }