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: 1 addition & 1 deletion cmd/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestAgentRunOneShot(t *testing.T) {
"--agent-config-file=testdata/agent/one-shot/success/config.yaml",
"--input-path=testdata/agent/one-shot/success/input.json",
"--output-path=/dev/null",
"-v=1",
"-v=9",
}
Execute()
return
Expand Down
2 changes: 1 addition & 1 deletion make/test-unit.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test-unit: | $(NEEDS_GO) $(NEEDS_GOTESTSUM) $(ARTIFACTS) $(NEEDS_ETCD) $(NEEDS_K
--junitfile=$(ARTIFACTS)/junit-go-e2e.xml \
-- \
-coverprofile=$(ARTIFACTS)/filtered.cov \
./api/... ./pkg/... \
./cmd/... ./api/... ./pkg/... \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests in cmd are now being run
image

-- \
-ldflags $(go_preflight_ldflags)

Expand Down
23 changes: 0 additions & 23 deletions pkg/agent/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (

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

// We need the cluster UID before we progress further so it can be sent along with other data readings

{
restCfg, err := kubeconfig.LoadRESTConfig("")
if err != nil {
return err
}

clientset, err := kubernetes.NewForConfig(restCfg)
if err != nil {
return err
}

ctx, err = clusteruid.GetClusterUID(ctx, clientset)
if err != nil {
return fmt.Errorf("failed to get cluster UID: %v", err)
}

clusterUID := clusteruid.ClusterUIDFromContext(ctx)
log.V(logs.Debug).Info("Retrieved cluster UID", "clusterUID", clusterUID)
}

group, gctx := errgroup.WithContext(ctx)
defer func() {
cancel()
Expand Down