Skip to content

Commit c4bad68

Browse files
Merge pull request #693 from jetstack/VC-43403-fix-cmd-tests
[VC-43403] Fix cmd tests
2 parents 1209e4b + 6a6361b commit c4bad68

File tree

3 files changed

+2
-25
lines changed

3 files changed

+2
-25
lines changed

cmd/agent_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func TestAgentRunOneShot(t *testing.T) {
3333
"--agent-config-file=testdata/agent/one-shot/success/config.yaml",
3434
"--input-path=testdata/agent/one-shot/success/input.json",
3535
"--output-path=/dev/null",
36-
"-v=1",
36+
"-v=9",
3737
}
3838
Execute()
3939
return

make/test-unit.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ test-unit: | $(NEEDS_GO) $(NEEDS_GOTESTSUM) $(ARTIFACTS) $(NEEDS_ETCD) $(NEEDS_K
77
--junitfile=$(ARTIFACTS)/junit-go-e2e.xml \
88
-- \
99
-coverprofile=$(ARTIFACTS)/filtered.cov \
10-
./api/... ./pkg/... \
10+
./cmd/... ./api/... ./pkg/... \
1111
-- \
1212
-ldflags $(go_preflight_ldflags)
1313

pkg/agent/run.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import (
3232

3333
"github.com/jetstack/preflight/api"
3434
"github.com/jetstack/preflight/pkg/client"
35-
"github.com/jetstack/preflight/pkg/clusteruid"
3635
"github.com/jetstack/preflight/pkg/datagatherer"
3736
"github.com/jetstack/preflight/pkg/datagatherer/k8s"
3837
"github.com/jetstack/preflight/pkg/kubeconfig"
@@ -79,28 +78,6 @@ func Run(cmd *cobra.Command, args []string) (returnErr error) {
7978
return fmt.Errorf("While evaluating configuration: %v", err)
8079
}
8180

82-
// We need the cluster UID before we progress further so it can be sent along with other data readings
83-
84-
{
85-
restCfg, err := kubeconfig.LoadRESTConfig("")
86-
if err != nil {
87-
return err
88-
}
89-
90-
clientset, err := kubernetes.NewForConfig(restCfg)
91-
if err != nil {
92-
return err
93-
}
94-
95-
ctx, err = clusteruid.GetClusterUID(ctx, clientset)
96-
if err != nil {
97-
return fmt.Errorf("failed to get cluster UID: %v", err)
98-
}
99-
100-
clusterUID := clusteruid.ClusterUIDFromContext(ctx)
101-
log.V(logs.Debug).Info("Retrieved cluster UID", "clusterUID", clusterUID)
102-
}
103-
10481
group, gctx := errgroup.WithContext(ctx)
10582
defer func() {
10683
cancel()

0 commit comments

Comments
 (0)