Skip to content

Commit

Permalink
Change repo.Name() to RepositoryRef
Browse files Browse the repository at this point in the history
  • Loading branch information
nesmabadr committed Aug 13, 2024
1 parent af360f1 commit 4447ca9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/img/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/open-component-model/ocm/pkg/contexts/ocm/compdesc"
ocmmetav1 "github.com/open-component-model/ocm/pkg/contexts/ocm/compdesc/meta/v1"
"github.com/open-component-model/ocm/pkg/contexts/ocm/cpi"

Check failure on line 16 in pkg/img/parse.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/kyma-project/lifecycle-manager) -s blank -s dot --custom-order (gci)
"github.com/open-component-model/ocm/pkg/contexts/ocm/repositories/genericocireg"
"github.com/open-component-model/ocm/pkg/runtime"

Expand Down Expand Up @@ -44,6 +45,7 @@ func parseDescriptor(ctx *runtime.UnstructuredTypedObject, descriptor *compdesc.
if err != nil {
return nil, fmt.Errorf("error while decoding the repository context into an OCI registry: %w", err)
}

typedRepo, ok := repo.(*genericocireg.RepositorySpec)
if !ok {
return nil, common.ErrTypeAssert
Expand Down Expand Up @@ -141,8 +143,8 @@ func getOCIRef(
); found {
repoSubpath = string(ext)
}

layerRef.Repo = fmt.Sprintf("%s/%s", repo.Name(), repoSubpath)
baseUrl := repo.RepositorySpec.UniformRepositorySpec().RepositoryRef()

Check failure on line 146 in pkg/img/parse.go

View workflow job for this annotation

GitHub Actions / lint

ST1003: var baseUrl should be baseURL (stylecheck)
layerRef.Repo = fmt.Sprintf("%s/%s", baseUrl, repoSubpath)
layerRef.Name = descriptor.GetName()
case genericocireg.OCIRegistryDigestMapping:
layerRef.Repo = repo.Name() + "/"
Expand Down

0 comments on commit 4447ca9

Please sign in to comment.