From 7f45900aaa5649c703863225068aefcb04e03d08 Mon Sep 17 00:00:00 2001 From: Mattia Mazzucato Date: Mon, 2 Sep 2024 17:25:19 +0200 Subject: [PATCH 01/13] Prepare 24.5.0 release Signed-off-by: Mattia Mazzucato --- CHANGELOG.md | 2 +- cmd/version.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad5e61f..d62a47a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [24.5.0] - 2024-09-03 ### Added - `cluster instance deploy`: add profiles for astarte v1.2. diff --git a/cmd/version.go b/cmd/version.go index 5cf5f87..50099d2 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -20,7 +20,7 @@ import ( "github.com/spf13/cobra" ) -var version = "24.5.0-dev" +var version = "24.5.0" // versionCmd represents the version command var versionCmd = &cobra.Command{ From b0eac00451b503a65e9327283027ddbdb83a8960 Mon Sep 17 00:00:00 2001 From: Eddy Babetto Date: Mon, 16 Sep 2024 12:35:24 +0200 Subject: [PATCH 02/13] Make update and install interface sync from async Signed-off-by: Eddy Babetto --- cmd/realm/interfaces.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/realm/interfaces.go b/cmd/realm/interfaces.go index 5b9a65f..8bf50ae 100644 --- a/cmd/realm/interfaces.go +++ b/cmd/realm/interfaces.go @@ -353,7 +353,7 @@ func getInterfaceDefinition(realm, interfaceName string, interfaceMajor int) (in } func installInterface(realm string, iface interfaces.AstarteInterface) error { - installInterfaceCall, err := astarteAPIClient.InstallInterface(realm, iface, true) + installInterfaceCall, err := astarteAPIClient.InstallInterface(realm, iface, false) if err != nil { return err } @@ -373,7 +373,7 @@ func installInterface(realm string, iface interfaces.AstarteInterface) error { } func updateInterface(realm string, interfaceName string, interfaceMajor int, newInterface interfaces.AstarteInterface) error { - updateInterfaceCall, err := astarteAPIClient.UpdateInterface(realm, interfaceName, interfaceMajor, newInterface, true) + updateInterfaceCall, err := astarteAPIClient.UpdateInterface(realm, interfaceName, interfaceMajor, newInterface, false) if err != nil { return err } From 0da7e7e5575979dbe01518ade25a2294a279cc72 Mon Sep 17 00:00:00 2001 From: Arnaldo Cesco Date: Mon, 16 Sep 2024 12:15:34 +0200 Subject: [PATCH 03/13] `cluster instance`: deprecate `destroy`, `install` and `show` commands astartectl is an Astarte client, not a k8s one. Let kubectl handle the interaction with k8s API to install/retrieve/destroy an instance. The commands are deprecated and will be removed starting from v24.11. Signed-off-by: Arnaldo Cesco --- CHANGELOG.md | 5 +++++ cmd/cluster/instance_deploy.go | 3 +++ cmd/cluster/instance_destroy.go | 3 +++ cmd/cluster/instance_show.go | 3 +++ 4 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d62a47a..2340f28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [24.5.1] - Unreleased +### Changed +- `cluster instance` {`deploy` | `destroy` | `show`} are deprecated and + will be removed from v24.11. + ## [24.5.0] - 2024-09-03 ### Added - `cluster instance deploy`: add profiles for astarte v1.2. diff --git a/cmd/cluster/instance_deploy.go b/cmd/cluster/instance_deploy.go index 30b58b7..f98f6f1 100644 --- a/cmd/cluster/instance_deploy.go +++ b/cmd/cluster/instance_deploy.go @@ -37,6 +37,9 @@ var deployCmd = &cobra.Command{ kubectl mentions. If no versions are specified, the last stable version is deployed. This should only be used for testing purposes.`, Example: ` astartectl cluster instances deploy`, RunE: clusterDeployF, + Deprecated: `This command is deprecated and will be removed in future releases. +Refer to the Astarte documentation on how to install Astarte on your cluster: +https://docs.astarte-platform.org/astarte-kubernetes-operator/latest`, } func init() { diff --git a/cmd/cluster/instance_destroy.go b/cmd/cluster/instance_destroy.go index 9cad488..d8f4adc 100644 --- a/cmd/cluster/instance_destroy.go +++ b/cmd/cluster/instance_destroy.go @@ -33,6 +33,9 @@ kubectl mentions. Please be aware of the fact that when an Astarte instance is d Example: ` astartectl cluster instances destroy astarte`, RunE: clusterDestroyF, Args: cobra.ExactArgs(1), + Deprecated: `This command is deprecated and will be removed in future releases. +Refer to the Astarte documentation on how to remove Astarte from your cluster: +https://docs.astarte-platform.org/astarte-kubernetes-operator/latest`, } func init() { diff --git a/cmd/cluster/instance_show.go b/cmd/cluster/instance_show.go index cbf45da..0f41d4f 100644 --- a/cmd/cluster/instance_show.go +++ b/cmd/cluster/instance_show.go @@ -29,6 +29,9 @@ var instanceShowCmd = &cobra.Command{ Example: ` astartectl cluster instances show astarte`, RunE: instanceShowF, Args: cobra.ExactArgs(1), + Deprecated: `This command is deprecated and will be removed in future releases. +Refer to the Astarte documentation on how to interact with Astarte: +https://docs.astarte-platform.org/astarte-kubernetes-operator/latest`, } func init() { From aecb142648b06d70c610e9f295e5adb23a2791cb Mon Sep 17 00:00:00 2001 From: Eddy Babetto Date: Mon, 9 Sep 2024 12:46:32 +0200 Subject: [PATCH 04/13] Adds various check for config files presence and validity Add checks for empty or non existent config file Add check for existing contexts folder Add viper config file consistency check Signed-off-by: Eddy Babetto --- cmd/cluster/instance_get_cluster_config.go | 13 +---- cmd/config/contexts.go | 6 +-- cmd/config/current.go | 28 ++--------- cmd/housekeeping/realms.go | 15 +----- config/base.go | 4 +- config/utils.go | 55 +++++++++++++++++++++- 6 files changed, 62 insertions(+), 59 deletions(-) diff --git a/cmd/cluster/instance_get_cluster_config.go b/cmd/cluster/instance_get_cluster_config.go index c2f0c4a..100b25d 100644 --- a/cmd/cluster/instance_get_cluster_config.go +++ b/cmd/cluster/instance_get_cluster_config.go @@ -103,18 +103,7 @@ func doGetClusterConfig(resourceName, resourceNamespace string) error { fmt.Printf("Created new Context %s\n", contextName) // Now set the current context to the new one - baseConfig, err := config.LoadBaseConfiguration(configDir) - if err != nil { - // Shoot out a warning, but don't fail - baseConfig = config.BaseConfigFile{} - fmt.Fprintf(os.Stderr, "warn: Could not load configuration file: %s. Will proceed creating a new one\n", err.Error()) - } - - baseConfig.CurrentContext = contextName - if err := config.SaveBaseConfiguration(configDir, baseConfig); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } + config.UpdateBaseConfigWithContext(configDir, contextName) fmt.Printf("Context switched to %s\n", contextName) return nil diff --git a/cmd/config/contexts.go b/cmd/config/contexts.go index 3d4b4eb..5eca963 100644 --- a/cmd/config/contexts.go +++ b/cmd/config/contexts.go @@ -135,11 +135,7 @@ func contextsListF(command *cobra.Command, args []string) error { fmt.Fprintln(os.Stderr, err) os.Exit(1) } - baseConfig, err := config.LoadBaseConfiguration(config.GetConfigDir()) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } + baseConfig := config.GetBaseConfig(configDir) w := tabwriter.NewWriter(os.Stdout, 0, 0, 4, ' ', tabwriter.DiscardEmptyColumns) // header diff --git a/cmd/config/current.go b/cmd/config/current.go index 3065576..63399f7 100644 --- a/cmd/config/current.go +++ b/cmd/config/current.go @@ -56,23 +56,13 @@ func init() { } func currentContextF(command *cobra.Command, args []string) error { - baseConfig, err := config.LoadBaseConfiguration(config.GetConfigDir()) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - + baseConfig := config.GetBaseConfig(config.GetConfigDir()) fmt.Println(baseConfig.CurrentContext) return nil } func currentClusterF(command *cobra.Command, args []string) error { - baseConfig, err := config.LoadBaseConfiguration(config.GetConfigDir()) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - + baseConfig := config.GetBaseConfig(config.GetConfigDir()) currentContext, err := config.LoadContextConfiguration(config.GetConfigDir(), baseConfig.CurrentContext) if err != nil { fmt.Fprintln(os.Stderr, err) @@ -94,16 +84,6 @@ func setCurrentContextF(command *cobra.Command, args []string) error { } func updateCurrentContext(newCurrentContext string) error { - configDir := config.GetConfigDir() - baseConfig, err := config.LoadBaseConfiguration(configDir) - if err != nil { - return err - } - if _, err := config.LoadContextConfiguration(configDir, newCurrentContext); err != nil { - return err - } - - baseConfig.CurrentContext = newCurrentContext - - return config.SaveBaseConfiguration(configDir, baseConfig) + config.UpdateBaseConfigWithContext(config.GetConfigDir(), newCurrentContext) + return nil } diff --git a/cmd/housekeeping/realms.go b/cmd/housekeeping/realms.go index 0f00072..d17d711 100644 --- a/cmd/housekeeping/realms.go +++ b/cmd/housekeeping/realms.go @@ -386,20 +386,7 @@ func realmsCreateF(command *cobra.Command, args []string) error { fmt.Printf("Context %s created successfully\n", contextName) // Now set the current context to the new one - baseConfig, err := config.LoadBaseConfiguration(configDir) - if err != nil { - // Shoot out a warning, but don't fail - baseConfig = config.BaseConfigFile{} - fmt.Fprintf(os.Stderr, "warn: Could not load configuration file: %s. Will proceed creating a new one\n", err.Error()) - } - - baseConfig.CurrentContext = contextName - if err := config.SaveBaseConfiguration(configDir, baseConfig); err != nil { - fmt.Fprintln(os.Stderr, err) - fmt.Fprintln(os.Stderr, "warn: Context not switched") - } else { - fmt.Printf("Context switched to %s\n", contextName) - } + config.UpdateBaseConfigWithContext(configDir, contextName) } return nil diff --git a/config/base.go b/config/base.go index 6fa7806..eb04435 100644 --- a/config/base.go +++ b/config/base.go @@ -15,10 +15,9 @@ package config import ( + "gopkg.in/yaml.v2" "os" "path" - - "gopkg.in/yaml.v2" ) const baseConfigName = "astartectl" @@ -58,5 +57,6 @@ func SaveBaseConfiguration(configDir string, configuration BaseConfigFile) error if err != nil { return err } + return os.WriteFile(path.Join(configDir, baseConfigName+".yaml"), contents, 0644) } diff --git a/config/utils.go b/config/utils.go index 573e1e8..ce44472 100644 --- a/config/utils.go +++ b/config/utils.go @@ -16,6 +16,7 @@ package config import ( "errors" + "fmt" "os" "path" "strings" @@ -43,7 +44,13 @@ func ConfigureViper(contextOverride string) error { } // Now, get the current context - currentContext := viper.Get("context").(string) + currentContextInterface := viper.Get("context") + currentContext := "" + //in case of empty file, the following check used to fail, now it defaults to empty context and enable file rewrite + if currentContextInterface != nil { + currentContext = currentContextInterface.(string) + } + // Check overrides if contextOverride != "" { currentContext = contextOverride @@ -118,7 +125,16 @@ func contextsDirFromConfigDir(configDir string) string { func listYamlNames(dirName string) ([]string, error) { file, err := os.Open(dirName) - if err != nil { + + if os.IsNotExist(err) { + //if we cannot open the directory, create it and open again + _ = os.MkdirAll(dirName, 0600) + file, err = os.Open(dirName) + if err != nil { + return nil, err + } + + } else if err != nil { return nil, err } defer file.Close() @@ -178,3 +194,38 @@ func ensureConfigDirectoryStructure(configDir string) error { } return nil } + +func GetBaseConfig(configDir string) BaseConfigFile { + + baseConfig, err := LoadBaseConfiguration(configDir) + if err != nil { + // Shoot out a warning, but don't fail + baseConfig = BaseConfigFile{} + fmt.Fprintf(os.Stderr, "warn: Could not load configuration file: %s. Will proceed creating a new one\n", err.Error()) + // Now set the current context to the new one + baseConfig.CurrentContext = "" + + if err := SaveBaseConfiguration(configDir, baseConfig); err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } + } + return baseConfig +} +func UpdateBaseConfigWithContext(configDir, context string) BaseConfigFile { + baseConfig, err := LoadBaseConfiguration(configDir) + if err != nil { + // Shoot out a warning, but don't fail + baseConfig = BaseConfigFile{} + fmt.Fprintf(os.Stderr, "warn: Could not load configuration file: %s. Will proceed creating a new one\n", err.Error()) + // Now set the current context to the new one + } + + baseConfig.CurrentContext = context + + if err := SaveBaseConfiguration(configDir, baseConfig); err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } + return baseConfig +} From 2ba74836be60485690d0390134a305d614191be8 Mon Sep 17 00:00:00 2001 From: Eddy Babetto Date: Mon, 16 Sep 2024 14:23:02 +0200 Subject: [PATCH 05/13] Update CHANGELOG.md Signed-off-by: Eddy Babetto --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2340f28..1227238 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed - `cluster instance` {`deploy` | `destroy` | `show`} are deprecated and will be removed from v24.11. +### Fixed +- Create configuration files and folders if required, instead of just crashing ## [24.5.0] - 2024-09-03 ### Added From 2e054c633e83c1d5b17cdffe0a1bb930869385d5 Mon Sep 17 00:00:00 2001 From: Eddy Babetto Date: Mon, 6 May 2024 15:30:05 +0200 Subject: [PATCH 06/13] Add exception for empty array when publishing data Add exception for enabling empty array sending (that differs from arrays with one null element) An empty array with corrrect type is now sent to astarte Signed-off-by: Eddy Babetto --- cmd/appengine/device.go | 43 +++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/cmd/appengine/device.go b/cmd/appengine/device.go index 9a0e1fb..0a72f01 100644 --- a/cmd/appengine/device.go +++ b/cmd/appengine/device.go @@ -21,6 +21,7 @@ import ( "fmt" "math" "os" + "regexp" "strconv" "strings" "text/tabwriter" @@ -1649,34 +1650,34 @@ func parseSendDataPayload(payload string, mappingType interfaces.AstarteMappingT case interfaces.BinaryBlobArray, interfaces.BooleanArray, interfaces.DateTimeArray, interfaces.DoubleArray, interfaces.IntegerArray, interfaces.LongIntegerArray, interfaces.StringArray: - //wait it's all string? - payload = strings.Replace(payload, "[", "", -1) - payload = strings.Replace(payload, "]", "", -1) - payload_parsed := strings.Split(payload, ",") - //always has been - - jsonOut := make([]interface{}, len(payload_parsed)) - for i, v := range payload_parsed { - jsonOut[i] = v - } - - retArray := []interface{}{} - // Do a smarter conversion here. - for _, v := range jsonOut { - switch val := v.(type) { - case string: - p, err := parseSendDataPayload(strings.TrimSpace(val), interfaces.AstarteMappingType(strings.TrimSuffix(string(mappingType), "array"))) + //check if payload is an empty array, bypass conversions and just return an empty array + // if it is not, proceed as usual + if payload == "[]" { + ret = make([]interface{}, 0) + } else { + retArray := []interface{}{} + payload = strings.TrimSpace(payload) + if pass, err := regexp.MatchString(`^\[.*\]$`, payload); !pass { + return nil, err + } + payload = regexp.MustCompile(`^\[`).ReplaceAllString(payload, "") + payload = regexp.MustCompile(`\]$`).ReplaceAllString(payload, "") + payload_parsed := strings.Split(payload, ",") + jsonOut := make([]interface{}, len(payload_parsed)) + for i, v := range payload_parsed { + jsonOut[i] = v + } + // Do a smarter conversion here. + for _, v := range jsonOut { + p, err := parseSendDataPayload(strings.TrimSpace(v.(string)), interfaces.AstarteMappingType(strings.TrimSuffix(string(mappingType), "array"))) if err != nil { return nil, err } retArray = append(retArray, p) - default: - retArray = append(retArray, val) } + ret = retArray } - ret = retArray } - return ret, nil } From c98be82f5cbd438cd24d4b8ef8c5a32b273fe849 Mon Sep 17 00:00:00 2001 From: Eddy Babetto Date: Tue, 17 Sep 2024 17:11:56 +0200 Subject: [PATCH 07/13] Update CHANGELOG.md Signed-off-by: Eddy Babetto --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1227238..cfeaaf1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - `cluster instance` {`deploy` | `destroy` | `show`} are deprecated and will be removed from v24.11. ### Fixed -- Create configuration files and folders if required, instead of just crashing +- Create configuration files and folders if required, instead of just crashing. +- Fixed empty array sent as empty string for array payload. ## [24.5.0] - 2024-09-03 ### Added From 09e554ec4cb919f5cff54c718e1f6fd0b4da34cd Mon Sep 17 00:00:00 2001 From: Mattia Mazzucato Date: Wed, 18 Sep 2024 17:12:18 +0200 Subject: [PATCH 08/13] Prepare 24.5.1 release Signed-off-by: Mattia Mazzucato --- CHANGELOG.md | 2 +- cmd/version.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cfeaaf1..f7d215e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [24.5.1] - Unreleased +## [24.5.1] - 2024-09-19 ### Changed - `cluster instance` {`deploy` | `destroy` | `show`} are deprecated and will be removed from v24.11. diff --git a/cmd/version.go b/cmd/version.go index 50099d2..5d8663e 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -20,7 +20,7 @@ import ( "github.com/spf13/cobra" ) -var version = "24.5.0" +var version = "24.5.1" // versionCmd represents the version command var versionCmd = &cobra.Command{ From b79de585dd96b9223e3181d03ac4c544a645de76 Mon Sep 17 00:00:00 2001 From: Mattia Mazzucato Date: Thu, 19 Sep 2024 10:46:34 +0200 Subject: [PATCH 09/13] Bump astarte-go version to v0.92.1 Signed-off-by: Mattia Mazzucato --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 3e2b124..70f5d59 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( code.cloudfoundry.org/bytefmt v0.0.0-20211005130812-5bb3c17173e5 github.com/Masterminds/semver/v3 v3.1.1 github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de - github.com/astarte-platform/astarte-go v0.92.1-0.20240405095359-2af3738f0d84 + github.com/astarte-platform/astarte-go v0.92.1 github.com/go-openapi/strfmt v0.21.1 // indirect github.com/google/go-cmp v0.5.8 github.com/google/go-github/v30 v30.1.0 diff --git a/go.sum b/go.sum index 5e380db..7027458 100644 --- a/go.sum +++ b/go.sum @@ -94,8 +94,8 @@ github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgI github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/astarte-platform/astarte-go v0.92.1-0.20240405095359-2af3738f0d84 h1:E6l76r5aVFdXe5y0Oe0WxriXFletTz+RPVTiZlci1aQ= -github.com/astarte-platform/astarte-go v0.92.1-0.20240405095359-2af3738f0d84/go.mod h1:JY2jLeZoUP9o8+IZSIR595FgdjBj1vdYv4KuJ+tmq1U= +github.com/astarte-platform/astarte-go v0.92.1 h1:9zUiw1E4uj2wBDeszxGh/IAnVFg7BDKhRWqioksG0WA= +github.com/astarte-platform/astarte-go v0.92.1/go.mod h1:JY2jLeZoUP9o8+IZSIR595FgdjBj1vdYv4KuJ+tmq1U= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= From ffde5c66434fea6a6dadcfe65a23de2616359633 Mon Sep 17 00:00:00 2001 From: Mattia Mazzucato Date: Thu, 19 Sep 2024 10:51:19 +0200 Subject: [PATCH 10/13] Update changelog Signed-off-by: Mattia Mazzucato --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7d215e..c17b347 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed - `cluster instance` {`deploy` | `destroy` | `show`} are deprecated and will be removed from v24.11. + ### Fixed - Create configuration files and folders if required, instead of just crashing. - Fixed empty array sent as empty string for array payload. +- Allow the management of triggers containing Mustache templates. ## [24.5.0] - 2024-09-03 ### Added From a3139fa2b5da7e36b959c80d5e81b8615cddf00c Mon Sep 17 00:00:00 2001 From: Eddy Babetto Date: Thu, 19 Sep 2024 17:05:27 +0200 Subject: [PATCH 11/13] Fix astarte config folder permissions Edit astarte config folder permission because the old setting (600) did not allow the CI to complete. 755 has been picked insead because is the same permission of the kubeconfig folder Signed-off-by: Eddy Babetto --- config/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/utils.go b/config/utils.go index ce44472..ae4a324 100644 --- a/config/utils.go +++ b/config/utils.go @@ -128,7 +128,7 @@ func listYamlNames(dirName string) ([]string, error) { if os.IsNotExist(err) { //if we cannot open the directory, create it and open again - _ = os.MkdirAll(dirName, 0600) + _ = os.MkdirAll(dirName, 0755) file, err = os.Open(dirName) if err != nil { return nil, err From 1fe8006ecd7b2c608395eb5eae60c7fe8e5b6b3f Mon Sep 17 00:00:00 2001 From: Arnaldo Cesco Date: Thu, 19 Sep 2024 17:32:08 +0200 Subject: [PATCH 12/13] Fix CHANGELOG.md to include latest changes Signed-off-by: Arnaldo Cesco --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c17b347..53be1e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [24.5.2] - Unreleased +### Fixed +- Allow a larger set of permissions for configuration files and folders. + ## [24.5.1] - 2024-09-19 ### Changed - `cluster instance` {`deploy` | `destroy` | `show`} are deprecated and From 927b51cb475455399e88c4565fe0784eef0d347c Mon Sep 17 00:00:00 2001 From: Arnaldo Cesco Date: Thu, 19 Sep 2024 17:32:45 +0200 Subject: [PATCH 13/13] Prepare 24.5.2 release Signed-off-by: Arnaldo Cesco --- CHANGELOG.md | 2 +- cmd/version.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53be1e9..8a64d6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [24.5.2] - Unreleased +## [24.5.2] - 2024-09-20 ### Fixed - Allow a larger set of permissions for configuration files and folders. diff --git a/cmd/version.go b/cmd/version.go index 5d8663e..820f413 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -20,7 +20,7 @@ import ( "github.com/spf13/cobra" ) -var version = "24.5.1" +var version = "24.5.2" // versionCmd represents the version command var versionCmd = &cobra.Command{