Skip to content

Commit 399b4af

Browse files
dploegerDennis Ploeger
authored andcommitted
feat: Optimizes feature version configuration
1 parent 59d3b62 commit 399b4af

16 files changed

Lines changed: 76 additions & 76 deletions

File tree

β€ŽREADME.mdβ€Ž

Lines changed: 45 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ This would install the version 3.5.1 of Helm and version 1.1.9 of terraform. (Ku
116116
version of kubectl, e.g. using az aks install-cli)
117117

118118
**Note**: Please see the feature documentation below if a feature supports specifying a version string. All version
119-
strings need to be provided in semver format (f.e. 1.2.3), the feature installers will take care about prefixes for
119+
strings need to be provided in semver format (i.e. 1.2.3), the feature installers will take care about prefixes for
120120
download URLs, if required.
121121

122122
## Using Kubernetes (Preview)
@@ -371,7 +371,7 @@ Installs and configures the [Fish Shell](https://fishshell.com/) with configured
371371

372372
#### Configuration
373373

374-
* USE_fish: Enable this feature (it's recommended to use the FEATURES variable instead)
374+
* USE_fish: Enable this feature (or use the FEATURES variable instead)
375375
* DEBUG_fish: Debug this feature
376376

377377
### <a id="azcopy"></a> AzCopy
@@ -380,7 +380,7 @@ Installs [AzCopy](https://github.com/Azure/azure-storage-azcopy)
380380

381381
#### Configuration
382382

383-
* USE_azcopy: Enable this feature (it's recommended to use the FEATURES variable instead)
383+
* USE_azcopy: Enable this feature (or use the FEATURES variable instead)
384384
* DEBUG_azcopy: Debug this feature
385385

386386
### <a id="ca-certificates"></a> CA-Certificates
@@ -389,7 +389,7 @@ Adds specified trusted certificate authorities into the container
389389

390390
#### Configuration
391391

392-
* USE_ca-certificates: Enable this feature (it's recommended to use the FEATURES variable instead)
392+
* USE_ca-certificates: Enable this feature (or use the FEATURES variable instead)
393393
* DEBUG_ca-certificates: Debug this feature
394394
* Add a volume mount to the `volumes:` section of docker compose like this:
395395
(...)
@@ -407,7 +407,7 @@ Adds specified trusted certificate authorities into the container
407407

408408
#### Configuration
409409

410-
* USE_certificates: Enable this feature (it's recommended to use the FEATURES variable instead)
410+
* USE_certificates: Enable this feature (or use the FEATURES variable instead)
411411
* DEBUG_certificates: Debug this feature
412412
* Add a volume mount to the `volumes:` section of docker compose like this:
413413
(...)
@@ -425,18 +425,17 @@ Installs the cert-manager Command Line Tool
425425

426426
#### Configuration
427427

428-
* USE_cmctl: Enable this feature (it's recommended to use the FEATURES variable instead)
428+
* USE_cmctl: Enable this feature (or use the FEATURES variable instead)
429+
* CMCTL_VERSION: Version to install (or use the FEATURES variable instead)
429430
* DEBUG_cmctl: Debug this feature
430-
* Environment CMCTL_VERSION: Version of cmctl to install (optional)
431-
Defaults to `latest`
432431

433432
### <a id="direnv"></a> Direnv
434433

435434
Installs [Direnv](https://direnv.net/)
436435

437436
#### Configuration
438437

439-
* USE_direnv: Enable this feature (it's recommended to use the FEATURES variable instead)
438+
* USE_direnv: Enable this feature (or use the FEATURES variable instead)
440439
* DEBUG_direnv: Debug this feature
441440

442441
### <a id="helm"></a> Helm
@@ -445,17 +444,17 @@ Installs [Helm](https://helm.sh)
445444

446445
#### Configuration
447446

448-
* USE_helm: Enable this feature (it's recommended to use the FEATURES variable instead)
447+
* USE_helm: Enable this feature (or use the FEATURES variable instead)
448+
* HELM_VERSION: Version to install (or use the FEATURES variable instead)
449449
* DEBUG_helm: Debug this feature
450-
* Environment HELM_VERSION (required): Valid Helm version to install (e.g. 1.5.4)
451450

452451
### <a id="jq"></a> JQ
453452

454453
Installs the [JSON parser and processor jq](https://stedolan.github.io/jq/)
455454

456455
#### Configuration
457456

458-
* USE_jq: Enable this feature (it's recommended to use the FEATURES variable instead)
457+
* USE_jq: Enable this feature (or use the FEATURES variable instead)
459458
* DEBUG_jq: Debug this feature
460459

461460
### <a id="k9s"></a> k9s
@@ -464,9 +463,9 @@ Installs [k9s](https://k9scli.io/)
464463

465464
#### Configuration
466465

467-
* USE_k9s: Enable this feature (it's recommended to use the FEATURES variable instead)
466+
* USE_k9s: Enable this feature (or use the FEATURES variable instead)
467+
* K9S_VERSION: Version to install (or use the FEATURES variable instead)
468468
* DEBUG_k9s: Debug this feature
469-
* Environment K9S_VERSION (required): Valid k9s version to install
470469

471470
### <a id="kc"></a> kc Quick Kubernetes Context switch
472471

@@ -475,7 +474,7 @@ Installs [kc](https://github.com/dodevops/cloudcontrol/blob/master/feature/kc/kc
475474

476475
#### Configuration
477476

478-
* USE_kc: Enable this feature (it's recommended to use the FEATURES variable instead)
477+
* USE_kc: Enable this feature (or use the FEATURES variable instead)
479478
* DEBUG_kc: Debug this feature
480479

481480
### <a id="krew"></a> krew
@@ -484,9 +483,9 @@ Installs [Krew](https://krew.sigs.k8s.io/)
484483

485484
#### Configuration
486485

487-
* USE_krew: Enable this feature (it's recommended to use the FEATURES variable instead)
486+
* USE_krew: Enable this feature (or use the FEATURES variable instead)
487+
* KREW_VERSION: Version to install (or use the FEATURES variable instead)
488488
* DEBUG_krew: Debug this feature
489-
* Environment KREW_VERSION (optional): Valid Krew version to install (defaults to latest)
490489
* Environment KREW_PLUGINS (optional): A comma separated list of kubectl plugins to install via krew
491490

492491
### <a id="kubectlnodeshell"></a> Kubectlnodeshell
@@ -495,7 +494,7 @@ Installs [kubectl node-shell](https://github.com/kvaps/kubectl-node-shell)
495494

496495
#### Configuration
497496

498-
* USE_kubectlnodeshell: Enable this feature (it's recommended to use the FEATURES variable instead)
497+
* USE_kubectlnodeshell: Enable this feature (or use the FEATURES variable instead)
499498
* DEBUG_kubectlnodeshell: Debug this feature
500499

501500
### <a id="kubernetes"></a> Kubernetes
@@ -504,7 +503,7 @@ Installs and configures [kubernetes](https://kubernetes.io/docs/reference/kubect
504503

505504
#### Configuration
506505

507-
* USE_kubernetes: Enable this feature (it's recommended to use the FEATURES variable instead)
506+
* USE_kubernetes: Enable this feature (or use the FEATURES variable instead)
508507
* DEBUG_kubernetes: Debug this feature
509508
* Environment KUBECTL_DEFAULT_CONTEXT: Sets the default kubectl context after initialisation and when using the
510509
k8s-relogin script
@@ -553,7 +552,7 @@ Installs additional packages into the container
553552

554553
#### Configuration
555554

556-
* USE_packages: Enable this feature (it's recommended to use the FEATURES variable instead)
555+
* USE_packages: Enable this feature (or use the FEATURES variable instead)
557556
* DEBUG_packages: Debug this feature
558557
* Environment PACKAGES: A whitespace separated list of packages to install. The packages will be installed with the flavour's default package manager.
559558

@@ -563,17 +562,17 @@ Installs [Packer](https://packer.io)
563562

564563
#### Configuration
565564

566-
* USE_packer: Enable this feature (it's recommended to use the FEATURES variable instead)
565+
* USE_packer: Enable this feature (or use the FEATURES variable instead)
566+
* PACKER_VERSION: Version to install (or use the FEATURES variable instead)
567567
* DEBUG_packer: Debug this feature
568-
* Environment PACKER_VERSION (required): Valid Packer version to install (e.g. 1.5.4)
569568

570569
### <a id="run"></a> Run
571570

572571
Runs commands inside the shell when entering the cloud control container
573572

574573
#### Configuration
575574

576-
* USE_run: Enable this feature (it's recommended to use the FEATURES variable instead)
575+
* USE_run: Enable this feature (or use the FEATURES variable instead)
577576
* DEBUG_run: Debug this feature
578577
* Environment RUN_COMMANDS: Valid shell commands to run
579578

@@ -583,9 +582,9 @@ Installs [sops](https://github.com/getsops/sops)
583582

584583
#### Configuration
585584

586-
* USE_sops: Enable this feature (it's recommended to use the FEATURES variable instead)
585+
* USE_sops: Enable this feature (or use the FEATURES variable instead)
586+
* SOPS_VERSION: Version to install (or use the FEATURES variable instead)
587587
* DEBUG_sops: Debug this feature
588-
* Environment SOPS_VERSION (required): Valid sops version (e.g. 3.8.1)
589588
* Environment specific for the key you use, see [sops documentation](https://github.com/getsops/sops?tab=readme-ov-file#22encrypting-using-age)
590589

591590
### <a id="stern"></a> Stern
@@ -595,27 +594,28 @@ Installs [stern](https://github.com/stern/stern), a multi pod and container log
595594

596595
#### Configuration
597596

598-
* USE_stern: Enable this feature (it's recommended to use the FEATURES variable instead)
597+
* USE_stern: Enable this feature (or use the FEATURES variable instead)
598+
* STERN_VERSION: Version to install (or use the FEATURES variable instead)
599599
* DEBUG_stern: Debug this feature
600-
* Environment STERN_VERSION (required): Valid Stern version (e.g. 1.21.0)
601600

602601
### <a id="tanzucli"></a> Tanzu CLI
603602

604603
Installs the [Tanzu CLI](https://github.com/vmware-tanzu/tanzu-cli)
605604

606605
#### Configuration
607606

608-
* USE_tanzucli: Enable this feature (it's recommended to use the FEATURES variable instead)
607+
* USE_tanzucli: Enable this feature (or use the FEATURES variable instead)
608+
* TANZUCLI_VERSION: Version to install (or use the FEATURES variable instead)
609609
* DEBUG_tanzucli: Debug this feature
610-
* Environment TANZU_CLI_VERSION: Tanzu CLI version to install (required)
611610

612611
### <a id="terraform"></a> Terraform
613612

614613
Installs and configures [Terraform](https://terraform.io)
615614

616615
#### Configuration
617616

618-
* USE_terraform: Enable this feature (it's recommended to use the FEATURES variable instead)
617+
* USE_terraform: Enable this feature (or use the FEATURES variable instead)
618+
* TERRAFORM_VERSION: Version to install (or use the FEATURES variable instead)
619619
* DEBUG_terraform: Debug this feature
620620
* Add a volume mount to the `volumes:` section of docker compose like this:
621621
(...)
@@ -626,7 +626,6 @@ Installs and configures [Terraform](https://terraform.io)
626626
* Volume-target /credentials.terraform: A Terraform variable file holding sensitive information when working with terraform (e.g.
627627
Terraform app secrets, etc.). If something different than /credentials.terraform is used, environment TERRAFORM_CREDENTIALS_PATH
628628
needs to be set to this path
629-
* Environment TERRAFORM_VERSION (required): A valid terraform version to install (e.g. 0.12.17)
630629
* Environment TERRAFORM_PATH: Volume target for terraform base directory (optional). Defaults to `/terraform`. If something different
631630
than the default is used, the volume-target needs to be adapted to the same directory
632631
* Environment TERRAFORM_CREDENTIALS_PATH: Volume target for terraform credentials (optional). Defaults to `/terraform`. If something
@@ -642,17 +641,17 @@ Installs [Terragrunt](https://github.com/gruntwork-io/terragrunt)
642641

643642
#### Configuration
644643

645-
* USE_terragrunt: Enable this feature (it's recommended to use the FEATURES variable instead)
644+
* USE_terragrunt: Enable this feature (or use the FEATURES variable instead)
645+
* TERRAGRUNT_VERSION: Version to install (or use the FEATURES variable instead)
646646
* DEBUG_terragrunt: Debug this feature
647-
* Environment TERRAGRUNT_VERSION (required): Valid version of terragrunt to install
648647

649648
### <a id="timezone"></a> Timezone configuration
650649

651650
Configures the container's timezone
652651

653652
#### Configuration
654653

655-
* USE_timezone: Enable this feature (it's recommended to use the FEATURES variable instead)
654+
* USE_timezone: Enable this feature (or use the FEATURES variable instead)
656655
* DEBUG_timezone: Debug this feature
657656
* Environment TZ: The timezone to use
658657

@@ -662,17 +661,17 @@ Installs the [Velero](https://velero.io) kubernetes backup CLI
662661

663662
#### Configuration
664663

665-
* USE_velero: Enable this feature (it's recommended to use the FEATURES variable instead)
664+
* USE_velero: Enable this feature (or use the FEATURES variable instead)
665+
* VELERO_VERSION: Version to install (or use the FEATURES variable instead)
666666
* DEBUG_velero: Debug this feature
667-
* Environment VELERO_VERSION (required): Valid velero version to install (e.g. 1.4.2)
668667

669668
### <a id="vim"></a> Vim
670669

671670
Installs [Vim](https://www.vim.org/)
672671

673672
#### Configuration
674673

675-
* USE_vim: Enable this feature (it's recommended to use the FEATURES variable instead)
674+
* USE_vim: Enable this feature (or use the FEATURES variable instead)
676675
* DEBUG_vim: Debug this feature
677676

678677
### <a id="yq"></a> YQ
@@ -681,9 +680,9 @@ Installs the [YAML parser and processor yq](https://github.com/mikefarah/yq)
681680

682681
#### Configuration
683682

684-
* USE_yq: Enable this feature (it's recommended to use the FEATURES variable instead)
683+
* USE_yq: Enable this feature (or use the FEATURES variable instead)
684+
* YQ_VERSION: Version to install (or use the FEATURES variable instead)
685685
* DEBUG_yq: Debug this feature
686-
* Environment YQ_VERSION (required): Valid YQ version to install (e.g. 4.5.0)
687686

688687

689688
## Development
@@ -867,7 +866,13 @@ flowchart TD
867866
click F "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/test.yml" "Test workflow"
868867
click H "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/release.yml" "Release workflow"
869868
```mermaid
870-
workflow"
869+
"
870+
```mermaid
871+
flows/docs.yml" "Docs workflow"
872+
click C "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/image.yml" "Image workflow"
873+
click E "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/check_commits.yml" "Check workflow"
874+
click F "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/test.yml" "Test workflow"
875+
click H "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/release.yml" "Release workflow"
871876
```mermaid
872877
ase workflow"
873878
```mermaid

β€ŽREADME.md.gotmplβ€Ž

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ This would install the version 3.5.1 of Helm and version 1.1.9 of terraform. (Ku
7171
version of kubectl, e.g. using az aks install-cli)
7272

7373
**Note**: Please see the feature documentation below if a feature supports specifying a version string. All version
74-
strings need to be provided in semver format (f.e. 1.2.3), the feature installers will take care about prefixes for
74+
strings need to be provided in semver format (i.e. 1.2.3), the feature installers will take care about prefixes for
7575
download URLs, if required.
7676

7777
## Using Kubernetes (Preview)
@@ -274,7 +274,10 @@ environment variable in the docker-compose file. Then you can debug with the run
274274

275275
#### Configuration
276276

277-
* USE_{{ trimPrefix "_" $name }}: Enable this feature (it's recommended to use the FEATURES variable instead)
277+
* USE_{{ trimPrefix "_" $name }}: Enable this feature (or use the FEATURES variable instead)
278+
{{- if $feature.RequiresVersion }}
279+
* {{ $name | upper }}_VERSION: Version to install (or use the FEATURES variable instead)
280+
{{- end }}
278281
* DEBUG_{{ trimPrefix "_" $name }}: Debug this feature
279282
{{- range $feature.Configuration }}
280283
* {{ indent 2 . | trim }}
@@ -320,9 +323,9 @@ to set for the specific environment variable. If a configuration option is requi
320323
environment declaration using `(required)` after its name and check if the variable is set in your installation script
321324
and break accordingly if not.
322325

323-
If your feature needs a version specification, the recommended way is to use the environment variable
324-
`[FEATURE NAME]_VERSION`. This variable is also filled if the *CloudControl* user uses the FEATURES-variable approach
325-
to enable features.
326+
If your feature needs a version specification, set "requiresVersion" to true in the feature descriptor. This will
327+
enable the use of an environment variable `[FEATURE NAME]_VERSION`. This variable is also filled if the *CloudControl*
328+
user uses the FEATURES-variable approach to enable features.
326329

327330
### Installer utilities
328331

β€Žfeature/.template/feature.yamlβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ configuration:
1616
#- |
1717
# Environment EXAMPLE_ENVIRONMENT: This environment variable is used in the feature to do xyz (optional)
1818
# Defaults to `abc`
19+
20+
# If your feature requires a version (exposed as <FEATURE>_VERSION to your installer script), set this to true
21+
requiresVersion: false

β€Žfeature/cmctl/feature.yamlβ€Ž

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
icon: "πŸ“¨"
22
title: "cmctl"
33
description: "Installs the cert-manager Command Line Tool"
4-
configuration:
5-
- |
6-
Environment CMCTL_VERSION: Version of cmctl to install (optional)
7-
Defaults to `latest`
4+
requiresVersion: true

β€Žfeature/helm/feature.yamlβ€Ž

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
icon: "⛡️"
22
title: "Helm"
33
description: "Installs [Helm](https://helm.sh)"
4-
configuration:
5-
- "Environment HELM_VERSION (required): Valid Helm version to install (e.g. 1.5.4)"
4+
requiresVersion: true

β€Žfeature/k9s/feature.yamlβ€Ž

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
icon: "🐾"
22
title: "k9s"
33
description: "Installs [k9s](https://k9scli.io/)"
4-
configuration:
5-
- "Environment K9S_VERSION (required): Valid k9s version to install"
4+
requiresVersion: true

β€Žfeature/krew/feature.yamlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ icon: "🟦"
22
title: "krew"
33
description: "Installs [Krew](https://krew.sigs.k8s.io/)"
44
configuration:
5-
- "Environment KREW_VERSION (optional): Valid Krew version to install (defaults to latest)"
65
- "Environment KREW_PLUGINS (optional): A comma separated list of kubectl plugins to install via krew"
6+
requiresVersion: true

β€Žfeature/packer/feature.yamlβ€Ž

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
icon: "πŸ“¦"
22
title: "Packer"
33
description: "Installs [Packer](https://packer.io)"
4-
configuration:
5-
- "Environment PACKER_VERSION (required): Valid Packer version to install (e.g. 1.5.4)"
4+
requiresVersion: true

β€Žfeature/sops/feature.yamlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ icon: "πŸ”‘"
22
title: "sops"
33
description: "Installs [sops](https://github.com/getsops/sops)"
44
configuration:
5-
- "Environment SOPS_VERSION (required): Valid sops version (e.g. 3.8.1)"
65
- "Environment specific for the key you use, see [sops documentation](https://github.com/getsops/sops?tab=readme-ov-file#22encrypting-using-age)"
6+
requiresVersion: true

β€Žfeature/stern/feature.yamlβ€Ž

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ icon: "πŸ“œ"
22
title: "Stern"
33
description: |
44
Installs [stern](https://github.com/stern/stern), a multi pod and container log tailing for Kubernetes
5-
configuration:
6-
- "Environment STERN_VERSION (required): Valid Stern version (e.g. 1.21.0)"
5+
requiresVersion: true

0 commit comments

Comments
Β (0)