Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ client-regenerate: client-setup-env ## Regenerate the client code
.PHONY: client-unit-test
client-unit-test: client-setup-env ## Run client unit tests
@echo "--- Running client unit tests ---"
@$(ACTIVATE_AND_CD) && SCRIPT_DIR="non-existing-mock-directory" poetry run pytest test/
@$(ACTIVATE_AND_CD) && poetry run pytest test/
@echo "--- Client unit tests complete ---"

.PHONY: client-integration-test
Expand Down
1 change: 1 addition & 0 deletions client/python/cli/command/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def _load_profiles(self) -> Dict[str, Dict[str, str]]:
if not os.path.exists(CONFIG_FILE):
return {}
with open(CONFIG_FILE, "r") as f:
print(f"Loading profiles from {CONFIG_FILE}")
return json.load(f)

def _save_profiles(self, profiles: Dict[str, Dict[str, str]]) -> None:
Expand Down
6 changes: 1 addition & 5 deletions client/python/cli/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,5 @@ class Namespaces:
CLIENT_PROFILE_ENV = "CLIENT_PROFILE"
DEFAULT_HOSTNAME = "localhost"
DEFAULT_PORT = 8181
CONFIG_DIR = os.environ.get("SCRIPT_DIR")
if CONFIG_DIR is None:
raise Exception(
"The SCRIPT_DIR environment variable is not set. Please set it to the Polaris's script directory."
)
CONFIG_DIR = (os.environ.get("POLARIS_HOME") or "").strip() or os.path.expanduser("~/.polaris")
CONFIG_FILE = os.path.join(CONFIG_DIR, ".polaris.json")
1 change: 0 additions & 1 deletion polaris
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,4 @@ if ! command -v polaris &> /dev/null; then
source "${dir}/polaris-venv/bin/activate"
fi

export SCRIPT_DIR="${dir}"
exec polaris "$@"
2 changes: 1 addition & 1 deletion site/content/in-dev/unreleased/command-line-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Alternatively, you can run the CLI by providing a path to it, such as with the f

Each of the commands `catalogs`, `principals`, `principal-roles`, `catalog-roles`, and `privileges` is used to manage a different type of entity within Polaris.

In addition to these, the `profiles` command is available for managing stored authentication profiles, allowing login credentials to be configured for reuse. This provides an alternative to passing authentication details with every command.
In addition to these, the `profiles` command is available for managing stored authentication profiles, allowing login credentials to be configured for reuse. This provides an alternative to passing authentication details with every command. By default, profiles are stored in a `.polaris.json` file within the `~/.polaris` directory. The location of this directory can be overridden by setting the `POLARIS_HOME` environment variable.

To find details on the options that can be provided to a particular command or subcommand ad-hoc, you may wish to use the `--help` flag. For example:

Expand Down