Skip to content

Commit

Permalink
fix: skip invalid machines in TalosUpgradeStatusController
Browse files Browse the repository at this point in the history
Do not exit the loop, but just ignore such machines.
Otherwise we don't create `ClusterMachineTalosVersion` resources for all
new machines in the machine set, which blocks
`ClusterMachineConfigController` and the machines are not configured.

Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
  • Loading branch information
Unix4ever committed Jun 14, 2024
1 parent 22bb2cc commit fa64b46
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import (

var errMachineLocked = errors.New("machine locked")

type skipMachine = struct{}

// TalosUpgradeStatusController manages TalosUpgradeStatus performing a Talos upgrade.
//
// TalosUpgradeStatusController upgrades Kubernetes component versions in the cluster.
Expand Down Expand Up @@ -269,6 +271,12 @@ func reconcileTalosUpdateStatus(ctx context.Context, r controller.ReaderWriter,

schematicID, err = getDesiredSchematic(ctx, r, machine, talosVersion)
if err != nil {
if xerrors.TagIs[skipMachine](err) {
logger.Warn("machine is skipped due to no schematic information", zap.Error(err), zap.String("machine", machine.Metadata().ID()))

continue
}

return err
}

Expand Down Expand Up @@ -485,13 +493,13 @@ func getDesiredSchematic(ctx context.Context, r controller.ReaderWriter, machine

if schematic != nil {
if schematic.TypedSpec().Value.TalosVersion != talosVersion {
return "", xerrors.NewTaggedf[qtransform.SkipReconcileTag]("the schematic is not in sync with Talos version yet")
return "", xerrors.NewTaggedf[skipMachine]("the schematic is not in sync with Talos version yet")
}

return schematic.TypedSpec().Value.SchematicId, nil
}

return "", xerrors.NewTaggedf[qtransform.SkipReconcileTag]("the schematic configuration resource is not ready yet")
return "", xerrors.NewTaggedf[skipMachine]("the schematic configuration resource is not ready yet")
}

// populateEmptySchematics iterates all cluster machine talos versions for the cluster and if they have an empty schematic, populates
Expand Down

0 comments on commit fa64b46

Please sign in to comment.