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

Remove cnudie implementation #1146

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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