Skip to content
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

composition support #561

Merged
merged 30 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7ec6c36
move some packages to top-level
mandelsoft Oct 20, 2023
e342d58
suppor for external resource accesses
mandelsoft Oct 20, 2023
32f7065
OCI artifact reference access
mandelsoft Oct 20, 2023
f1c305f
example1
mandelsoft Oct 20, 2023
2ef9581
garbage collect contexts + attributes
mandelsoft Oct 21, 2023
2acce18
fix leftovers
mandelsoft Oct 22, 2023
630d4a9
tour01 + fixes
mandelsoft Oct 23, 2023
a8eaf9c
tour3
mandelsoft Oct 25, 2023
f23a2c4
modification + upload option rework
mandelsoft Oct 25, 2023
e2ad92f
tour03-b
mandelsoft Oct 25, 2023
e37f467
tour05
mandelsoft Oct 25, 2023
5925026
tour06
mandelsoft Oct 26, 2023
0106d1b
some fixes and renames
mandelsoft Oct 26, 2023
27694b5
comparison scenarios
mandelsoft Oct 26, 2023
270914a
some fixes
mandelsoft Oct 26, 2023
831968d
complete comparison scenario examples
mandelsoft Oct 26, 2023
78ddfb4
improve localization
mandelsoft Oct 27, 2023
4ca3865
add comparison localize
mandelsoft Oct 27, 2023
4591a0f
comparison README.md
mandelsoft Oct 27, 2023
07fcd99
move templates to lib
mandelsoft Oct 28, 2023
4307e5f
add install scenario and loading chart
mandelsoft Oct 28, 2023
1101712
upgrade to latest vfs version
mandelsoft Oct 28, 2023
e4e7268
fix creation of fake method
mandelsoft Oct 28, 2023
04761c3
add doc ref to provisioning/consumption scenario
mandelsoft Oct 28, 2023
8f01356
use unique names for elements packages
mandelsoft Oct 29, 2023
92736dc
streamline resource access utility functions
mandelsoft Oct 29, 2023
11106c9
consistent view handling for access methods
mandelsoft Oct 29, 2023
7158463
more support for consumer identity provider
mandelsoft Oct 30, 2023
50fe294
improve examples
mandelsoft Oct 30, 2023
c595c1d
fix linter issues
mandelsoft Nov 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ COMPONENTS ?= ocmcli helminstaller demoplugin ecrplugin helmdemo subchartsdemo

