Skip to content

Commit

Permalink
local-cluster: disable setting up cluster automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
jashan-lco committed Mar 5, 2025
1 parent 1068a40 commit e897d5c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions local-cluster/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let
in {
options.devenv-k8s.local-cluster = {
enable = lib.mkEnableOption "Enable the local development K8s cluster";
setup.disable = lib.mkEnableOption "Disable setting up the cluster automatically after entering the development shell.";
setup.enable = lib.mkEnableOption "Setup development cluster automatically after entering the development shell.";
};
config = lib.mkIf cfg.enable (lib.mkMerge [

Expand Down Expand Up @@ -81,7 +81,15 @@ in {
};
}

(lib.mkIf (!cfg.setup.disable) {
(lib.mkIf (!cfg.setup.enable) {
enterShell = ''
echo
echo "Skipped setting up development K8s cluster. To set it up run: devenv-k8s-cluster-up"
echo
'';
})

(lib.mkIf (cfg.setup.enable) {
enterShell = ''
devenv-k8s-cluster-up-only || exit 1
devenv-k8s-cluster-info
Expand Down

0 comments on commit e897d5c

Please sign in to comment.