Skip to content

Commit

Permalink
Merge remote-tracking branch 'stackable/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernauer committed Aug 18, 2023
2 parents 51b281b + 5ed614c commit bfe3e9f
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 40 deletions.
11 changes: 4 additions & 7 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,20 @@ allow = [
"LicenseRef-webpki",
"MIT",
"Unicode-DFS-2016",
"Zlib"
"Zlib",
"MPL-2.0",
]
private = { ignore = true }

[[licenses.clarify]]
name = "ring"
expression = "LicenseRef-ring"
license-files = [
{ path = "LICENSE", hash = 0xbd0eed23 },
]
license-files = [{ path = "LICENSE", hash = 0xbd0eed23 }]

[[licenses.clarify]]
name = "webpki"
expression = "LicenseRef-webpki"
license-files = [
{ path = "LICENSE", hash = 0x001c7e6c },
]
license-files = [{ path = "LICENSE", hash = 0x001c7e6c }]

[sources]
unknown-registry = "deny"
Expand Down
26 changes: 15 additions & 11 deletions rust/stackablectl/src/cli/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::env;

use clap::{Parser, Subcommand, ValueEnum};
use directories::BaseDirs;
use snafu::{OptionExt, Snafu};
use directories::ProjectDirs;
use snafu::Snafu;
use tracing::{debug, instrument, Level};

use stackable_cockpit::{
Expand All @@ -22,8 +22,9 @@ use crate::{
release::ReleaseArgs, stack::StackArgs, stacklets::StackletsArgs,
},
constants::{
CACHE_HOME_PATH, ENV_KEY_DEMO_FILES, ENV_KEY_RELEASE_FILES, ENV_KEY_STACK_FILES,
REMOTE_DEMO_FILE, REMOTE_RELEASE_FILE, REMOTE_STACK_FILE,
ENV_KEY_DEMO_FILES, ENV_KEY_RELEASE_FILES, ENV_KEY_STACK_FILES, REMOTE_DEMO_FILE,
REMOTE_RELEASE_FILE, REMOTE_STACK_FILE, USER_DIR_APPLICATION_NAME,
USER_DIR_ORGANIZATION_NAME, USER_DIR_QUALIFIER,
},
};

