Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ctl): Namespace separation and support skipping release installation #79

Merged
merged 19 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
467 changes: 422 additions & 45 deletions extra/completions/_stackablectl

Large diffs are not rendered by default.

1,482 changes: 1,383 additions & 99 deletions extra/completions/stackablectl.bash

Large diffs are not rendered by default.

312 changes: 287 additions & 25 deletions extra/completions/stackablectl.fish

Large diffs are not rendered by default.

19 changes: 8 additions & 11 deletions extra/man/stackablectl.1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions rust/stackable-cockpit/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ use std::time::Duration;
pub const REDACTED_PASSWORD: &str = "<redacted>";
pub const PASSWORD_LEN: usize = 32;

pub const DEFAULT_STACKABLE_NAMESPACE: &str = "stackable";
pub const DEFAULT_NAMESPACE: &str = "default";
pub const DEFAULT_OPERATOR_NAMESPACE: &str = "stackable-operators";
// TODO (Techassi): Change this to "stackable-demos" once we switch to this version
Techassi marked this conversation as resolved.
Show resolved Hide resolved
pub const DEFAULT_PRODUCT_NAMESPACE: &str = "default";
Techassi marked this conversation as resolved.
Show resolved Hide resolved

pub const DEFAULT_LOCAL_CLUSTER_NAME: &str = "stackable-data-platform";

Expand Down
29 changes: 12 additions & 17 deletions rust/stackablectl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,34 +35,36 @@ Options:
--offline
Do not request any remote files via the network

-n, --operator-namespace <OPERATOR_NAMESPACE>
Techassi marked this conversation as resolved.
Show resolved Hide resolved
Namespace in the cluster used to deploy the products and operators
-h, --help
Print help (see a summary with '-h')

[default: default]
-V, --version
Print version

-d, --demo-file <DEMO_FILES>
File options:
-d, --demo-file <DEMO_FILE>
Provide one or more additional (custom) demo file(s)

Demos are loaded in the following order: Remote (default) demo file, custom
demo files provided via the 'STACKABLE_DEMO_FILES' environment variable, and
lastly demo files provided via the '-d/--demo-file' argument(s). If there are
demos with the same name, the last demo definition will be used.

Use "stackablectl -d path/to/demos1.yaml -d path/to/demos2.yaml [OPTIONS] <COMMAND>"
Use "stackablectl [OPTIONS] <COMMAND> -d path/to/demos1.yaml -d path/to/demos2.yaml"
to provide multiple additional demo files.

-s, --stack-file <STACK_FILES>
-s, --stack-file <STACK_FILE>
Provide one or more additional (custom) stack file(s)

Stacks are loaded in the following order: Remote (default) stack file, custom
stack files provided via the 'STACKABLE_STACK_FILES' environment variable, and
lastly demo files provided via the '-s/--stack-file' argument(s). If there are
stacks with the same name, the last stack definition will be used.

Use "stackablectl -s path/to/stacks1.yaml -s path/to/stacks2.yaml [OPTIONS] <COMMAND>"
Use "stackablectl [OPTIONS] <COMMAND> -s path/to/stacks1.yaml -s path/to/stacks2.yaml"
to provide multiple additional stack files.

-r, --release-file <RELEASE_FILES>
-r, --release-file <RELEASE_FILE>
Provide one or more additional (custom) release file(s)

Releases are loaded in the following order: Remote (default) release file,
Expand All @@ -71,12 +73,11 @@ Options:
argument(s). If there are releases with the same name, the last release
definition will be used.

Use "stackablectl -r path/to/releases1.yaml -r path/to/releases2.yaml [OPTIONS] <COMMAND>"
Use "stackablectl [OPTIONS] <COMMAND> -r path/to/releases1.yaml -r path/to/releases2.yaml"
to provide multiple additional release files.

Helm repository options:
--helm-repo-stable <URL>
Provide a custom Helm stable repository URL

