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

Show active capella org in cbenv output when set #340

Closed
wants to merge 1 commit into from

Conversation

Westwooo
Copy link
Contributor

@Westwooo Westwooo commented Jul 8, 2024

Currently when we run the cb-env command it only shows the capella org associated with the active cluster. This can lead to confusion since the org associated with the active cluster is not necessarily the same as the active org :

> cb-env
╭──────────────────────┬───────────────╮
│ username             │ Administrator │
│ display_name         │ Westwooo      │
│ cluster              │ remote        │
│ bucket               │ default       │
│ scope                │ _default      │
│ collection           │ _default      │
│ cluster_type         │ other         │
│ capella-organization │ my-org        │
│ llm                  │ OpenAI        │
╰──────────────────────┴───────────────╯
👤 Westwooo 🏠 remote in 🗄 default._default._default
> projects
Error:   × Unexpected status code
   ╭─[entry #2:1:1]
 1 │ projects
   · ────┬───
   ·     ╰──
   ╰────
  help: Unexpected status code: 401, body: {"code":1001,"hint":"The request is unauthorized. Please ensure you have provided appropriate credentials in the request header. Please make sure the client IP that is trying to access the
        resource using the API key is in the API key allowlist.","httpStatusCode":401,"message":"Unauthorized"}


👤 Westwooo 🏠 remote in 🗄 default._default._default
> cb-env --capella
╭──────────────────────┬────────────╮
│ capella-organisation │ not-an-org │
│ project              │            │
│ llm                  │ OpenAI     │
╰──────────────────────┴────────────╯

It initially seems that we are unauthorised to connect to the org my-org however we can see that the active capella org is actually not-an-org which is the org used in the running of the projects command. To make this less confusing thisi PR removes the capella flag from cb-env and always shows the active org and differentiates it from the cluster org:

👤 Westwooo 🏠 remote in 🗄 default._default._default
> cb-env
╭──────────────────────┬───────────────╮
│ username             │ Administrator │
│ display_name         │ Westwooo      │
│ cluster              │ remote        │
│ bucket               │ default       │
│ scope                │               │
│ collection           │               │
│ cluster_type         │ other         │
│ cluster-organization │ my-org        │
│ active-organization  │ not-an-org    │
│ project              │               │
│ llm                  │ OpenAI        │
╰──────────────────────┴───────────────╯

Another solution considered was to make the cluster-organization of the active cluster the active-organization. But this means that we would be changing the active org when changing the active cluster, which doesn't feel right considering orgs are higher level entities than clusters. Also we want to have an active org without having to have an active cluster.

@Westwooo Westwooo closed this Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant