Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ jobs:
working-directory: cli
run: |
make go-fmt
git diff --exit-code

- name: Vet
working-directory: cli
run: |
make go-vet
git diff --exit-code

# TODO(paulfantom): figure-out why golangci-lint action crashes
#- name: Lint
Expand Down
4 changes: 2 additions & 2 deletions cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ go-vet:
go vet ./...

go-fmt:
gofmt -d .
gofmt -s -w .

go-lint:
golangci-lint run
Expand All @@ -43,4 +43,4 @@ uninstall-tobs:
delete-kind:
kind delete cluster --name tobs

all: build start-kind e2e-tests external-db-tests go-vet go-fmt go-lint
all: build start-kind e2e-tests external-db-tests go-vet go-fmt go-lint
2 changes: 1 addition & 1 deletion cli/cmd/grafana/port_forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ func PortForwardGrafana(listenPort int) error {
}

return nil
}
}
2 changes: 1 addition & 1 deletion cli/cmd/timescaledb/port_forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ func PortForwardTimescaleDB(listenPort int) error {
}

return nil
}
}
8 changes: 4 additions & 4 deletions cli/cmd/timescaledb/superuser/change_password.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func updateDBPwdSecrets(k8sClient k8s.Client, secretKey, user, password string)
}

if tsdb {
secretName := root.HelmReleaseName+"-credentials"
secretName := root.HelmReleaseName + "-credentials"
tsdbSecret, err := k8sClient.KubeGetSecret(root.Namespace, secretName)
if err != nil {
return fmt.Errorf("could not get secret with name %s: %w", secretName, err)
Expand All @@ -79,7 +79,7 @@ func updateDBPwdSecrets(k8sClient k8s.Client, secretKey, user, password string)
}

// Update Grafana DB creds
grafanaSecretName := root.HelmReleaseName+"-grafana-db"
grafanaSecretName := root.HelmReleaseName + "-grafana-db"
grafanaSecret, err := k8sClient.KubeGetSecret(root.Namespace, grafanaSecretName)
if err != nil {
return fmt.Errorf("could not get secret with name %s: %w", grafanaSecretName, err)
Expand All @@ -95,7 +95,7 @@ func updateDBPwdSecrets(k8sClient k8s.Client, secretKey, user, password string)
}

// Update Promscale connection details
promscaleSecretName, err := pgconn.GetPromscaleSecretName(root.HelmReleaseName, root.Namespace)
promscaleSecretName, err := pgconn.GetPromscaleSecretName(root.HelmReleaseName, root.Namespace)
if err != nil {
return err
}
Expand All @@ -110,7 +110,7 @@ func updateDBPwdSecrets(k8sClient k8s.Client, secretKey, user, password string)
return fmt.Errorf("failed to parse db-uri %v", err)
}
dbDetails.ConnConfig.Password = password
updatedDBURI, err := pgconn.UpdatePasswordInDBURI(string(bytepass), password)
updatedDBURI, err := pgconn.UpdatePasswordInDBURI(string(bytepass), password)
if err != nil {
return fmt.Errorf("failed to update password in db-uri %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cli/pkg/helm/client_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,4 +589,4 @@ func (c *clientImpl) listDeployedReleases(namespace string) ([]*release.Release,
listClient := action.NewList(c.actionConfig)
listClient.StateMask = action.ListDeployed | action.ListFailed | action.ListPendingInstall | action.ListPendingUpgrade
return listClient.Run()
}
}
2 changes: 1 addition & 1 deletion cli/pkg/k8s/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ type Client interface {

// Apply manifests
ApplyManifests(map[string]string) error
}
}
2 changes: 1 addition & 1 deletion cli/pkg/otel/otel-utilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (c *OtelCol) ValidateCertManager() error {
// namespace this needs to be ignored as otel-operator helm-chart upgrades them
// Mote: Resource with name 'opentelemetry-operator-selfsigned-issuer` isn't part of
// any namespace so adding a check.
if resource.Namespace != "opentelemetry-operator-system" {
if resource.Namespace != "opentelemetry-operator-system" {
if resource.Name != "opentelemetry-operator-selfsigned-issuer" {
onlyCertMResources = append(onlyCertMResources, resource)
}
Expand Down
4 changes: 2 additions & 2 deletions cli/pkg/pgconn/connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ func TestConstructURI(t *testing.T) {
want: "postgres://bob%20has%20spaces%20in%20his%20username:%7B%40nd%20$p3ci%40L%20ch%40R$%201n%20h1$%20p%40$$w0rd%21%5E%27@localhost:5432/bob_has_a_database",
},
{
user: "$b0b!",
password: "$p3ci@L-ch@R$_1n\nh1$ p@$$w0rd!^'",
user: "$b0b!",
password: "$p3ci@L-ch@R$_1n\nh1$ p@$$w0rd!^'",
host: "my.host.com",
port: 9999,
dbname: "this-is a valid db nAm3 if double quoted",
Expand Down
1 change: 0 additions & 1 deletion cli/tests/tobs-cli-tests/portforward_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ func testpf(t testing.TB, timescale, grafana, prometheus, promscale, promlens st
// kubectl get pods -A
test_utils.ShowAllPods(t)


t.Logf("Running '%v'", "tobs "+strings.Join(cmds, " "))
portforward := exec.Command(PATH_TO_TOBS, cmds...)

Expand Down