Skip to content

Commit

Permalink
fix: remap dry-run config field (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
h4wkmoon authored Feb 17, 2024
1 parent 8749132 commit 8ec4deb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions autopilot/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ import (

type (
AzureK8sAutopilot struct {
DryRun bool

ctx context.Context
Config config.Opts

Expand Down
2 changes: 1 addition & 1 deletion autopilot/task.repair.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (r *AzureK8sAutopilot) repairRun(contextLogger *zap.SugaredLogger) {
continue
}

if r.DryRun {
if r.Config.DryRun {
nodeContextLogger.Infof("node %s repair skipped, dry run", node.Name)
if err := r.repair.nodeLock.Add(node.Name, true, r.Config.Repair.LockDuration); err != nil {
nodeContextLogger.Error(err)
Expand Down
2 changes: 1 addition & 1 deletion autopilot/task.update.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (r *AzureK8sAutopilot) updateRun(contextLogger *zap.SugaredLogger) {
return
}

if !r.DryRun {
if !r.Config.DryRun {
for _, node := range candidateList {
// concurrency update limit
if r.Config.Update.Limit > 0 && r.update.nodeLock.ItemCount() >= r.Config.Update.Limit {
Expand Down

0 comments on commit 8ec4deb

Please sign in to comment.