Skip to content

Commit

Permalink
Remove cnudie implementation (#1146)
Browse files Browse the repository at this point in the history
* remove cnudie implementation (run-int-tests)

* remove cnudie implementation (run-int-tests)
  • Loading branch information
achimweigel authored Jun 21, 2024
1 parent 8ae808c commit 0e0eeab
Show file tree
Hide file tree
Showing 75 changed files with 379 additions and 3,678 deletions.
9 changes: 0 additions & 9 deletions docs/usage/Templating.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,6 @@ The following additional functions are available:
- **`ociRefVersion(ref string): string`**
parses an oci reference and returns the version.
e.g. `host:5000/myrepo/myimage:1.0.0` -> `"1.0.0"`
- **`resolve(access Access): []byte`**
resolves an artifact defined by a typed access definition.
The resolve function is currently able to handle artifacts of type `ociRegistry`, others may be added in the future.
The function always returns a byte array of the artifact response
```
# e.g for a oci registry artifact
type: ociRegistry
imageReference: host:5000/myrepo/myimage:1.0.0
```

- **`getShootAdminKubeconfig(shootName, shootNamespace string, expirationSeconds int, target Target): string`**
returns a temporary admin kubeconfig for a Gardener Shoot cluster as described
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ require (
github.com/spf13/pflag v1.0.5
github.com/xeipuuv/gojsonschema v1.2.0
golang.org/x/crypto v0.23.0
golang.org/x/oauth2 v0.20.0
golang.org/x/sync v0.7.0
golang.org/x/sys v0.20.0
gopkg.in/yaml.v3 v3.0.1
Expand Down Expand Up @@ -325,6 +324,7 @@ require (
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/term v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/time v0.5.0 // indirect
Expand Down
17 changes: 8 additions & 9 deletions pkg/components/blueprinthandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"github.com/gardener/landscaper/apis/config"
"github.com/gardener/landscaper/apis/core/v1alpha1"
"github.com/gardener/landscaper/controller-utils/pkg/logging"
"github.com/gardener/landscaper/pkg/components/cnudie"
"github.com/gardener/landscaper/pkg/components/model"
"github.com/gardener/landscaper/pkg/components/ocmlib"
"github.com/gardener/landscaper/pkg/utils/blueprints"
Expand Down Expand Up @@ -49,7 +48,6 @@ var _ = Describe("facade implementation compatibility tests", func() {
// ocmlog.Context().AddRule(logging.NewConditionRule(logging.TraceLevel))

ocmfactory := &ocmlib.Factory{}
cnudiefactory := &cnudie.Factory{}
blueprintData := struct {
blueprintYaml []byte
test []byte
Expand All @@ -72,7 +70,8 @@ var _ = Describe("facade implementation compatibility tests", func() {
cdref := &v1alpha1.ComponentDescriptorReference{}
MustBeSuccessful(runtime.DefaultYAMLEncoding.Unmarshal([]byte(withBlueprintsComponentReference), cdref))

registryAccess := Must(factory.NewRegistryAccess(ctx, nil, nil, nil, nil, &config.LocalRegistryConfiguration{RootPath: registryRootPath}, nil, nil))
registryAccess := Must(factory.NewRegistryAccess(ctx, nil, nil, nil,
&config.LocalRegistryConfiguration{RootPath: registryRootPath}, nil, nil))
compvers := Must(registryAccess.GetComponentVersion(ctx, cdref))
res := Must(compvers.GetResource("blueprint-dir", nil))

Expand All @@ -97,7 +96,8 @@ var _ = Describe("facade implementation compatibility tests", func() {
cdref := &v1alpha1.ComponentDescriptorReference{}
MustBeSuccessful(runtime.DefaultYAMLEncoding.Unmarshal([]byte(withBlueprintsComponentReference), cdref))

registryAccess := Must(factory.NewRegistryAccess(ctx, nil, nil, nil, nil, &config.LocalRegistryConfiguration{RootPath: registryRootPath}, nil, nil))
registryAccess := Must(factory.NewRegistryAccess(ctx, nil, nil, nil,
&config.LocalRegistryConfiguration{RootPath: registryRootPath}, nil, nil))
compvers := Must(registryAccess.GetComponentVersion(ctx, cdref))

bptar := Must(compvers.GetResource("blueprint-tar", nil))
Expand Down Expand Up @@ -126,7 +126,6 @@ var _ = Describe("facade implementation compatibility tests", func() {
Expect(blueprintData.blueprintYaml).To(Equal(blueprintGzipYaml))
Expect(blueprintData.test).To(Equal(gzipTest))
},
Entry("with cnudie and v2 descriptors", model.Factory(cnudiefactory), LOCALCNUDIEREPOPATH_WITH_BLUEPRINTS),
Entry("with ocm and v2 descriptors", model.Factory(ocmfactory), LOCALCNUDIEREPOPATH_WITH_BLUEPRINTS),
Entry("with ocm and v3 descriptors", model.Factory(ocmfactory), LOCALOCMREPOPATH_WITH_BLUEPRINTS),
)
Expand All @@ -135,15 +134,15 @@ var _ = Describe("facade implementation compatibility tests", func() {
cdref := &v1alpha1.ComponentDescriptorReference{}
MustBeSuccessful(runtime.DefaultYAMLEncoding.Unmarshal([]byte(withBlueprintsComponentReference), cdref))

registryAccess := Must(factory.NewRegistryAccess(ctx, nil, nil, nil, nil, &config.LocalRegistryConfiguration{RootPath: registryRootPath}, nil, nil))
registryAccess := Must(factory.NewRegistryAccess(ctx, nil, nil, nil,
&config.LocalRegistryConfiguration{RootPath: registryRootPath}, nil, nil))
compvers := Must(registryAccess.GetComponentVersion(ctx, cdref))
res := Must(compvers.GetResource("corrupted-blueprint", nil))

typedContent, err := res.GetTypedContent(ctx)
Expect(err).To(HaveOccurred())
Expect(typedContent).To(BeNil())
},
Entry("with cnudie and v2 descriptors", model.Factory(cnudiefactory), LOCALCNUDIEREPOPATH_WITH_BLUEPRINTS),
Entry("with ocm and v2 descriptors", model.Factory(ocmfactory), LOCALCNUDIEREPOPATH_WITH_BLUEPRINTS),
Entry("with ocm and v3 descriptors", model.Factory(ocmfactory), LOCALOCMREPOPATH_WITH_BLUEPRINTS),
)
Expand All @@ -153,15 +152,15 @@ var _ = Describe("facade implementation compatibility tests", func() {
cdref := &v1alpha1.ComponentDescriptorReference{}
MustBeSuccessful(runtime.DefaultYAMLEncoding.Unmarshal([]byte(withBlueprintsComponentReference), cdref))

registryAccess := Must(factory.NewRegistryAccess(ctx, nil, nil, nil, nil, &config.LocalRegistryConfiguration{RootPath: registryRootPath}, nil, nil))
registryAccess := Must(factory.NewRegistryAccess(ctx, nil, nil, nil,
&config.LocalRegistryConfiguration{RootPath: registryRootPath}, nil, nil))
compvers := Must(registryAccess.GetComponentVersion(ctx, cdref))
res := Must(compvers.GetResource("corrupted-blueprint-tar", nil))

typedContent, err := res.GetTypedContent(ctx)
Expect(err).To(HaveOccurred())
Expect(typedContent).To(BeNil())
},
Entry("with cnudie and v2 descriptors", model.Factory(cnudiefactory), LOCALCNUDIEREPOPATH_WITH_BLUEPRINTS),
Entry("with ocm and v2 descriptors", model.Factory(ocmfactory), LOCALCNUDIEREPOPATH_WITH_BLUEPRINTS),
Entry("with ocm and v3 descriptors", model.Factory(ocmfactory), LOCALOCMREPOPATH_WITH_BLUEPRINTS),
)
Expand Down
69 changes: 0 additions & 69 deletions pkg/components/cnudie/componentresolvers/blueprint.go

This file was deleted.

Loading

0 comments on commit 0e0eeab

Please sign in to comment.