Skip to content

Commit

Permalink
Merge pull request #136 from Nordix/warnings-repo
Browse files Browse the repository at this point in the history
Fix two warnings in repository.go
  • Loading branch information
efiacor authored Nov 14, 2024
2 parents 6af2c49 + 42556c1 commit 31ee5d5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pkg/cache/memory/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"github.com/nephio-project/porch/pkg/repository"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/trace"
"k8s.io/apimachinery/pkg/api/errors"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/watch"
Expand Down Expand Up @@ -214,9 +213,7 @@ func (r *cachedRepository) update(ctx context.Context, updated repository.Packag
Package: k.Package,
WorkspaceName: k.WorkspaceName,
}
if _, ok := r.cachedPackageRevisions[oldKey]; ok {
delete(r.cachedPackageRevisions, oldKey)
}
delete(r.cachedPackageRevisions, oldKey)
}

cached := &cachedPackageRevision{PackageRevision: updated}
Expand Down Expand Up @@ -264,7 +261,7 @@ func (r *cachedRepository) createMainPackageRevision(ctx context.Context, update

// Create the package if it doesn't exist
_, err := r.metadataStore.Get(ctx, pkgRevMetaNN)
if errors.IsNotFound(err) {
if apierrors.IsNotFound(err) {
pkgRevMeta := meta.PackageRevisionMeta{
Name: updatedMain.KubeObjectName(),
Namespace: updatedMain.KubeObjectNamespace(),
Expand Down

0 comments on commit 31ee5d5

Please sign in to comment.