Skip to content

Commit

Permalink
Fix 2.13.0 (#1641)
Browse files Browse the repository at this point in the history
* add label to descriptor (#1625)

* Remove helm chart bundling of `KubeBuilder` projects (#1581)

* remove helm chart bundling of kubebuilder projectss

* update golang-ci version to latets

* go fmt

* rm unused code

* rm commented code

* go fmt

* fix error caps

* fix failing tests

* refactor project build signature

* fix linting

* fix linting

* fix linting ii

* fix linting iii

* fix linting

* fix linting

* fix linting

* fix linting

* fix linting

* Remove envtest logs for verbose mode (#1629)

* Support the installation of specific Garden Linux version for Gardener (#1630)

* Add gardenlinux flag for Gardener provisioning

* generate docs

* fix test

* fix test

* Add missing comment

Co-authored-by: Małgorzata Świeca <[email protected]>

* Fix indentation

---------

Co-authored-by: Małgorzata Świeca <[email protected]>

* Replace key parsing logic with ocm signing (#1633)

* replace public key parsing logic with what offered by ocm

* replace private key parsing logic with what offered by ocm

* change signature name and issuer

* Upgrade hydroform version (#1635)

* Configure creds for empty auth (#1634)

* Debug

* Fix for credentials

* Cleanup

---------

Co-authored-by: Xin Ruan <[email protected]>
Co-authored-by: Ali Khlifi <[email protected]>
Co-authored-by: Nesma Badr <[email protected]>
Co-authored-by: Małgorzata Świeca <[email protected]>
Co-authored-by: Tomasz Smelcerz <[email protected]>
  • Loading branch information
6 people authored Apr 24, 2023
1 parent d5cb772 commit e690232
Show file tree
Hide file tree
Showing 30 changed files with 148 additions and 198 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ bin
workspace
kyma.crt
mod

# Generated template files (generate by alpha module create)
/template.yaml
2 changes: 1 addition & 1 deletion cmd/kyma/alpha/create/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ func (cmd *command) validateDefaultCR(ctx context.Context, modDef *module.Defini
return err
}

if err := crValidator.Run(ctx, cmd.CurrentStep, cmd.opts.Verbose, l); err != nil {
if err := crValidator.Run(ctx, l); err != nil {
if errors.Is(err, module.ErrEmptyCR) {
cmd.CurrentStep.Successf("Default CR validation skipped - no default CR")
return nil
Expand Down
1 change: 1 addition & 0 deletions cmd/kyma/provision/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

const DefaultK8sShortVersion = "1.25" //default Kubernetes version for provisioning clusters on hyperscalers
const DefaultK8sFullVersion = DefaultK8sShortVersion + ".6" //default Kubernetes version with the "patch" component (mainly for K3d/K3s)
const DefaultGardenLinuxVersion = "934.6.0" //default Garden Linux version

// NewCmd creates a new provision command
func NewCmd() *cobra.Command {
Expand Down
4 changes: 4 additions & 0 deletions cmd/kyma/provision/gardener/aws/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ Use service account details to create a Secret and import it in Gardener.`,
&o.HibernationLocation, "hibernation-location", "Europe/Berlin",
"Timezone in which the hibernation schedule should be applied.",
)
cmd.Flags().StringVarP(
&o.GardenLinuxVersion, "gardenlinux-version", "g", provision.DefaultGardenLinuxVersion,
"Garden Linux version of the cluster.",
)

return cmd
}
15 changes: 8 additions & 7 deletions cmd/kyma/provision/gardener/aws/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,13 @@ func TestProvisionGardenerAWSSubcommands(t *testing.T) {
func TestNewCluster(t *testing.T) {
t.Parallel()
o := &Options{
Name: "mega-cluster",
KubernetesVersion: "1.19.0",
Region: "north-pole",
MachineType: "HAL",
DiskSizeGB: 9000,
ScalerMax: 3,
Name: "mega-cluster",
KubernetesVersion: "1.19.0",
Region: "north-pole",
MachineType: "HAL",
DiskSizeGB: 9000,
ScalerMax: 3,
GardenLinuxVersion: "576.7.0",
}
cmd := newAwsCmd(o)
c := cmd.NewCluster()
Expand Down Expand Up @@ -145,7 +146,7 @@ func TestNewProvider(t *testing.T) {
custom["workercidr"] = "10.250.0.0/16"
custom["networking_type"] = "calico"
custom["machine_image_name"] = "gardenlinux"
custom["machine_image_version"] = "934.6.0"
custom["machine_image_version"] = o.GardenLinuxVersion
custom["hibernation_start"] = "00 18 * * 1,2,3,4,5"
custom["hibernation_end"] = ""
custom["hibernation_location"] = "Europe/Berlin"
Expand Down
1 change: 1 addition & 0 deletions cmd/kyma/provision/gardener/aws/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type Options struct {
CredentialsFile string
Secret string
KubernetesVersion string
GardenLinuxVersion string
Region string
Zones []string
MachineType string
Expand Down
2 changes: 1 addition & 1 deletion cmd/kyma/provision/gardener/aws/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (c *awsCmd) NewProvider() (*types.Provider, error) {
p.CustomConfigurations["workercidr"] = "10.250.0.0/16"
p.CustomConfigurations["networking_type"] = "calico"
p.CustomConfigurations["machine_image_name"] = "gardenlinux"
p.CustomConfigurations["machine_image_version"] = "934.6.0"
p.CustomConfigurations["machine_image_version"] = c.opts.GardenLinuxVersion
p.CustomConfigurations["zones"] = c.opts.Zones
p.CustomConfigurations["hibernation_start"] = c.opts.HibernationStart
p.CustomConfigurations["hibernation_end"] = c.opts.HibernationEnd
Expand Down
4 changes: 4 additions & 0 deletions cmd/kyma/provision/gardener/az/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ Create a service account with the ` + "`contributor`" + ` role. Use service acco
&o.HibernationLocation, "hibernation-location", "Europe/Berlin",
"Timezone in which the hibernation schedule should be applied.",
)
cmd.Flags().StringVarP(
&o.GardenLinuxVersion, "gardenlinux-version", "g", provision.DefaultGardenLinuxVersion,
"Garden Linux version of the cluster.",
)

return cmd
}
6 changes: 5 additions & 1 deletion cmd/kyma/provision/gardener/az/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ func TestProvisionGardenerAzureFlags(t *testing.T) {
require.Equal(t, "00 18 * * 1,2,3,4,5", o.HibernationStart, "Default value for the project flag not as expected.")
require.Equal(t, "", o.HibernationEnd, "Default value for the project flag not as expected.")
require.Equal(t, "Europe/Berlin", o.HibernationLocation, "Default value for the project flag not as expected.")
require.Equal(
t, provision.DefaultGardenLinuxVersion, o.GardenLinuxVersion,
"Default value for the gardenlinux-version flag not as expected.",
)

// test passing flags
err := c.ParseFlags(
Expand Down Expand Up @@ -145,7 +149,7 @@ func TestNewProvider(t *testing.T) {
custom["workercidr"] = "10.250.0.0/16"
custom["networking_type"] = "calico"
custom["machine_image_name"] = "gardenlinux"
custom["machine_image_version"] = "934.6.0"
custom["machine_image_version"] = o.GardenLinuxVersion
custom["hibernation_start"] = "00 18 * * 1,2,3,4,5"
custom["hibernation_end"] = ""
custom["hibernation_location"] = "Europe/Berlin"
Expand Down
1 change: 1 addition & 0 deletions cmd/kyma/provision/gardener/az/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type Options struct {
CredentialsFile string
Secret string
KubernetesVersion string
GardenLinuxVersion string
Region string
Zones []string
MachineType string
Expand Down
2 changes: 1 addition & 1 deletion cmd/kyma/provision/gardener/az/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (c *azCmd) NewProvider() (*types.Provider, error) {
p.CustomConfigurations["workercidr"] = "10.250.0.0/16"
p.CustomConfigurations["networking_type"] = "calico"
p.CustomConfigurations["machine_image_name"] = "gardenlinux"
p.CustomConfigurations["machine_image_version"] = "934.6.0"
p.CustomConfigurations["machine_image_version"] = c.opts.GardenLinuxVersion
p.CustomConfigurations["zones"] = c.opts.Zones
p.CustomConfigurations["hibernation_start"] = c.opts.HibernationStart
p.CustomConfigurations["hibernation_end"] = c.opts.HibernationEnd
Expand Down
4 changes: 4 additions & 0 deletions cmd/kyma/provision/gardener/gcp/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ Use service account details to create a Secret and import it in Gardener.`,
&o.HibernationLocation, "hibernation-location", "Europe/Berlin",
"Timezone in which the hibernation schedule should be applied.",
)
cmd.Flags().StringVarP(
&o.GardenLinuxVersion, "gardenlinux-version", "g", provision.DefaultGardenLinuxVersion,
"Garden Linux version of the cluster.",
)

return cmd
}
5 changes: 4 additions & 1 deletion cmd/kyma/provision/gardener/gcp/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func TestProvisionGardenerGCPFlags(t *testing.T) {
"--scaler-max", "99",
"--extra", "VAR1=VALUE1,VAR2=VALUE2",
"--attempts", "2",
"--gardenlinux-version", "934.7",
},
)

Expand All @@ -72,6 +73,7 @@ func TestProvisionGardenerGCPFlags(t *testing.T) {
require.Equal(t, "a big one", o.DiskType, "The parsed value for the disk-type flag not as expected.")
require.Equal(t, 88, o.ScalerMin, "The parsed value for the scaler-min flag not as expected.")
require.Equal(t, 99, o.ScalerMax, "The parsed value for the scaler-max flag not as expected.")
require.Equal(t, "934.7", o.GardenLinuxVersion, "The parsed value for the gardenlinux-version flag not as expected.")
require.Equal(
t, []string{"VAR1=VALUE1", "VAR2=VALUE2"}, o.Extra, "The parsed value for the extra flag not as expected.",
)
Expand Down Expand Up @@ -120,6 +122,7 @@ func TestNewProvider(t *testing.T) {
HibernationStart: "00 18 * * 1,2,3,4,5",
HibernationLocation: "Europe/Berlin",
Extra: []string{"VAR1=VALUE1", "VAR2=VALUE2"},
GardenLinuxVersion: "934.7",
}
cmd := newGcpCmd(o)
p, err := cmd.NewProvider()
Expand All @@ -145,7 +148,7 @@ func TestNewProvider(t *testing.T) {
custom["workercidr"] = "10.250.0.0/16"
custom["networking_type"] = "calico"
custom["machine_image_name"] = "gardenlinux"
custom["machine_image_version"] = "934.6.0"
custom["machine_image_version"] = o.GardenLinuxVersion
custom["hibernation_start"] = "00 18 * * 1,2,3,4,5"
custom["hibernation_end"] = ""
custom["hibernation_location"] = "Europe/Berlin"
Expand Down
1 change: 1 addition & 0 deletions cmd/kyma/provision/gardener/gcp/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type Options struct {
CredentialsFile string
Secret string
KubernetesVersion string
GardenLinuxVersion string
Region string
Zones []string
MachineType string
Expand Down
2 changes: 1 addition & 1 deletion cmd/kyma/provision/gardener/gcp/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (c *gcpCmd) NewProvider() (*types.Provider, error) {
p.CustomConfigurations["workercidr"] = "10.250.0.0/16"
p.CustomConfigurations["networking_type"] = "calico"
p.CustomConfigurations["machine_image_name"] = "gardenlinux"
p.CustomConfigurations["machine_image_version"] = "934.6.0"
p.CustomConfigurations["machine_image_version"] = c.opts.GardenLinuxVersion
p.CustomConfigurations["zones"] = c.opts.Zones
p.CustomConfigurations["hibernation_start"] = c.opts.HibernationStart
p.CustomConfigurations["hibernation_end"] = c.opts.HibernationEnd
Expand Down
1 change: 1 addition & 0 deletions docs/gen-docs/kyma_provision_gardener_aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ kyma provision gardener aws [flags]
--disk-size int Disk size (in GB) of the cluster. (default 50)
--disk-type string Type of disk to use on AWS. (default "gp2")
-e, --extra NAME=VALUE One or more arguments provided as the NAME=VALUE key-value pairs to configure additional cluster settings. You can use this flag multiple times or enter the key-value pairs as a comma-separated list.
-g, --gardenlinux-version string Garden Linux version of the cluster. (default "934.6.0")
--hibernation-end string Cron expression to configure when the cluster should stop hibernating
--hibernation-location string Timezone in which the hibernation schedule should be applied. (default "Europe/Berlin")
--hibernation-start string Cron expression to configure when the cluster should start hibernating (default "00 18 * * 1,2,3,4,5")
Expand Down
1 change: 1 addition & 0 deletions docs/gen-docs/kyma_provision_gardener_az.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ kyma provision gardener az [flags]
--disk-size int Disk size (in GB) of the cluster. (default 50)
--disk-type string Type of disk to use on Azure. (default "Standard_LRS")
-e, --extra NAME=VALUE One or more arguments provided as the NAME=VALUE key-value pairs to configure additional cluster settings. You can use this flag multiple times or enter the key-value pairs as a comma-separated list.
-g, --gardenlinux-version string Garden Linux version of the cluster. (default "934.6.0")
--hibernation-end string Cron expression to configure when the cluster should stop hibernating
--hibernation-location string Timezone in which the hibernation schedule should be applied. (default "Europe/Berlin")
--hibernation-start string Cron expression to configure when the cluster should start hibernating (default "00 18 * * 1,2,3,4,5")
Expand Down
1 change: 1 addition & 0 deletions docs/gen-docs/kyma_provision_gardener_gcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ kyma provision gardener gcp [flags]
--disk-size int Disk size (in GB) of the cluster. (default 50)
--disk-type string Type of disk to use on GCP. (default "pd-standard")
-e, --extra NAME=VALUE One or more arguments provided as the NAME=VALUE key-value pairs to configure additional cluster settings. You can use this flag multiple times or enter the key-value pairs as a comma-separated list.
-g, --gardenlinux-version string Garden Linux version of the cluster. (default "934.6.0")
--hibernation-end string Cron expression to configure when the cluster should stop hibernating
--hibernation-location string Timezone in which the hibernation schedule should be applied. (default "Europe/Berlin")
--hibernation-start string Cron expression to configure when the cluster should start hibernating (default "00 18 * * 1,2,3,4,5")
Expand Down
15 changes: 7 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (
github.com/imdario/mergo v0.3.13
github.com/kyma-incubator/reconciler v0.0.0-20230414081633-01086c789985
github.com/kyma-project/hydroform/function v0.0.0-20230307104736-fc661e702543
github.com/kyma-project/hydroform/provision v0.0.0-20230127124234-b67611c40868
github.com/kyma-project/hydroform/provision v0.0.0-20230418133637-1ea26b368bb6
github.com/kyma-project/lifecycle-manager v0.0.0-20230228084539-adc0e4a5f93a
github.com/mandelsoft/vfs v0.0.0-20220805210647-bf14a11bfe31
github.com/open-component-model/ocm v0.3.0-rc.1
Expand Down Expand Up @@ -112,7 +112,6 @@ require (
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
github.com/elazarl/goproxy v0.0.0-20191011121108-aa519ddbe484 // indirect
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
Expand All @@ -122,7 +121,7 @@ require (
github.com/fatih/structs v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fvbommel/sortorder v1.0.2 // indirect
github.com/gardener/gardener v1.53.2 // indirect
github.com/gardener/gardener v1.67.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-cmd/cmd v1.4.1 // indirect
github.com/go-errors/errors v1.4.2 // indirect
Expand Down Expand Up @@ -251,14 +250,14 @@ require (
go.starlark.net v0.0.0-20230128213706-3f75dec8e403 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/crypto v0.5.0 // indirect
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/oauth2 v0.4.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.6.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
Expand Down
Loading

0 comments on commit e690232

Please sign in to comment.