Skip to content

Commit

Permalink
Update release 212 (#1618)
Browse files Browse the repository at this point in the history
* gomod(deps): bump k8s.io/klog/v2 from 2.90.0 to 2.90.1 (#1572)

Bumps [k8s.io/klog/v2](https://github.com/kubernetes/klog) from 2.90.0 to 2.90.1.
- [Release notes](https://github.com/kubernetes/klog/releases)
- [Changelog](https://github.com/kubernetes/klog/blob/main/RELEASE.md)
- [Commits](kubernetes/klog@v2.90.0...v2.90.1)

---
updated-dependencies:
- dependency-name: k8s.io/klog/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* gomod(deps): bump k8s.io/apiextensions-apiserver from 0.26.1 to 0.26.2 (#1571)

Bumps [k8s.io/apiextensions-apiserver](https://github.com/kubernetes/apiextensions-apiserver) from 0.26.1 to 0.26.2.
- [Release notes](https://github.com/kubernetes/apiextensions-apiserver/releases)
- [Commits](kubernetes/apiextensions-apiserver@v0.26.1...v0.26.2)

---
updated-dependencies:
- dependency-name: k8s.io/apiextensions-apiserver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* gomod(deps): bump k8s.io/cli-runtime from 0.26.1 to 0.26.3 (#1592)

Bumps [k8s.io/cli-runtime](https://github.com/kubernetes/cli-runtime) from 0.26.1 to 0.26.3.
- [Release notes](https://github.com/kubernetes/cli-runtime/releases)
- [Commits](kubernetes/cli-runtime@v0.26.1...v0.26.3)

---
updated-dependencies:
- dependency-name: k8s.io/cli-runtime
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* gomod(deps): bump helm.sh/helm/v3 from 3.11.1 to 3.11.2 (#1596)

Bumps [helm.sh/helm/v3](https://github.com/helm/helm) from 3.11.1 to 3.11.2.
- [Release notes](https://github.com/helm/helm/releases)
- [Commits](helm/helm@v3.11.1...v3.11.2)

---
updated-dependencies:
- dependency-name: helm.sh/helm/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump Garden Linux version (#1599)

* Bump garden Linux version

* fix linting

* fix linting

* Fix security vulnerabilities  (#1603)

* upgrade go mod version to 1.19

* upgrade github.com/containers/storage to latest

* update replaced k8s.io/client-go to latest

* Use lifecycle manager image from the Kustomization for Kyma alpha deploy command (#1606)

* Use the image in manager Kustomization if the lifecycle manager flag for the alpha deploy command is not provided

* make docs

* Display using which image

* remove extra spaces

* Update docs/gen-docs/kyma_alpha_deploy.md

* remove extra space from docs

---------

Co-authored-by: Grzegorz Karaluch <[email protected]>

* gomod(deps): bump github.com/opencontainers/runc from 1.1.4 to 1.1.5 (#1613)

Bumps [github.com/opencontainers/runc](https://github.com/opencontainers/runc) from 1.1.4 to 1.1.5.
- [Release notes](https://github.com/opencontainers/runc/releases)
- [Changelog](https://github.com/opencontainers/runc/blob/v1.1.5/CHANGELOG.md)
- [Commits](opencontainers/runc@v1.1.4...v1.1.5)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/runc
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* gomod(deps): bump sigs.k8s.io/controller-runtime from 0.14.4 to 0.14.6 (#1610)

Bumps [sigs.k8s.io/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime) from 0.14.4 to 0.14.6.
- [Release notes](https://github.com/kubernetes-sigs/controller-runtime/releases)
- [Changelog](https://github.com/kubernetes-sigs/controller-runtime/blob/main/RELEASE.md)
- [Commits](kubernetes-sigs/controller-runtime@v0.14.4...v0.14.6)

---
updated-dependencies:
- dependency-name: sigs.k8s.io/controller-runtime
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Introduce sign process to create module (#1608)

* - Introduce sign process to create module
- hardcode SignatureName instead of option
- upgrade ocm lib

* update go sum

* provision/k3d: Add "k3d-registry-arg" Flag (#1604)

* chore: Bump dependencies to fix CVEs  (#1617)

* Replace indirect /vbatts/tar-split with pinned v0.11.3

* Bump ocm pkg

* Bump reconciler ref

* Set latest Kyma release version

* Update docs

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Piotr Halama <[email protected]>
Co-authored-by: Ali Khlifi <[email protected]>
Co-authored-by: Nesma Badr <[email protected]>
Co-authored-by: Grzegorz Karaluch <[email protected]>
Co-authored-by: Xin Ruan <[email protected]>
Co-authored-by: Hukumraj Singh Deora <[email protected]>
  • Loading branch information
8 people authored Apr 3, 2023
1 parent 2519ba1 commit 5a0641d
Show file tree
Hide file tree
Showing 23 changed files with 354 additions and 313 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ FLAGS = -ldflags '-s -w -X github.com/kyma-project/cli/cmd/kyma/version.Version=

.PHONY: resolve
resolve:
go mod tidy -compat=1.18
go mod tidy

.PHONY: validate
validate:
Expand Down
33 changes: 20 additions & 13 deletions cmd/kyma/alpha/create/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ Build module my-domain/modB in version 3.2.1 and push it to a local registry "un
"the security scan configuration.",
)

cmd.Flags().StringVar(
&o.PrivateKeyPath, "key", "", "Specifies the path where a private key is used for signing.",
)

return cmd
}

Expand All @@ -152,19 +156,7 @@ func (cmd *command) Run(ctx context.Context) error {
cli.AlphaWarn()
}

if err := cmd.opts.ValidateVersion(); err != nil {
return err
}

if err := cmd.opts.ValidatePath(); err != nil {
return err
}

if err := cmd.opts.ValidateChannel(); err != nil {
return err
}

if err := cmd.opts.ValidateTarget(); err != nil {
if err := cmd.opts.Validate(); err != nil {
return err
}

Expand Down Expand Up @@ -256,6 +248,21 @@ func (cmd *command) Run(ctx context.Context) error {
}
cmd.CurrentStep.Successf("Module successfully pushed to %q", cmd.opts.RegistryURL)

if cmd.opts.PrivateKeyPath != "" {
signCfg := &module.ComponentSignConfig{
Name: modDef.Name,
Version: modDef.Version,
KeyPath: cmd.opts.PrivateKeyPath,
}

cmd.NewStep("Fetching and signing component descriptor...")
if err = module.Sign(signCfg, remote); err != nil {
cmd.CurrentStep.Failure()
return err
}
cmd.CurrentStep.Success()
}

cmd.NewStep("Generating module template")
t, err := module.Template(componentVersionAccess, cmd.opts.Channel, cmd.opts.Target, modDef.DefaultCR, cmd.opts.RegistryCredSelector)
if err != nil {
Expand Down
17 changes: 17 additions & 0 deletions cmd/kyma/alpha/create/module/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type Options struct {
ArchiveVersionOverwrite bool
RegistryCredSelector string
SecurityScanConfig string
PrivateKeyPath string
}

const (
Expand Down Expand Up @@ -107,3 +108,19 @@ func (o *Options) ValidateTarget() error {
}
return fmt.Errorf("target %s is invalid, allowed: %s", o.Target, valid)
}

func (o *Options) Validate() error {
if err := o.ValidateVersion(); err != nil {
return err
}

if err := o.ValidatePath(); err != nil {
return err
}

if err := o.ValidateChannel(); err != nil {
return err
}

return o.ValidateTarget()
}
4 changes: 2 additions & 2 deletions cmd/kyma/alpha/deploy/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ By default, Lifecycle Manager is deployed from the GitHub main branch.`,
cobraCmd.Flags().StringVar(
&o.LifecycleManager,
"lifecycle-manager",
"eu.gcr.io/kyma-project/lifecycle-manager:latest",
"",
`Installs Lifecycle Manager with the specified image:
- Use "my-registry.org/lifecycle-manager:my-tag"" to use a custom version of Lifecycle Manager.
- Use "europe-docker.pkg.dev/kyma-project/prod/lifecycle-manager@sha256:cb74b29cfe80c639c9ee9..." to use a custom version of Lifecycle Manager with a digest.
- Specify a tag to override the default one. For example, when specifying "v20230220-7b8e9515", the "eu.gcr.io/kyma-project/lifecycle-manager:v20230220-7b8e9515" tag is used.`,
- Specify a tag to override the default one. For example, when specifying "v20230220-7b8e9515", the "eu.gcr.io/kyma-project/lifecycle-manager:v20230220-7b8e9515" tag is used.`,
)
cobraCmd.Flags().BoolVar(
&o.DryRun,
Expand Down
12 changes: 4 additions & 8 deletions cmd/kyma/alpha/sign/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ This command signs all module resources recursively based on an unsigned compone
cmd.Flags().StringVar(
&o.PrivateKeyPath, "key", "", "Specifies the path where a private key is used for signing.",
)
cmd.Flags().StringVar(
&o.SignatureName, "signature-name", "kyma-project.io/module-signature", "name of the signature to use.",
)
cmd.Flags().StringVar(
&o.RegistryURL, "registry", "", "Context URL of the repository for the module. "+
"The repository's URL is automatically added to the repository's contexts in the module.",
Expand Down Expand Up @@ -70,10 +67,9 @@ func (c *command) Run(_ []string) error {
}

signCfg := &module.ComponentSignConfig{
Name: c.opts.Name,
Version: c.opts.Version,
KeyPath: c.opts.PrivateKeyPath,
SignatureName: c.opts.SignatureName,
Name: c.opts.Name,
Version: c.opts.Version,
KeyPath: c.opts.PrivateKeyPath,
}

c.NewStep("Fetching and signing component descriptor...")
Expand All @@ -91,7 +87,7 @@ func (c *command) Run(_ []string) error {
Insecure: c.opts.Insecure,
}

if err := module.Sign(signCfg, remote); err != nil {
if err = module.Sign(signCfg, remote); err != nil {
c.CurrentStep.Failure()
return err
}
Expand Down
1 change: 0 additions & 1 deletion cmd/kyma/alpha/sign/module/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ type Options struct {
RegistryURL string
NameMappingMode string
PrivateKeyPath string
SignatureName string
Credentials string
Token string
Insecure bool
Expand Down
10 changes: 3 additions & 7 deletions cmd/kyma/alpha/verify/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ Kyma modules can be cryptographically signed to ensure they are correct and dist
cmd.Flags().StringVar(
&o.PublicKeyPath, "key", "", "Specifies the path where a public key is used for signing.",
)
cmd.Flags().StringVar(
&o.SignatureName, "signature-name", "kyma-project.io/module-signature", "name of the signature to use.",
)
cmd.Flags().StringVar(
&o.RegistryURL, "registry", "", "Context URL of the repository for the module. "+
"The repository's URL is automatically added to the repository's contexts in the module.",
Expand Down Expand Up @@ -71,10 +68,9 @@ func (c *command) Run(_ []string) error {
}

signCfg := &module.ComponentSignConfig{
Name: c.opts.Name,
Version: c.opts.Version,
KeyPath: c.opts.PublicKeyPath,
SignatureName: c.opts.SignatureName,
Name: c.opts.Name,
Version: c.opts.Version,
KeyPath: c.opts.PublicKeyPath,
}

c.NewStep("Fetching and verifying component descriptor...")
Expand Down
1 change: 0 additions & 1 deletion cmd/kyma/alpha/verify/module/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ type Options struct {
RegistryURL string
NameMappingMode string
PublicKeyPath string
SignatureName string
Credentials string
Token string
Insecure bool
Expand Down
10 changes: 7 additions & 3 deletions cmd/kyma/provision/k3d/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ func NewCmd(o *Options) *cobra.Command {
&o.K3dArgs, "k3d-arg", "", []string{},
"One or more arguments passed to the k3d provisioning command (e.g. --k3d-arg='--no-rollback')",
)
cmd.Flags().StringSliceVarP(
&o.K3dRegistryArgs, "k3d-registry-arg", "", []string{},
"One or more arguments passed to the k3d registry create command (e.g. --k3d-registry-arg='--default-network podman')",
)
cmd.Flags().StringVarP(
&o.KubernetesVersion, "kube-version", "k", provision.DefaultK8sFullVersion, "Kubernetes version of the cluster",
)
Expand Down Expand Up @@ -205,7 +209,7 @@ func (c *command) PromptUserToDeleteExistingCluster() bool {
func (c *command) createK3dRegistry(k3dClient k3d.Client) (string, error) {
s := c.NewStep("Create k3d registry")

registryURL, err := k3dClient.CreateRegistry(c.opts.RegistryPort)
registryURL, err := k3dClient.CreateRegistry(c.opts.RegistryPort, parseNestedArgs(c.opts.K3dRegistryArgs))
if err != nil {
s.Failuref("Could not create k3d registry")
return "", err
Expand All @@ -219,7 +223,7 @@ func (c *command) createK3dCluster(k3dClient k3d.Client) error {
s := c.NewStep(fmt.Sprintf("Create K3d cluster '%s'", c.opts.Name))

settings := k3d.CreateClusterSettings{
Args: parseK3dArgs(c.opts.K3dArgs),
Args: parseNestedArgs(c.opts.K3dArgs),
KubernetesVersion: c.opts.KubernetesVersion,
PortMapping: c.opts.PortMapping,
Workers: c.opts.Workers,
Expand Down Expand Up @@ -264,7 +268,7 @@ func allocatePorts(ports ...int) error {
return nil
}

func parseK3dArgs(args []string) []string {
func parseNestedArgs(args []string) []string {
var res []string
for _, arg := range args {
res = append(res, strings.Split(arg, " ")...)
Expand Down
1 change: 1 addition & 0 deletions cmd/kyma/provision/k3d/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type Options struct {
UseRegistry []string
RegistryPort string
K3dArgs []string
K3dRegistryArgs []string
KubernetesVersion string
PortMapping []string
}
Expand Down
1 change: 1 addition & 0 deletions docs/gen-docs/kyma_alpha_create_module.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Build module my-domain/modB in version 3.2.1 and push it to a local registry "un
--default-cr string File containing the default custom resource of the module. If the module is a kubebuilder project, the default CR is automatically detected.
--descriptor-version string Schema version to use for the generated OCM descriptor. One of ocm.software/v3alpha1,v2 (default "v2")
--insecure Uses an insecure connection to access the registry.
--key string Specifies the path where a private key is used for signing.
--module-archive-path string Specifies the path where the module artifacts are locally cached to generate the image. If the path already has a module, use the "--module-archive-version-overwrite" flag to overwrite it. (default "./mod")
--module-archive-persistence Uses the host filesystem instead of in-memory archiving to build the module.
--module-archive-version-overwrite Overwrites existing component's versions of the module. If set to false, the push is a No-Op.
Expand Down
2 changes: 1 addition & 1 deletion docs/gen-docs/kyma_alpha_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ kyma alpha deploy [flags]
--lifecycle-manager string Installs Lifecycle Manager with the specified image:
- Use "my-registry.org/lifecycle-manager:my-tag"" to use a custom version of Lifecycle Manager.
- Use "europe-docker.pkg.dev/kyma-project/prod/lifecycle-manager@sha256:cb74b29cfe80c639c9ee9..." to use a custom version of Lifecycle Manager with a digest.
- Specify a tag to override the default one. For example, when specifying "v20230220-7b8e9515", the "eu.gcr.io/kyma-project/lifecycle-manager:v20230220-7b8e9515" tag is used. (default "eu.gcr.io/kyma-project/lifecycle-manager:latest")
- Specify a tag to override the default one. For example, when specifying "v20230220-7b8e9515", the "eu.gcr.io/kyma-project/lifecycle-manager:v20230220-7b8e9515" tag is used.
-m, --module stringArray Provide one or more modules to activate after the deployment is finished. Example: "--module name@namespace" (namespace is optional).
-n, --namespace string The Namespace to deploy the Kyma custom resource in. (default "kyma-system")
--open-dashboard Opens the Busola Dashboard at startup. Only works when a graphical interface is available and when running in interactive mode
Expand Down
17 changes: 8 additions & 9 deletions docs/gen-docs/kyma_alpha_sign_module.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ kyma alpha sign module --name MODULE_NAME --version MODULE_VERSION --registry MO
## Flags

```bash
-c, --credentials string Basic authentication credentials for the given registry in the user:password format
--insecure Uses an insecure connection to access the registry.
--key string Specifies the path where a private key is used for signing.
--name string Name of the module.
--name-mapping string Overrides the OCM Component Name Mapping, Use: "urlPath" or "sha256-digest". (default "urlPath")
--registry string Context URL of the repository for the module. The repository's URL is automatically added to the repository's contexts in the module.
--signature-name string name of the signature to use. (default "kyma-project.io/module-signature")
-t, --token string Authentication token for the given registry (alternative to basic authentication).
--version string Version of the module.
-c, --credentials string Basic authentication credentials for the given registry in the user:password format
--insecure Uses an insecure connection to access the registry.
--key string Specifies the path where a private key is used for signing.
--name string Name of the module.
--name-mapping string Overrides the OCM Component Name Mapping, Use: "urlPath" or "sha256-digest". (default "urlPath")
--registry string Context URL of the repository for the module. The repository's URL is automatically added to the repository's contexts in the module.
-t, --token string Authentication token for the given registry (alternative to basic authentication).
--version string Version of the module.
```
## Flags inherited from parent commands
Expand Down
17 changes: 8 additions & 9 deletions docs/gen-docs/kyma_alpha_verify_module.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ kyma alpha verify module --name MODULE_NAME --version MODULE_VERSION --registry
## Flags

```bash
-c, --credentials string Basic authentication credentials for the given registry in the user:password format
--insecure Uses an insecure connection to access the registry.
--key string Specifies the path where a public key is used for signing.
--name string Name of the module.
--name-mapping string Overrides the OCM Component Name Mapping, Use: "urlPath" or "sha256-digest". (default "urlPath")
--registry string Context URL of the repository for the module. The repository's URL is automatically added to the repository's contexts in the module.
--signature-name string name of the signature to use. (default "kyma-project.io/module-signature")
-t, --token string Authentication token for the given registry (alternative to basic authentication).
--version string Version of the module.
-c, --credentials string Basic authentication credentials for the given registry in the user:password format
--insecure Uses an insecure connection to access the registry.
--key string Specifies the path where a public key is used for signing.
--name string Name of the module.
--name-mapping string Overrides the OCM Component Name Mapping, Use: "urlPath" or "sha256-digest". (default "urlPath")
--registry string Context URL of the repository for the module. The repository's URL is automatically added to the repository's contexts in the module.
-t, --token string Authentication token for the given registry (alternative to basic authentication).
--version string Version of the module.
```
## Flags inherited from parent commands
Expand Down
2 changes: 1 addition & 1 deletion docs/gen-docs/kyma_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ kyma deploy [flags]
- Deploy a specific branch of the Kyma repository on kyma-project.org: "kyma deploy --source=<my-branch-name>"
- Deploy a commit (8 characters or more), for example: "kyma deploy --source=34edf09a"
- Deploy a pull request, for example "kyma deploy --source=PR-9486"
- Deploy the local sources: "kyma deploy --source=local" (default "2.12.0")
- Deploy the local sources: "kyma deploy --source=local" (default "2.12.1")
-t, --timeout duration Maximum time for the deployment. (default 20m0s)
--tls-crt string TLS certificate file for the domain used for installation.
--tls-key string TLS key file for the domain used for installation.
Expand Down
19 changes: 10 additions & 9 deletions docs/gen-docs/kyma_provision_k3d.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ kyma provision k3d [flags]
## Flags

```bash
--k3d-arg strings One or more arguments passed to the k3d provisioning command (e.g. --k3d-arg='--no-rollback')
-s, --k3s-arg strings One or more arguments passed from k3d to the k3s command (format: ARG@NODEFILTER[;@NODEFILTER])
-k, --kube-version string Kubernetes version of the cluster (default "1.25.6")
--name string Name of the Kyma cluster (default "kyma")
-p, --port strings Map ports 80 and 443 of K3D loadbalancer (e.g. -p 80:80@loadbalancer -p 443:443@loadbalancer) (default [80:80@loadbalancer,443:443@loadbalancer])
--registry-port string Specify the port on which the k3d registry will be exposed (default "5001")
--registry-use strings Connect to one or more k3d-managed registries. Kyma automatically creates a registry for Serverless images.
--timeout duration Maximum time for the provisioning. If you want no timeout, enter "0". (default 5m0s)
--workers int Number of worker nodes (k3d agents) (default 1)
--k3d-arg strings One or more arguments passed to the k3d provisioning command (e.g. --k3d-arg='--no-rollback')
--k3d-registry-arg strings One or more arguments passed to the k3d registry create command (e.g. --k3d-registry-arg='--default-network podman')
-s, --k3s-arg strings One or more arguments passed from k3d to the k3s command (format: ARG@NODEFILTER[;@NODEFILTER])
-k, --kube-version string Kubernetes version of the cluster (default "1.25.6")
--name string Name of the Kyma cluster (default "kyma")
-p, --port strings Map ports 80 and 443 of K3D loadbalancer (e.g. -p 80:80@loadbalancer -p 443:443@loadbalancer) (default [80:80@loadbalancer,443:443@loadbalancer])
--registry-port string Specify the port on which the k3d registry will be exposed (default "5001")
--registry-use strings Connect to one or more k3d-managed registries. Kyma automatically creates a registry for Serverless images.
--timeout duration Maximum time for the provisioning. If you want no timeout, enter "0". (default 5m0s)
--workers int Number of worker nodes (k3d agents) (default 1)
```

## Flags inherited from parent commands
Expand Down
Loading

0 comments on commit 5a0641d

Please sign in to comment.