Skip to content

Commit 633f452

Browse files
cristiangrecoclayton-cornell
authored andcommitted
Remove Grafana Cloud install scripts. (#3485)
Not needed anymore now that we use a different install mechanism in Grafana Cloud.
1 parent 949f0e5 commit 633f452

File tree

5 files changed

+1
-506
lines changed

5 files changed

+1
-506
lines changed

cmd/grafana-agentctl/main.go

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,15 @@ package main
55
import (
66
"context"
77
"fmt"
8-
"net/http"
98
"os"
109
"os/signal"
1110
"path/filepath"
12-
goruntime "runtime"
1311
"sort"
1412
"strings"
1513
"syscall"
16-
"time"
1714

1815
"gopkg.in/yaml.v2"
1916

20-
"github.com/grafana/agent/pkg/client/grafanacloud"
2117
"github.com/grafana/agent/pkg/config"
2218
"github.com/grafana/agent/pkg/logs"
2319
"github.com/olekukonko/tablewriter"
@@ -55,7 +51,7 @@ import (
5551
)
5652

5753
func main() {
58-
var cmd = &cobra.Command{
54+
cmd := &cobra.Command{
5955
Use: "agentctl",
6056
Short: "Tools for interacting with the Grafana Agent",
6157
Version: version.Print("agentctl"),
@@ -69,7 +65,6 @@ func main() {
6965
targetStatsCmd(),
7066
samplesCmd(),
7167
operatorDetachCmd(),
72-
cloudConfigCmd(),
7368
templateDryRunCmd(),
7469
testLogs(),
7570
)
@@ -436,59 +431,6 @@ func filterAgentOwners(refs []meta_v1.OwnerReference) (filtered []meta_v1.OwnerR
436431
return
437432
}
438433

439-
func cloudConfigCmd() *cobra.Command {
440-
var (
441-
stackID string
442-
apiURL string
443-
apiKey string
444-
platforms string
445-
)
446-
447-
cmd := &cobra.Command{
448-
Use: "cloud-config",
449-
Short: "Retrieves the cloud config for the Grafana Agent",
450-
Long: `cloud-config connects to Grafana Cloud and retrieves the generated
451-
config that may be used with this agent.`,
452-
Args: cobra.ExactArgs(0),
453-
454-
// Hidden, this is only expected to be used by scripts.
455-
Hidden: true,
456-
457-
RunE: func(_ *cobra.Command, args []string) error {
458-
if stackID == "" {
459-
return fmt.Errorf("--stack must be provided")
460-
}
461-
if apiKey == "" {
462-
return fmt.Errorf("--api-key must be provided")
463-
}
464-
465-
// setting timeout 2x as the default HTTP transport timeout (30s)
466-
httpClient := &http.Client{
467-
Timeout: time.Minute,
468-
}
469-
cli := grafanacloud.NewClient(httpClient, apiKey, apiURL)
470-
471-
cfg, err := cli.AgentConfig(context.Background(), stackID, platforms)
472-
if err != nil {
473-
fmt.Fprintf(os.Stderr, "could not retrieve agent cloud config: %s\n", err)
474-
os.Exit(1)
475-
}
476-
477-
fmt.Println(cfg)
478-
return nil
479-
},
480-
}
481-
482-
cmd.Flags().StringVarP(&stackID, "stack", "u", "", "stack ID to get a config for")
483-
cmd.Flags().StringVarP(&apiKey, "api-key", "p", "", "API key to authenticate against Grafana Cloud's API with")
484-
cmd.Flags().StringVarP(&apiURL, "api-url", "e", "", "Grafana Cloud's API url")
485-
cmd.Flags().StringVar(&platforms, "platforms", goruntime.GOOS, "comma-separated list of Platforms/OSes")
486-
must(cmd.MarkFlagRequired("stack"))
487-
must(cmd.MarkFlagRequired("api-key"))
488-
489-
return cmd
490-
}
491-
492434
func templateDryRunCmd() *cobra.Command {
493435
cmd := &cobra.Command{
494436
Use: "template-parse [directory]",

pkg/client/grafanacloud/client.go

Lines changed: 0 additions & 86 deletions
This file was deleted.

pkg/client/grafanacloud/client_test.go

Lines changed: 0 additions & 136 deletions
This file was deleted.

0 commit comments

Comments
 (0)