[default: https://repo.stackable.tech/repository/helm-stable/]

--helm-repo-test <URL>
Expand All @@ -88,12 +89,6 @@ Options:
Provide a custom Helm dev repository URL

[default: https://repo.stackable.tech/repository/helm-dev/]

-h, --help
Print help (see a summary with '-h')

-V, --version
Print version
```

## Dev Setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub enum CommonClusterArgsError {
}

#[derive(Debug, Args)]
#[command(next_help_heading = "Cluster options")]
pub struct CommonClusterArgs {
/// Type of local cluster to use for testing
#[arg(short = 'c', long = "cluster", value_name = "CLUSTER_TYPE")]
Expand Down
45 changes: 45 additions & 0 deletions rust/stackablectl/src/args/file.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
use clap::{Args, ValueHint};

#[derive(Debug, Args)]
#[command(next_help_heading = "File options")]
pub struct CommonFileArgs {
/// Provide one or more additional (custom) demo file(s)
#[arg(short, long = "demo-file", value_name = "DEMO_FILE", value_hint = ValueHint::FilePath, global = true)]
#[arg(long_help = "Provide one or more additional (custom) demo file(s)

Demos are loaded in the following order: Remote (default) demo file, custom
demo files provided via the 'STACKABLE_DEMO_FILES' environment variable, and
lastly demo files provided via the '-d/--demo-file' argument(s). If there are
demos with the same name, the last demo definition will be used.

Use \"stackablectl [OPTIONS] <COMMAND> -d path/to/demos1.yaml -d path/to/demos2.yaml\"
to provide multiple additional demo files.")]
pub demo_files: Vec<String>,

/// Provide one or more additional (custom) stack file(s)
#[arg(short, long = "stack-file", value_name = "STACK_FILE", value_hint = ValueHint::FilePath, global = true)]
#[arg(long_help = "Provide one or more additional (custom) stack file(s)

Stacks are loaded in the following order: Remote (default) stack file, custom
stack files provided via the 'STACKABLE_STACK_FILES' environment variable, and
lastly demo files provided via the '-s/--stack-file' argument(s). If there are
stacks with the same name, the last stack definition will be used.

Use \"stackablectl [OPTIONS] <COMMAND> -s path/to/stacks1.yaml -s path/to/stacks2.yaml\"
to provide multiple additional stack files.")]
pub stack_files: Vec<String>,

/// Provide one or more additional (custom) release file(s)
#[arg(short, long = "release-file", value_name = "RELEASE_FILE", value_hint = ValueHint::FilePath, global = true)]
#[arg(long_help = "Provide one or more additional (custom) release file(s)

Releases are loaded in the following order: Remote (default) release file,
custom release files provided via the 'STACKABLE_RELEASE_FILES' environment
variable, and lastly release files provided via the '-r/--release-file'
argument(s). If there are releases with the same name, the last release
definition will be used.

Use \"stackablectl [OPTIONS] <COMMAND> -r path/to/releases1.yaml -r path/to/releases2.yaml\"
to provide multiple additional release files.")]
pub release_files: Vec<String>,
}
9 changes: 9 additions & 0 deletions rust/stackablectl/src/args/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
mod cluster;
mod file;
mod namespace;
mod repo;

pub use cluster::*;
pub use file::*;
pub use namespace::*;
pub use repo::*;
14 changes: 14 additions & 0 deletions rust/stackablectl/src/args/namespace.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use clap::Args;
use stackable_cockpit::constants::{DEFAULT_OPERATOR_NAMESPACE, DEFAULT_PRODUCT_NAMESPACE};

#[derive(Debug, Args)]
#[command(next_help_heading = "Namespace options")]
pub struct CommonNamespaceArgs {
/// Namespace in the cluster used to deploy the operators
Techassi marked this conversation as resolved.
Show resolved Hide resolved
#[arg(short = 'n', long, default_value = DEFAULT_OPERATOR_NAMESPACE, global = true)]
Techassi marked this conversation as resolved.
Show resolved Hide resolved
pub operator_namespace: String,

/// Namespace in the cluster used to deploy the products
Techassi marked this conversation as resolved.
Show resolved Hide resolved
#[arg(long, default_value = DEFAULT_PRODUCT_NAMESPACE, global = true)]
pub product_namespace: String,
}
19 changes: 19 additions & 0 deletions rust/stackablectl/src/args/repo.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use clap::{Args, ValueHint};

use crate::constants::{HELM_REPO_URL_DEV, HELM_REPO_URL_STABLE, HELM_REPO_URL_TEST};

#[derive(Debug, Args)]
#[command(next_help_heading = "Helm repository options")]
pub struct CommonRepoArgs {
// Provide a custom Helm stable repository URL
Techassi marked this conversation as resolved.
Show resolved Hide resolved
#[arg(long, value_name = "URL", value_hint = ValueHint::Url, default_value = HELM_REPO_URL_STABLE, global = true)]
pub helm_repo_stable: String,

/// Provide a custom Helm test repository URL
#[arg(long, value_name = "URL", value_hint = ValueHint::Url, default_value = HELM_REPO_URL_TEST, global = true)]
pub helm_repo_test: String,

/// Provide a custom Helm dev repository URL
#[arg(long, value_name = "URL", value_hint = ValueHint::Url, default_value = HELM_REPO_URL_DEV, global = true)]
pub helm_repo_dev: String,
}
Loading
Loading