Skip to content

Commit

Permalink
Dry run
Browse files Browse the repository at this point in the history
  • Loading branch information
mvshao committed Sep 18, 2024
1 parent 370ccfc commit 6016fb0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions hack/runtime-cleanup/cmd/cleaner/cleaner.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"time"
)

const deleteAfter = 24 * time.Hour
const deleteAfter = 1 * time.Second

type RuntimeCleaner struct {
k8sClient client.Client
Expand Down Expand Up @@ -41,7 +41,7 @@ func (r RuntimeCleaner) removeOldRuntimes() error {
if err != nil {
return err
}
r.log.Info("Runtime ", runtimeObj.Name, " was marked to be removed by KIM reconciler")
r.log.With("runtime", runtimeObj.Name).Info("Runtime was marked to be removed by KIM reconciler")
}
}
return nil
Expand Down
3 changes: 2 additions & 1 deletion hack/runtime-cleanup/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"github.com/kyma-project/infrastructure-manager/hack/runtime-cleanup/cmd/cleaner"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/rest"
"k8s.io/utils/ptr"
"log/slog"
"os"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -41,5 +42,5 @@ func createKubernetesClient() (client.Client, error) {
return nil, err
}

return client.New(config, client.Options{Scheme: scheme})
return client.New(config, client.Options{Scheme: scheme, DryRun: ptr.To(true)})
}

0 comments on commit 6016fb0

Please sign in to comment.