Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/dev/blowtorch/cmd/revert.go
2497 views
1
// Copyright (c) 2020 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package cmd
6
7
import (
8
log "github.com/sirupsen/logrus"
9
"github.com/spf13/cobra"
10
11
"github.com/gitpod-io/gitpod/blowtorch/pkg/dart"
12
)
13
14
// revertCmd represents the inject command
15
var revertCmd = &cobra.Command{
16
Use: "revert <service-name>",
17
Short: "Revert removes a previously injected toxiproxy",
18
Args: cobra.ExactArgs(1),
19
Run: func(cmd *cobra.Command, args []string) {
20
cfg, ns, err := getKubeconfig()
21
if err != nil {
22
log.WithError(err).Fatal("cannot get Kubernetes client config")
23
}
24
err = dart.Remove(cfg, ns, args[0])
25
if err != nil {
26
log.WithError(err).Fatal("cannot remove toxiproxy")
27
}
28
},
29
}
30
31
func init() {
32
rootCmd.AddCommand(revertCmd)
33
}
34
35