-
Notifications
You must be signed in to change notification settings - Fork 546
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update ISO VolumeID with Talos version
Put Talos version in the ISO volume ID and volumeset ID. Volume ID is restricted on valid characters, while volumeset ID is not restricted (Unicode). Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
- Loading branch information
Showing
6 changed files
with
133 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
package iso_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
|
||
"github.com/siderolabs/talos/pkg/imager/iso" | ||
) | ||
|
||
func TestVolumeID(t *testing.T) { | ||
t.Parallel() | ||
|
||
for _, test := range []struct { | ||
in string | ||
|
||
out string | ||
}{ | ||
{ | ||
in: "Talos-v1.7.6", | ||
|
||
out: "TALOS_V1_7_6", | ||
}, | ||
{ | ||
in: "Talos-v1.7.6-beta.0", | ||
|
||
out: "TALOS_V1_7_6_BETA_0", | ||
}, | ||
} { | ||
t.Run(test.in, func(t *testing.T) { | ||
t.Parallel() | ||
|
||
assert.Equal(t, test.out, iso.VolumeID(test.in)) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters