Skip to content

Commit 72d82b3

Browse files
committed
Reverted to separate variable for version resolving
1 parent 860dffa commit 72d82b3

File tree

16 files changed

+84
-29
lines changed

16 files changed

+84
-29
lines changed

features/src/docker-out/README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ A feature which installs the Docker client and re-uses the host socket.
88
"features": {
99
"ghcr.io/postfinance/devcontainer-features/docker-out:0.1.0": {
1010
"version": "latest",
11+
"versionResolve": false,
1112
"composeVersion": "latest",
12-
"buildxVersion": "latest"
13+
"composeVersionResolve": false,
14+
"buildxVersion": "latest",
15+
"buildxVersionResolve": false
1316
}
1417
}
1518
```
@@ -18,9 +21,12 @@ A feature which installs the Docker client and re-uses the host socket.
1821

1922
| Option | Description | Type | Default Value | Proposals |
2023
|-----|-----|-----|-----|-----|
21-
| version | The version of the Docker CLI to install. | string | latest | latest, 28.3.3!, 20.10 |
22-
| composeVersion | The version of the Compose plugin to install. | string | latest | latest, 2.39.1!, 2.29 |
23-
| buildxVersion | The version of the buildx plugin to install. | string | latest | latest, 0.26.1!, 0.10 |
24+
| version | The version of the Docker CLI to install. | string | latest | latest, 28.3.3, 20.10 |
25+
| versionResolve | Whether to resolve the version automatically. | boolean | false | true, false |
26+
| composeVersion | The version of the Compose plugin to install. | string | latest | latest, 2.39.1, 2.29 |
27+
| composeVersionResolve | Whether to resolve the version automatically. | boolean | false | true, false |
28+
| buildxVersion | The version of the buildx plugin to install. | string | latest | latest, 0.26.1, 0.10 |
29+
| buildxVersionResolve | Whether to resolve the version automatically. | boolean | false | true, false |
2430

2531
## Customizations
2632

features/src/docker-out/devcontainer-feature.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,46 @@
88
"type": "string",
99
"proposals": [
1010
"latest",
11-
"28.3.3!",
11+
"28.3.3",
1212
"20.10"
1313
],
1414
"default": "latest",
1515
"description": "The version of the Docker CLI to install."
1616
},
17+
"versionResolve": {
18+
"type": "boolean",
19+
"default": false,
20+
"description": "Whether to resolve the version automatically."
21+
},
1722
"composeVersion": {
1823
"type": "string",
1924
"proposals": [
2025
"latest",
21-
"2.39.1!",
26+
"2.39.1",
2227
"2.29"
2328
],
2429
"default": "latest",
2530
"description": "The version of the Compose plugin to install."
2631
},
32+
"composeVersionResolve": {
33+
"type": "boolean",
34+
"default": false,
35+
"description": "Whether to resolve the version automatically."
36+
},
2737
"buildxVersion": {
2838
"type": "string",
2939
"proposals": [
3040
"latest",
31-
"0.26.1!",
41+
"0.26.1",
3242
"0.10"
3343
],
3444
"default": "latest",
3545
"description": "The version of the buildx plugin to install."
46+
},
47+
"buildxVersionResolve": {
48+
"type": "boolean",
49+
"default": false,
50+
"description": "Whether to resolve the version automatically."
3651
}
3752
},
3853
"customizations": {

features/src/docker-out/install.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ esac
66

77
"./installer_$ARCH" \
88
-version="${VERSION:-"latest"}" \
9+
-versionResolve="${VERSIONRESOLVE:-"false"}" \
910
-composeVersion="${COMPOSEVERSION:-"latest"}" \
10-
-buildxVersion="${BUILDXVERSION:-"latest"}"
11+
-composeVersionResolve="${COMPOSEVERSIONRESOLVE:-"false"}" \
12+
-buildxVersion="${BUILDXVERSION:-"latest"}" \
13+
-buildxVersionResolve="${BUILDXVERSIONRESOLVE:-"false"}"

features/src/docker-out/installer.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,24 @@ func main() {
3333
func runMain() error {
3434
// Handle the flags
3535
version := flag.String("version", "latest", "The version of the Docker CLI to install.")
36+
versionResolve := flag.Bool("versionResolve", false, "Whether to resolve the version to the latest available version.")
3637
composeVersion := flag.String("composeVersion", "latest", "The version of the Compose plugin to install.")
38+
composeVersionResolve := flag.Bool("composeVersionResolve", false, "Whether to resolve the version to the latest available version.")
3739
buildxVersion := flag.String("buildxVersion", "latest", "The version of the buildx plugin to install.")
40+
buildxVersionResolve := flag.Bool("buildxVersionResolve", false, "Whether to resolve the version to the latest available version.")
3841

3942
flag.Parse()
4043

4144
// Create and process the feature
4245
feature := installer.NewFeature("Docker-Out", false,
4346
&dockerCliComponent{
44-
ComponentBase: installer.NewComponentBase("Docker CLI", *version),
47+
ComponentBase: installer.NewComponentBase("Docker CLI", *version, *versionResolve),
4548
},
4649
&dockerComposeComponent{
47-
ComponentBase: installer.NewComponentBase("Docker Compose", *composeVersion),
50+
ComponentBase: installer.NewComponentBase("Docker Compose", *composeVersion, *composeVersionResolve),
4851
},
4952
&dockerBuildxComponent{
50-
ComponentBase: installer.NewComponentBase("Docker buildx", *buildxVersion),
53+
ComponentBase: installer.NewComponentBase("Docker buildx", *buildxVersion, *buildxVersionResolve),
5154
},
5255
)
5356
return feature.Process()

features/src/go/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ A feature which installs Go.
88
"features": {
99
"ghcr.io/postfinance/devcontainer-features/go:0.1.0": {
1010
"version": "latest",
11+
"versionResolve": false,
1112
"downloadRegistryBase": "",
1213
"downloadRegistryPath": ""
1314
}
@@ -18,7 +19,8 @@ A feature which installs Go.
1819

1920
| Option | Description | Type | Default Value | Proposals |
2021
|-----|-----|-----|-----|-----|
21-
| version | The version of Go to install. | string | latest | latest, 1.24, 1.21.8! |
22+
| version | The version of Go to install. | string | latest | latest, 1.24, 1.21.8 |
23+
| versionResolve | Whether to resolve the version automatically. | boolean | false | true, false |
2224
| downloadRegistryBase | The download registry to use for Go binaries. | string | <empty> | https://mycompany.com/artifactory/dl-google-generic-remote |
2325
| downloadRegistryPath | The download registry path to use for Go binaries. | string | <empty> | |
2426

features/src/go/devcontainer-feature.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,16 @@
99
"proposals": [
1010
"latest",
1111
"1.24",
12-
"1.21.8!"
12+
"1.21.8"
1313
],
1414
"default": "latest",
1515
"description": "The version of Go to install."
1616
},
17+
"versionResolve":{
18+
"type":"boolean",
19+
"default": false,
20+
"description": "Whether to resolve the version automatically."
21+
},
1722
"downloadRegistryBase": {
1823
"type": "string",
1924
"default": "",

features/src/go/install.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ esac
66

77
"./installer_$ARCH" \
88
-version="${VERSION:-"latest"}" \
9-
-downloadRegistryBase="${DOWNLOAD_REGISTRY_BASE:-""}" \
10-
-downloadRegistryPath="${DOWNLOAD_REGISTRY_PATH:-""}"
9+
-versionResolve="${VERSIONRESOLVE:-false}" \
10+
-downloadRegistryBase="${DOWNLOADREGISTRYBASE:-""}" \
11+
-downloadRegistryPath="${DOWNLOADREGISTRYPATH:-""}"

features/src/go/installer.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func main() {
3636
func runMain() error {
3737
// Handle the flags
3838
version := flag.String("version", "latest", "The version of Go to install.")
39+
versionResolve := flag.Bool("versionResolve", false, "Whether to resolve the version to the latest available version.")
3940
downloadRegistryBase := flag.String("downloadRegistryBase", "", "The download registry to use for Go binaries.")
4041
downloadRegistryPath := flag.String("downloadRegistryPath", "", "The download registry path to use for Go binaries.")
4142
flag.Parse()
@@ -51,7 +52,7 @@ func runMain() error {
5152
// Create and process the feature
5253
feature := installer.NewFeature("Go", true,
5354
&goComponent{
54-
ComponentBase: installer.NewComponentBase("Go", *version),
55+
ComponentBase: installer.NewComponentBase("Go", *version, *versionResolve),
5556
DownloadRegistryBase: *downloadRegistryBase,
5657
DownloadRegistryPath: *downloadRegistryPath,
5758
})

features/src/zig/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ A feature which installs Zig.
88
"features": {
99
"ghcr.io/postfinance/devcontainer-features/zig:0.1.0": {
1010
"version": "latest",
11+
"versionResolve": false,
1112
"downloadRegistryBase": "",
1213
"downloadRegistryPath": ""
1314
}
@@ -18,7 +19,8 @@ A feature which installs Zig.
1819

1920
| Option | Description | Type | Default Value | Proposals |
2021
|-----|-----|-----|-----|-----|
21-
| version | The version of Zig to install. | string | latest | latest, 0.13.0!, 0.12 |
22+
| version | The version of Zig to install. | string | latest | latest, 0.13.0, 0.12 |
23+
| versionResolve | Whether to resolve the version automatically. | boolean | false | true, false |
2224
| downloadRegistryBase | The download registry to use for Zig binaries. | string | <empty> | https://mycompany.com/artifactory/ziglang-generic-remote |
2325
| downloadRegistryPath | The download registry path to use for Zig binaries. | string | <empty> | |
2426

features/src/zig/devcontainer-feature.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@
88
"type": "string",
99
"proposals": [
1010
"latest",
11-
"0.13.0!",
11+
"0.13.0",
1212
"0.12"
1313
],
1414
"default": "latest",
1515
"description": "The version of Zig to install."
1616
},
17+
"versionResolve":{
18+
"type":"boolean",
19+
"default": false,
20+
"description": "Whether to resolve the version automatically."
21+
},
1722
"downloadRegistryBase": {
1823
"type": "string",
1924
"default": "",

0 commit comments

Comments
 (0)