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

Update component cli #362

Merged
merged 2 commits into from
Aug 13, 2021
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
34 changes: 17 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ module github.com/gardener/test-infra
go 1.14

require (
cloud.google.com/go v0.57.0
cloud.google.com/go/storage v1.6.0
cloud.google.com/go v0.81.0
cloud.google.com/go/storage v1.10.0
github.com/Masterminds/semver v1.5.0
github.com/Masterminds/sprig v2.22.0+incompatible
github.com/argoproj/argo/v2 v2.12.10
github.com/bradleyfalzon/ghinstallation v1.1.1
github.com/emicklei/go-restful v2.11.1+incompatible // indirect
github.com/fsnotify/fsnotify v1.4.9
github.com/gardener/component-cli v0.19.0
github.com/gardener/component-spec/bindings-go v0.0.36
github.com/gardener/component-cli v0.28.0
github.com/gardener/component-spec/bindings-go v0.0.52
github.com/gardener/gardener v1.19.1
github.com/gardener/gardener-resource-manager v0.22.0
github.com/gardener/gardener-resource-manager/api v0.22.0
github.com/ghodss/yaml v1.0.0
github.com/go-ini/ini v1.51.1 // indirect
github.com/go-logr/logr v0.3.0
github.com/go-logr/logr v0.4.0
github.com/go-logr/zapr v0.3.0
github.com/go-openapi/spec v0.19.8
github.com/gobuffalo/packr/v2 v2.8.0
Expand All @@ -32,24 +32,24 @@ require (
github.com/joho/godotenv v1.3.0
github.com/karrick/godirwalk v1.15.5 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
github.com/mandelsoft/vfs v0.0.0-20201002134249-3c471f64a4d1
github.com/mandelsoft/vfs v0.0.0-20210530103237-5249dc39ce91
github.com/minio/minio-go v6.0.14+incompatible
github.com/olekukonko/tablewriter v0.0.4
github.com/onsi/ginkgo v1.14.1
github.com/onsi/gomega v1.10.5
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.13.0
github.com/peterbourgon/diskv v2.0.1+incompatible
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.7.0
github.com/spf13/cobra v1.1.1
github.com/spf13/cobra v1.2.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.0
go.uber.org/zap v1.16.0
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
google.golang.org/api v0.22.0
google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a
gopkg.in/yaml.v2 v2.3.0
github.com/spf13/viper v1.8.1
go.uber.org/zap v1.17.0
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4
golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602
google.golang.org/api v0.44.0
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c
gopkg.in/yaml.v2 v2.4.0
helm.sh/helm/v3 v3.5.3
k8s.io/api v0.20.2
k8s.io/apiextensions-apiserver v0.20.2
Expand Down
265 changes: 218 additions & 47 deletions go.sum

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions hack/generate-code
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ PROJECT_ROOT="${CURRENT_DIR}"/..

rm -f ${GOPATH}/bin/*-gen

chmod +x "${PROJECT_ROOT}"/vendor/k8s.io/code-generator/*.sh

echo "> Generating internal groups for TestMachinery"
"${PROJECT_ROOT}"/vendor/k8s.io/code-generator/generate-internal-groups.sh \
deep-copy,defaulter,conversion \
Expand Down
4 changes: 2 additions & 2 deletions pkg/hostscheduler/gkescheduler/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ func restConfigFromCluster(cluster *containerpb.Cluster) (*rest.Config, error) {
CertData: cert,
KeyData: key,
},
Username: auth.GetUsername(),
Password: auth.GetPassword(),
Username: auth.GetUsername(), //nolint
Password: auth.GetPassword(), //nolint
}
return cfg, nil
}
Expand Down
13 changes: 10 additions & 3 deletions pkg/testrunner/componentdescriptor/componentdescriptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ import (
"context"
"fmt"
"io/ioutil"
"os"
"strings"

"github.com/gardener/component-cli/ociclient"
ociopts "github.com/gardener/component-cli/ociclient/options"
comphelper "github.com/gardener/component-cli/pkg/components"
"github.com/gardener/component-cli/pkg/commands/constants"
cdcomponents "github.com/gardener/component-cli/pkg/components"
cdv2 "github.com/gardener/component-spec/bindings-go/apis/v2"
"github.com/gardener/component-spec/bindings-go/codec"
"github.com/gardener/component-spec/bindings-go/ctf/ctfutils"
cdoci "github.com/gardener/component-spec/bindings-go/oci"
"github.com/go-logr/logr"
"github.com/mandelsoft/vfs/pkg/osfs"

Expand All @@ -42,8 +46,11 @@ func GetComponents(ctx context.Context, log logr.Logger, ociClient ociclient.Cli
if err := codec.Decode(content, compDesc, codec.DisableValidation(true)); err != nil {
return nil, err
}
resolver := comphelper.New(log, osfs.New(), ociClient, codec.DisableValidation(true))
compList, err := comphelper.ResolveTransitiveComponentDescriptors(ctx, resolver, compDesc)
resolver := cdoci.NewResolver(ociClient, codec.DisableValidation(true)).WithLog(log)
if len(os.Getenv(constants.ComponentRepositoryCacheDirEnvVar)) != 0 {
resolver.WithCache(cdcomponents.NewLocalComponentCache(osfs.New()))
}
compList, err := ctfutils.ResolveList(ctx, resolver, compDesc.GetEffectiveRepositoryContext(), compDesc.GetName(), compDesc.GetVersion())
if err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ var _ = Describe("componentdescriptor test", func() {
It("Should parse a component descriptor and return 2 dependencies", func() {
input, err := ioutil.ReadFile("./testdata/component_descriptor_1")
Expect(err).ToNot(HaveOccurred(), "Cannot read json file from ./testdata/component_descriptor_1")
Expect(os.Setenv(constants.ComponentRepositoryCacheDirEnvVar, "./testdata")).To(Succeed())
defer os.Unsetenv(constants.ComponentRepositoryCacheDirEnvVar)

dependencies, err := GetComponents(ctx, log.NullLogger{}, mockOCIClient, input)
Expect(err).ToNot(HaveOccurred())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
meta:
schemaVersion: 'v2'

component:
name: 'github.com/gardener/gardener'
version: '0.17.0'

repositoryContexts:
- type: 'ociRegistry'
baseUrl: 'registry.example'
provider: 'internal'
sources: []
resources: []
componentReferences:
- name: 'dashboard'
componentName: 'github.com/gardener/dashboard'
version: '1.27.0'
6 changes: 5 additions & 1 deletion pkg/testrunner/template/template_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"path/filepath"
"testing"

"github.com/gardener/component-cli/pkg/commands/constants"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
Expand All @@ -28,6 +29,7 @@ var (
defaultTestdataDir string
shootTestdataDir string
gardenerKubeconfig string
componentCacheDir string
componentDescriptorPath string
)

Expand All @@ -41,10 +43,12 @@ var _ = BeforeSuite(func() {
Expect(err).ToNot(HaveOccurred())
testdataDir, err = filepath.Abs(filepath.Join(wd, "testdata"))
Expect(err).ToNot(HaveOccurred())
componentCacheDir = testdataDir

defaultTestdataDir = filepath.Join(testdataDir, "default")
shootTestdataDir = filepath.Join(testdataDir, "shoot")

gardenerKubeconfig = filepath.Join(testdataDir, "test-kubeconfig.yaml")
componentDescriptorPath = filepath.Join(testdataDir, "test-cd.yaml")
componentDescriptorPath = filepath.Join(componentCacheDir, "registry.example/github.com/gardener/gardener-0.30.0")
Expect(os.Setenv(constants.ComponentRepositoryCacheDirEnvVar, componentCacheDir))
})
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ component:
sources: []
resources: []
componentReferences: []

1 change: 1 addition & 0 deletions vendor/cloud.google.com/go/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading