Skip to content

Commit

Permalink
cluster instance: deprecate destroy, install and show commands
Browse files Browse the repository at this point in the history
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 <arnaldo.cesco@secomind.com>
  • Loading branch information
Annopaolo committed Sep 16, 2024
1 parent 12ee303 commit e550c67
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
11 changes: 9 additions & 2 deletions cmd/cluster/instance_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import (

var deployCmd = &cobra.Command{
Use: "deploy",
Short: "Deploy a minimal Astarte Instance in the current Kubernetes Cluster. Only for testing.",
Long: `Deploy a minimal Astarte Instance in the current Kubernetes Cluster. This will adhere to the same current-context
Short: "(deprecated) Deploy a minimal Astarte Instance in the current Kubernetes Cluster. Only for testing.",
Long: `(deprecated) Deploy a minimal Astarte Instance in the current Kubernetes Cluster. This will adhere to the same current-context
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,
Expand Down Expand Up @@ -62,6 +62,13 @@ func init() {
}

func clusterDeployF(command *cobra.Command, args []string) error {
deprecationNotice := `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
`

fmt.Println(deprecationNotice)

y, err := command.Flags().GetBool("non-interactive")
if err != nil {
return err
Expand Down
11 changes: 9 additions & 2 deletions cmd/cluster/instance_destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (

var destroyCmd = &cobra.Command{
Use: "destroy <name>",
Short: "Destroy an Astarte Instance in the current Kubernetes Cluster",
Long: `Destroy an Astarte Instance in the current Kubernetes Cluster. This will adhere to the same current-context
Short: "(deprecated) Destroy an Astarte Instance in the current Kubernetes Cluster",
Long: `(deprecated) Destroy an Astarte Instance in the current Kubernetes Cluster. This will adhere to the same current-context
kubectl mentions. Please be aware of the fact that when an Astarte instance is destroyed, there is no way to recover it.`,
Example: ` astartectl cluster instances destroy astarte`,
RunE: clusterDestroyF,
Expand All @@ -43,6 +43,13 @@ func init() {
}

func clusterDestroyF(command *cobra.Command, args []string) error {
deprecationNotice := `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
`

fmt.Println(deprecationNotice)

resourceName := args[0]
resourceNamespace, err := command.Flags().GetString("namespace")
if err != nil {
Expand Down
11 changes: 9 additions & 2 deletions cmd/cluster/instance_show.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (

var instanceShowCmd = &cobra.Command{
Use: "show <name>",
Short: "Shows details about an Astarte Instance in the current Kubernetes Cluster",
Long: `Shows details about an Astarte Instance in the current Kubernetes Cluster.`,
Short: "(deprecated) Shows details about an Astarte Instance in the current Kubernetes Cluster",
Long: `(deprecated) Shows details about an Astarte Instance in the current Kubernetes Cluster.`,
Example: ` astartectl cluster instances show astarte`,
RunE: instanceShowF,
Args: cobra.ExactArgs(1),
Expand All @@ -36,6 +36,13 @@ func init() {
}

func instanceShowF(command *cobra.Command, args []string) error {
deprecationNotice := `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
`

fmt.Println(deprecationNotice)

resourceName := args[0]
resourceNamespace, err := command.Flags().GetString("namespace")
if err != nil {
Expand Down

0 comments on commit e550c67

Please sign in to comment.