Skip to content

Commit

Permalink
hack: fix janitor to properly set kubeconfig and log an error
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischdi committed Feb 6, 2024
1 parent ce6b82b commit cb271af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions hack/clean-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,8 @@ function wait_for_ipam_reachable() {
}
wait_for_ipam_reachable

# Set kubeconfig for IPAM cleanup
export KUBECONFIG="${E2E_IPAM_KUBECONFIG}"

# Run e2e tests
make clean-ci
5 changes: 4 additions & 1 deletion hack/tools/janitor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ func run(ctx context.Context) error {
defer vSphereClients.logout(ctx)

// Create controller-runtime client for IPAM.
restConfig := ctrl.GetConfigOrDie()
restConfig, err := ctrl.GetConfig()
if err != nil {
return errors.Wrap(err, "unable to get kubeconfig")
}
ipamClient, err := client.New(restConfig, client.Options{Scheme: ipamScheme})
if err != nil {
return errors.Wrap(err, "creating IPAM client")
Expand Down

0 comments on commit cb271af

Please sign in to comment.