From ae39b5394201f5224a7b3e39c31e26bf70e748b7 Mon Sep 17 00:00:00 2001 From: Dmitry Kartsev Date: Sun, 24 Dec 2023 18:19:57 +0200 Subject: [PATCH] update status cmd --- .../cnvrg-all-in-one/templates/operator.yml | 20 +++++++++++++++++++ cmd/copctl/cmd/{get => create}/status.go | 2 +- cmd/copctl/cmd/get/get.go | 11 ---------- cmd/copctl/cmd/root.go | 2 -- 4 files changed, 21 insertions(+), 14 deletions(-) rename cmd/copctl/cmd/{get => create}/status.go (99%) delete mode 100644 cmd/copctl/cmd/get/get.go diff --git a/charts/cnvrg-all-in-one/templates/operator.yml b/charts/cnvrg-all-in-one/templates/operator.yml index f86c7243..1e286ddf 100644 --- a/charts/cnvrg-all-in-one/templates/operator.yml +++ b/charts/cnvrg-all-in-one/templates/operator.yml @@ -203,6 +203,26 @@ spec: imagePullSecrets: - name: operator-pull-secret containers: + - command: + - /bin/bash + - -c + - | + /opt/app-root/copctl \ + create \ + status \ + --name={{ .Release.Name }} + --namespace={{ .Release.Namespace }} + --interval=5 + image: "docker.io/cnvrg/copctl:latest" + imagePullPolicy: Always + name: service-instance-status-reporter + resources: + limits: + cpu: 1000m + memory: 1000Mi + requests: + cpu: 400m + memory: 200Mi - command: - /opt/app-root/cnvrg-operator - start diff --git a/cmd/copctl/cmd/get/status.go b/cmd/copctl/cmd/create/status.go similarity index 99% rename from cmd/copctl/cmd/get/status.go rename to cmd/copctl/cmd/create/status.go index bb083d04..c36e0355 100644 --- a/cmd/copctl/cmd/get/status.go +++ b/cmd/copctl/cmd/create/status.go @@ -1,4 +1,4 @@ -package get +package create import ( "context" diff --git a/cmd/copctl/cmd/get/get.go b/cmd/copctl/cmd/get/get.go deleted file mode 100644 index 367d2374..00000000 --- a/cmd/copctl/cmd/get/get.go +++ /dev/null @@ -1,11 +0,0 @@ -package get - -import "github.com/spf13/cobra" - -var ( - Cmd = &cobra.Command{ - Use: "get", - Aliases: []string{"g"}, - Short: "Get copctl resources", - } -) diff --git a/cmd/copctl/cmd/root.go b/cmd/copctl/cmd/root.go index e3fbd3dc..d666b66a 100644 --- a/cmd/copctl/cmd/root.go +++ b/cmd/copctl/cmd/root.go @@ -2,7 +2,6 @@ package cmd import ( "github.com/AccessibleAI/cnvrg-operator/cmd/copctl/cmd/create" - "github.com/AccessibleAI/cnvrg-operator/cmd/copctl/cmd/get" "github.com/AccessibleAI/cnvrg-operator/cmd/copctl/cmd/start" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -30,7 +29,6 @@ func init() { cobra.OnInitialize(initConfig) RootCmd.AddCommand(start.Cmd) RootCmd.AddCommand(create.Cmd) - RootCmd.AddCommand(get.Cmd) } func initConfig() {