Expand Down Expand Up @@ -124,9 +125,14 @@ impl Cli {
if self.no_cache {
Ok(CacheSettings::disabled())
} else {
let dirs = BaseDirs::new().context(cache_settings_error::BaseDirsSnafu)?;
let cache_dir = dirs.cache_dir().join(CACHE_HOME_PATH);
Ok(CacheSettings::disk(cache_dir))
let project_dir = ProjectDirs::from(
USER_DIR_QUALIFIER,
USER_DIR_ORGANIZATION_NAME,
USER_DIR_APPLICATION_NAME,
)
.ok_or(CacheSettingsError::UserDir)?;

Ok(CacheSettings::disk(project_dir.cache_dir()))
}
}
}
Expand Down Expand Up @@ -185,12 +191,10 @@ pub enum OutputType {
#[derive(Debug, Snafu)]
#[snafu(module)]
pub enum CacheSettingsError {
#[snafu(display("unable to resolve base directories"))]
BaseDirs {},
#[snafu(display("unable to resolve user directories"))]
UserDir,
}

pub struct InheritStackDemoArgs {}

/// Returns a list of paths or urls based on the default (remote) file and
/// files provided via the env variable.
fn get_files(default_file: &str, env_key: &str) -> Result<Vec<PathOrUrl>, PathOrUrlParseError> {
Expand Down
4 changes: 3 additions & 1 deletion rust/stackablectl/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ pub const HELM_REPO_URL_STABLE: &str = "https://repo.stackable.tech/repository/h
pub const HELM_REPO_URL_TEST: &str = "https://repo.stackable.tech/repository/helm-test/";
pub const HELM_REPO_URL_DEV: &str = "https://repo.stackable.tech/repository/helm-dev/";

pub const CACHE_HOME_PATH: &str = "stackablectl";
pub const USER_DIR_APPLICATION_NAME: &str = "stackablectl";
pub const USER_DIR_ORGANIZATION_NAME: &str = "Stackable";
pub const USER_DIR_QUALIFIER: &str = "tech";
48 changes: 27 additions & 21 deletions web/src/api/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ type OneOf<T extends any[]> = T extends [infer Only] ? Only : T extends [infer A
export interface paths {
"/demos": {
/**
* Retrieves all demos.
* Retrieves all demos.
* @description Retrieves all demos.
*/
get: operations["get_demos"];
};
"/demos/{name}": {
/**
* Retrieves one demo identified by `name`.
* Retrieves one demo identified by `name`.
* @description Retrieves one demo identified by `name`.
*/
get: operations["get_demo"];
Expand All @@ -32,21 +32,21 @@ export interface paths {
};
"/releases": {
/**
* Retrieves all releases.
* Retrieves all releases.
* @description Retrieves all releases.
*/
get: operations["get_releases"];
};
"/releases/{name}": {
/**
* Retrieves one release identified by `name`.
* Retrieves one release identified by `name`.
* @description Retrieves one release identified by `name`.
*/
get: operations["get_release"];
};
"/stacklets": {
/**
* Retrieves all stacklets.
* Retrieves all stacklets.
* @description Retrieves all stacklets.
*/
get: operations["get_stacklets"];
Expand All @@ -64,18 +64,18 @@ export interface components {
/** @description An optional link to a documentation page */
documentation?: string | null;
/** @description A variable number of labels (tags) */
labels?: (string)[];
labels?: string[];
/** @description A variable number of Helm or YAML manifests */
manifests?: (components["schemas"]["ManifestSpec"])[];
manifests?: components["schemas"]["ManifestSpec"][];
/** @description A variable number of supported parameters */
parameters?: (components["schemas"]["Parameter"])[];
parameters?: components["schemas"]["Parameter"][];
/** @description The name of the underlying stack */
stackableStack: string;
/**
* @description Supported namespaces this demo can run in. An empty list indicates that
* the demo can run in any namespace.
*/
supportedNamespaces?: (string)[];
supportedNamespaces?: string[];
};
DisplayCondition: {
condition: string;
Expand Down Expand Up @@ -116,7 +116,7 @@ export interface components {
SessionToken: string;
Stacklet: {
/** @description Multiple cluster conditions. */
conditions: (components["schemas"]["DisplayCondition"])[];
conditions: components["schemas"]["DisplayCondition"][];
/**
* @description Endpoint addresses the product is reachable at.
* The key is the service name (e.g. `web-ui`), the value is the URL.
Expand Down Expand Up @@ -144,23 +144,25 @@ export type external = Record<string, never>;
export interface operations {

/**
* Retrieves all demos.
* Retrieves all demos.
* @description Retrieves all demos.
*/
get_demos: {
responses: {
/** @description Retrieving a list of demos succeeded */
200: {
content: {
"application/json": (components["schemas"]["DemoSpecV2"])[];
"application/json": components["schemas"]["DemoSpecV2"][];
};
};
/** @description Retrieving a list of demos failed */
404: never;
404: {
content: never;
};
};
};
/**
* Retrieves one demo identified by `name`.
* Retrieves one demo identified by `name`.
* @description Retrieves one demo identified by `name`.
*/
get_demo: {
Expand All @@ -172,7 +174,9 @@ export interface operations {
};
};
/** @description Retrieving the demo with 'name' failed */
404: never;
404: {
content: never;
};
};
};
log_in: {
Expand All @@ -199,38 +203,40 @@ export interface operations {
};
};
/**
* Retrieves all releases.
* Retrieves all releases.
* @description Retrieves all releases.
*/
get_releases: {
responses: {
/** @description Retrieving a list of releases succeeded */
200: {
content: {
"application/json": (components["schemas"]["ReleaseSpec"])[];
"application/json": components["schemas"]["ReleaseSpec"][];
};
};
/** @description Retrieving a list of releases failed */
404: never;
404: {
content: never;
};
};
};
/**
* Retrieves one release identified by `name`.
* Retrieves one release identified by `name`.
* @description Retrieves one release identified by `name`.
*/
get_release: {
responses: {
};
};
/**
* Retrieves all stacklets.
* Retrieves all stacklets.
* @description Retrieves all stacklets.
*/
get_stacklets: {
responses: {
200: {
content: {
"application/json": (components["schemas"]["Stacklet"])[];
"application/json": components["schemas"]["Stacklet"][];
};
};
};
Expand Down

0 comments on commit bfe3e9f

Please sign in to comment.