Skip to content

Commit

Permalink
fix: backport fixes from release-1.0 branch
Browse files Browse the repository at this point in the history
They were discovered as we tagged 1.0.0 version:

* wrong deprecated version
* incompatibility in extension compatibility checks

Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
smira committed Mar 4, 2022
1 parent 0aa23cb commit 59681b8
Show file tree
Hide file tree
Showing 5 changed files with 1,194 additions and 1,194 deletions.
4 changes: 2 additions & 2 deletions api/machine/machine.proto
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ message ApplyConfigurationRequest {
bytes data = 1;
// replaced by mode
bool on_reboot = 2 [
(common.remove_deprecated_field) = "v0.16",
(common.remove_deprecated_field) = "v1.1",
deprecated = true
];
// replaced by mode
bool immediate = 3 [
(common.remove_deprecated_field) = "v0.16",
(common.remove_deprecated_field) = "v1.1",
deprecated = true
];
Mode mode = 4;
Expand Down
2 changes: 1 addition & 1 deletion cmd/talosctl/pkg/talos/helpers/mode.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func AddModeFlags(mode *Mode, command *cobra.Command) {
command.Flags().MarkDeprecated(flag, deprecationWarning) //nolint:errcheck
}

// TODO: remove in v0.16
// TODO: remove in v1.1
deprecatedFlag(&mode.OnReboot, "on-reboot", "apply the config on reboot", "Use --mode=staged instead")
deprecatedFlag(&mode.Immediate, "immediate", "apply the config immediately (without a reboot)", "Use --mode=no-reboot instead")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (s *Server) ApplyConfiguration(ctx context.Context, in *machine.ApplyConfig
mode := in.Mode.String()
modeDetails := ""

// TODO: remove in v0.16
// TODO: remove in v1.1
switch {
case in.Immediate: //nolint:staticcheck
in.Mode = machine.ApplyConfigurationRequest_NO_REBOOT
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/extensions/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (ext *Extension) validateConstraints() error {
return fmt.Errorf("error parsing Talos version constraint: %w", err)
}

if !versionConstraint.Check(talosVersion) {
if !versionConstraint.Check(talosVersion.Core()) {
return fmt.Errorf("version constraint %s can't be satisfied with Talos version %s", versionConstraint, talosVersion)
}
}
Expand Down
Loading

0 comments on commit 59681b8

Please sign in to comment.