build: ${SOURCES}
mkdir -p bin
go build ./pkg/...
CGO_ENABLED=0 go build -ldflags $(BUILD_FLAGS) -o bin/ocm ./cmds/ocm
CGO_ENABLED=0 go build -ldflags $(BUILD_FLAGS) -o bin/helminstaller ./cmds/helminstaller
CGO_ENABLED=0 go build -ldflags $(BUILD_FLAGS) -o bin/demo ./cmds/demoplugin
Expand Down
2 changes: 1 addition & 1 deletion cmds/demoplugin/accessmethods/demo.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/open-component-model/ocm/cmds/demoplugin/config"
"github.com/open-component-model/ocm/pkg/cobrautils/flagsets"
"github.com/open-component-model/ocm/pkg/contexts/credentials"
"github.com/open-component-model/ocm/pkg/contexts/credentials/builtin/oci/identity"
"github.com/open-component-model/ocm/pkg/contexts/credentials/cpi"
"github.com/open-component-model/ocm/pkg/contexts/oci/identity"
"github.com/open-component-model/ocm/pkg/contexts/ocm/accessmethods/options"
"github.com/open-component-model/ocm/pkg/contexts/ocm/plugin/ppi"
"github.com/open-component-model/ocm/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion cmds/demoplugin/uploaders/demo.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/open-component-model/ocm/cmds/demoplugin/common"
"github.com/open-component-model/ocm/cmds/demoplugin/config"
"github.com/open-component-model/ocm/pkg/contexts/credentials"
"github.com/open-component-model/ocm/pkg/contexts/credentials/builtin/oci/identity"
"github.com/open-component-model/ocm/pkg/contexts/credentials/cpi"
"github.com/open-component-model/ocm/pkg/contexts/oci/identity"
"github.com/open-component-model/ocm/pkg/contexts/ocm/plugin/ppi"
"github.com/open-component-model/ocm/pkg/errors"
"github.com/open-component-model/ocm/pkg/runtime"
Expand Down
1 change: 1 addition & 0 deletions cmds/ocm/app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ V[3] ctxinfo realm ocm realm test
V[2] ctxwarn realm ocm realm test
ERROR <nil> ctxerror realm ocm realm test
`))
ocmlog.Context().SetDefaultLevel(logging.WarnLevel)
})

It("sets logging by config", func() {
Expand Down
2 changes: 1 addition & 1 deletion cmds/ocm/commands/misccmds/credentials/get/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
. "github.com/open-component-model/ocm/pkg/testutils"

"github.com/open-component-model/ocm/pkg/contexts/credentials"
"github.com/open-component-model/ocm/pkg/contexts/credentials/builtin/oci/identity"
"github.com/open-component-model/ocm/pkg/contexts/credentials/cpi"
"github.com/open-component-model/ocm/pkg/contexts/oci/identity"
)

var _ = Describe("Test Environment", func() {
Expand Down
6 changes: 3 additions & 3 deletions cmds/ocm/commands/ocmcmds/cli/download/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/open-component-model/ocm/pkg/contexts/clictx"
"github.com/open-component-model/ocm/pkg/contexts/ocm"
v1 "github.com/open-component-model/ocm/pkg/contexts/ocm/compdesc/meta/v1"
"github.com/open-component-model/ocm/pkg/contexts/ocm/consts"
"github.com/open-component-model/ocm/pkg/contexts/ocm/extraid"
"github.com/open-component-model/ocm/pkg/contexts/ocm/resourcetypes"
"github.com/open-component-model/ocm/pkg/out"
)
Expand Down Expand Up @@ -107,8 +107,8 @@ func (o *Command) Complete(args []string) error {
}
}
for _, id := range o.Ids {
id[consts.ExecutableOperatingSystem] = runtime.GOOS
id[consts.ExecutableArchitecture] = runtime.GOARCH
id[extraid.ExecutableOperatingSystem] = runtime.GOOS
id[extraid.ExecutableArchitecture] = runtime.GOARCH
}
}

Expand Down
6 changes: 3 additions & 3 deletions cmds/ocm/commands/ocmcmds/cli/download/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/cli/download"
"github.com/open-component-model/ocm/pkg/common/accessio"
metav1 "github.com/open-component-model/ocm/pkg/contexts/ocm/compdesc/meta/v1"
"github.com/open-component-model/ocm/pkg/contexts/ocm/consts"
"github.com/open-component-model/ocm/pkg/contexts/ocm/extraid"
"github.com/open-component-model/ocm/pkg/contexts/ocm/resourcetypes"
env2 "github.com/open-component-model/ocm/pkg/env"
"github.com/open-component-model/ocm/pkg/mime"
Expand All @@ -42,8 +42,8 @@ var _ = Describe("Test Environment", func() {
env.Provider("ocm.software")
env.Resource(download.RESOURCE, "1.0.0", resourcetypes.EXECUTABLE, metav1.LocalRelation, func() {
env.BlobStringData(mime.MIME_OCTET, "ocm script")
env.ExtraIdentity(consts.ExecutableOperatingSystem, runtime.GOOS)
env.ExtraIdentity(consts.ExecutableArchitecture, runtime.GOARCH)
env.ExtraIdentity(extraid.ExecutableOperatingSystem, runtime.GOOS)
env.ExtraIdentity(extraid.ExecutableArchitecture, runtime.GOARCH)
})
})
})
Expand Down
2 changes: 1 addition & 1 deletion cmds/ocm/commands/ocmcmds/common/addhdlrs/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"k8s.io/apimachinery/pkg/util/validation/field"

"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs"
"github.com/open-component-model/ocm/cmds/ocm/pkg/template"
"github.com/open-component-model/ocm/cmds/ocm/pkg/utils"
common2 "github.com/open-component-model/ocm/pkg/common"
"github.com/open-component-model/ocm/pkg/common/accessio"
Expand All @@ -24,6 +23,7 @@ import (
"github.com/open-component-model/ocm/pkg/errors"
"github.com/open-component-model/ocm/pkg/runtime"
utils2 "github.com/open-component-model/ocm/pkg/utils"
"github.com/open-component-model/ocm/pkg/utils/template"
)

func ProcessDescriptions(ctx clictx.Context, printer common2.Printer, templ template.Options, h ElementSpecHandler, sources []ElementSource) ([]Element, inputs.Context, error) {
Expand Down
2 changes: 1 addition & 1 deletion cmds/ocm/commands/ocmcmds/common/inputs/cpi/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (

"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs"
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/options"
"github.com/open-component-model/ocm/pkg/blobaccess"
"github.com/open-component-model/ocm/pkg/cobrautils/flagsets"
"github.com/open-component-model/ocm/pkg/common/accessio/blobaccess"
"github.com/open-component-model/ocm/pkg/contexts/clictx"
"github.com/open-component-model/ocm/pkg/errors"
"github.com/open-component-model/ocm/pkg/mime"
Expand Down
2 changes: 1 addition & 1 deletion cmds/ocm/commands/ocmcmds/common/inputs/inputtype.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"github.com/modern-go/reflect2"
"k8s.io/apimachinery/pkg/util/validation/field"

"github.com/open-component-model/ocm/pkg/blobaccess"
"github.com/open-component-model/ocm/pkg/cobrautils/flagsets"
"github.com/open-component-model/ocm/pkg/common"
"github.com/open-component-model/ocm/pkg/common/accessio/blobaccess"
"github.com/open-component-model/ocm/pkg/contexts/clictx"
"github.com/open-component-model/ocm/pkg/contexts/datacontext"
"github.com/open-component-model/ocm/pkg/errors"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs"
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/cpi"
"github.com/open-component-model/ocm/pkg/common/accessio/blobaccess"
"github.com/open-component-model/ocm/pkg/blobaccess"
"github.com/open-component-model/ocm/pkg/runtime"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs"
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/cpi"
"github.com/open-component-model/ocm/pkg/common/accessio/blobaccess"
"github.com/open-component-model/ocm/pkg/common/accessio/blobaccess/dirtree"
"github.com/open-component-model/ocm/pkg/blobaccess"
"github.com/open-component-model/ocm/pkg/blobaccess/dirtree"
"github.com/open-component-model/ocm/pkg/utils"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (

"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs"
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/cpi"
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/types/ociimage"
"github.com/open-component-model/ocm/pkg/common/accessio/blobaccess"
"github.com/open-component-model/ocm/pkg/common/accessio/blobaccess/dockerdaemon"
ociartifact2 "github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/types/ociartifact"
"github.com/open-component-model/ocm/pkg/blobaccess"
"github.com/open-component-model/ocm/pkg/blobaccess/dockerdaemon"
"github.com/open-component-model/ocm/pkg/contexts/oci/repositories/docker"
"github.com/open-component-model/ocm/pkg/contexts/ocm/accessmethods/ociartifact"
)
Expand All @@ -33,7 +33,7 @@ func New(pathtag string) *Spec {

func (s *Spec) Validate(fldPath *field.Path, ctx inputs.Context, inputFilePath string) field.ErrorList {
allErrs := s.PathSpec.Validate(fldPath, ctx, inputFilePath)
allErrs = ociimage.ValidateRepository(fldPath.Child("repository"), allErrs, s.Repository)
allErrs = ociartifact2.ValidateRepository(fldPath.Child("repository"), allErrs, s.Repository)

if s.Path != "" {
pathField := fldPath.Child("path")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"k8s.io/apimachinery/pkg/util/validation/field"

"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs"
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/types/ociimage"
"github.com/open-component-model/ocm/pkg/common/accessio/blobaccess"
"github.com/open-component-model/ocm/pkg/common/accessio/blobaccess/dockermulti"
ociartifact2 "github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/types/ociartifact"
"github.com/open-component-model/ocm/pkg/blobaccess"
"github.com/open-component-model/ocm/pkg/blobaccess/dockermulti"
"github.com/open-component-model/ocm/pkg/contexts/clictx"
"github.com/open-component-model/ocm/pkg/contexts/oci"
"github.com/open-component-model/ocm/pkg/contexts/oci/repositories/artifactset"
Expand Down Expand Up @@ -48,7 +48,7 @@ func New(pathtags ...string) *Spec {

func (s *Spec) Validate(fldPath *field.Path, ctx inputs.Context, inputFilePath string) field.ErrorList {
allErrs := field.ErrorList{}
allErrs = ociimage.ValidateRepository(fldPath.Child("repository"), allErrs, s.Repository)
allErrs = ociartifact2.ValidateRepository(fldPath.Child("repository"), allErrs, s.Repository)
variantsField := fldPath.Child("variants")
if len(s.Variants) == 0 {
allErrs = append(allErrs, field.Required(variantsField, fmt.Sprintf("variants is required for input of type %q and must has at least one entry", s.GetType())))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs"
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/cpi"
"github.com/open-component-model/ocm/pkg/common/accessio/blobaccess"
"github.com/open-component-model/ocm/pkg/blobaccess"
)

type Spec struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs"
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/cpi"
"github.com/open-component-model/ocm/pkg/common/accessio/blobaccess"
"github.com/open-component-model/ocm/pkg/blobaccess"
"github.com/open-component-model/ocm/pkg/errors"
"github.com/open-component-model/ocm/pkg/mime"
)
Expand Down
4 changes: 2 additions & 2 deletions cmds/ocm/commands/ocmcmds/common/inputs/types/helm/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs"
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/cpi"
"github.com/open-component-model/ocm/pkg/common/accessio/blobaccess"
"github.com/open-component-model/ocm/pkg/common/accessio/blobaccess/helm"
"github.com/open-component-model/ocm/pkg/blobaccess"
"github.com/open-component-model/ocm/pkg/blobaccess/helm"
"github.com/open-component-model/ocm/pkg/contexts/ocm/accessmethods/ociartifact"
"github.com/open-component-model/ocm/pkg/errors"
)
Expand Down
2 changes: 1 addition & 1 deletion cmds/ocm/commands/ocmcmds/common/inputs/types/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
_ "github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/types/dockermulti"
_ "github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/types/file"
_ "github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/types/helm"
_ "github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/types/ociimage"
_ "github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/types/ociartifact"
_ "github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/types/spiff"
_ "github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/types/utf8"
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0

package ociimage
package ociartifact

import (
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/cpi"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0

package ociimage
package ociartifact

import (
"strings"
Expand All @@ -11,10 +11,9 @@ import (

"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs"
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/cpi"
"github.com/open-component-model/ocm/pkg/common/accessio/blobaccess"
"github.com/open-component-model/ocm/pkg/contexts/oci"
"github.com/open-component-model/ocm/pkg/blobaccess"
ociartifact2 "github.com/open-component-model/ocm/pkg/blobaccess/ociartifact"
"github.com/open-component-model/ocm/pkg/contexts/oci/grammar"
"github.com/open-component-model/ocm/pkg/contexts/oci/repositories/artifactset"
"github.com/open-component-model/ocm/pkg/contexts/oci/repositories/docker"
"github.com/open-component-model/ocm/pkg/contexts/ocm/accessmethods/ociartifact"
)
Expand Down Expand Up @@ -48,31 +47,11 @@ func (s *Spec) Validate(fldPath *field.Path, ctx inputs.Context, inputFilePath s
}

func (s *Spec) GetBlob(ctx inputs.Context, info inputs.InputResourceInfo) (blobaccess.BlobAccess, string, error) {
ctx.Printf("image %s\n", s.Path)
ref, err := oci.ParseRef(s.Path)
if err != nil {
return nil, "", err
}

spec, err := ctx.OCIContext().MapUniformRepositorySpec(&ref.UniformRepositorySpec)
if err != nil {
return nil, "", err
}

repo, err := ctx.OCIContext().RepositoryForSpec(spec)
if err != nil {
return nil, "", err
}
ns, err := repo.LookupNamespace(ref.Repository)
if err != nil {
return nil, "", err
}

version := ref.Version()
if version == "" || version == "latest" {
version = info.ComponentVersion.GetVersion()
}
blob, err := artifactset.SynthesizeArtifactBlob(ns, version)
blob, version, err := ociartifact2.BlobAccessForOCIArtifact(s.Path,
ociartifact2.WithContext(ctx),
ociartifact2.WithPrinter(ctx.Printer()),
ociartifact2.WithVersion(info.ComponentVersion.GetVersion()),
)
if err != nil {
return nil, "", err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@
//
// SPDX-License-Identifier: Apache-2.0

package ociimage
package ociartifact

import (
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs"
)

const TYPE = "ociImage"
const TYPE = "ociArtifact"
const LEGACY_TYPE = "ociImage"

func init() {
inputs.DefaultInputTypeScheme.Register(inputs.NewInputType(TYPE, &Spec{}, usage, ConfigHandler()))
inputs.DefaultInputTypeScheme.Register(inputs.NewInputType(LEGACY_TYPE, &Spec{}, legacy_usage, ConfigHandler()))
}

const legacy_usage = `
DEPRECATED: This type is deprecated, please use ` + TYPE + ` instead.
`

const usage = `
The path must denote an OCI image reference.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs"
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/cpi"
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/types/file"
"github.com/open-component-model/ocm/pkg/common/accessio/blobaccess"
"github.com/open-component-model/ocm/pkg/blobaccess"
"github.com/open-component-model/ocm/pkg/errors"
"github.com/open-component-model/ocm/pkg/runtime"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs"
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/inputs/cpi"
"github.com/open-component-model/ocm/pkg/common/accessio/blobaccess"
"github.com/open-component-model/ocm/pkg/blobaccess"
"github.com/open-component-model/ocm/pkg/runtime"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ package templateroption

import (
"github.com/open-component-model/ocm/cmds/ocm/pkg/options"
"github.com/open-component-model/ocm/cmds/ocm/pkg/template"
"github.com/open-component-model/ocm/pkg/contexts/clictx"
"github.com/open-component-model/ocm/pkg/utils/template"
)

func From(o options.OptionSetProvider) *Option {
Expand Down
3 changes: 2 additions & 1 deletion cmds/ocm/commands/ocmcmds/components/add/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
metav1 "github.com/open-component-model/ocm/pkg/contexts/ocm/compdesc/meta/v1"
"github.com/open-component-model/ocm/pkg/contexts/ocm/repositories/ctf"
"github.com/open-component-model/ocm/pkg/contexts/ocm/resourcetypes"
ocmutils "github.com/open-component-model/ocm/pkg/contexts/ocm/utils"
"github.com/open-component-model/ocm/pkg/contexts/ocm/valuemergehandler/handlers/defaultmerge"
"github.com/open-component-model/ocm/pkg/mime"
)
Expand Down Expand Up @@ -57,7 +58,7 @@ func CheckComponent(env *TestEnv, handler func(ocm.Repository)) {
Expect(cd.Labels).To(Equal(clabels))

r := Must(cv.GetResource(metav1.Identity{"name": "data"}))
data := Must(ocm.ResourceData(r))
data := Must(ocmutils.GetResourceData(r))
Expect(string(data)).To(Equal("!stringdata"))

r = Must(cv.GetResource(metav1.Identity{"name": "text"}))
Expand Down
3 changes: 2 additions & 1 deletion cmds/ocm/commands/ocmcmds/components/transfer/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
ctfocm "github.com/open-component-model/ocm/pkg/contexts/ocm/repositories/ctf"
"github.com/open-component-model/ocm/pkg/contexts/ocm/resourcetypes"
handlercfg "github.com/open-component-model/ocm/pkg/contexts/ocm/transfer/transferhandler/config"
ocmutils "github.com/open-component-model/ocm/pkg/contexts/ocm/utils"
"github.com/open-component-model/ocm/pkg/mime"
"github.com/open-component-model/ocm/pkg/utils"
)
Expand Down Expand Up @@ -72,7 +73,7 @@ func CheckComponent(env *TestEnv, ldesc *artdesc.Descriptor, tgt ocm.Repository)

racc, err := comp.GetResourceByIndex(1)
Expect(err).To(Succeed())
reader, err := ocm.ResourceReader(racc)
reader, err := ocmutils.GetResourceReader(racc)
Expect(err).To(Succeed())
defer reader.Close()
set, err := artifactset.Open(accessobj.ACC_READONLY, "", 0, accessio.Reader(reader))
Expand Down
2 changes: 1 addition & 1 deletion cmds/ocm/commands/ocmcmds/references/add/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/common/addhdlrs/refs"
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/names"
"github.com/open-component-model/ocm/cmds/ocm/commands/verbs"
"github.com/open-component-model/ocm/cmds/ocm/pkg/template"
"github.com/open-component-model/ocm/cmds/ocm/pkg/utils"
"github.com/open-component-model/ocm/pkg/contexts/clictx"
"github.com/open-component-model/ocm/pkg/utils/template"
)

var (
Expand Down
Loading