Skip to content

feat: add catalog aws and k8s subcommands - #226

Merged
jeff-schnitter merged 20 commits into
mainfrom
jeff/cli-catalog-integrations
Jul 23, 2026
Merged

feat: add catalog aws and k8s subcommands#226
jeff-schnitter merged 20 commits into
mainfrom
jeff/cli-catalog-integrations

Conversation

@jeff-schnitter

Copy link
Copy Markdown
Collaborator

Summary

  • Adds catalog aws subcommand to retrieve AWS resource details for a catalog entity
  • Adds catalog k8s subcommand to retrieve Kubernetes workload details for a catalog entity, with --table and --csv output support
  • Handles ConnectionError gracefully in CortexClient — shows a friendly message instead of a stack trace

Test plan

  • tests/test_catalog_k8s.py — 5 tests covering JSON, table, CSV, mutual exclusion, and empty response

jeff-schnitter and others added 18 commits June 26, 2026 10:23
Adds `cortex catalog aws -t <tag>` and `cortex catalog k8s -t <tag>`
to retrieve cached AWS and Kubernetes resource details for an entity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add argo-deploy-rollout.yaml (canary with stepped weights)
- Add argo-workloadref-rollout.yaml (Deployment + Rollout via workloadRef)
- Add hostAliases comment block to helm deployment.yaml for local testing
- Add .helmignore and README.md to helm chart

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Calls `cortex catalog k8s -t k8s-test-annotation` to verify k8s data
is accessible via the public API, replacing the Playwright UI test
suggestion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Profile files (.env.<name>) contain only the vars that differ per
environment. `just env <profile>` patches them into .env without
touching shared vars. Includes .env.local.example for local dev
and .env.default.example for cloud workspaces.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace sed substitution with grep -v + append approach so the
value is never used in a regex pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CORTEX_BASE_URL in .env uses host.minikube.internal (for the in-cluster
agent) which doesn't resolve on the host. Use -t CORTEX_TENANT_CODE so
the CLI reads the host-accessible URL from ~/.cortex/config instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Catch requests.ConnectionError around the HTTP call and print a clean
one-line error message instead of a multi-page Python traceback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Stop swallowing errors with || true. Capture exit code and report
failures clearly. Exit non-zero if any check fails.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…-label

- Unset CORTEX_BASE_URL and CORTEX_API_KEY in catalog create call so it
  uses the tenant config from ~/.cortex/config instead of exported env vars
- Rename entity tag from k8s-test-annotation to k8s-test-label across
  cortex-entity.yaml, all k8s manifests, and the test recipe

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the configmap changes (e.g. BASE_URL switches between cloud and
local), the sha256 checksum annotation on the pod template changes,
causing Helm to trigger a rolling restart automatically.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The cortex.io/tag value is a k8s annotation, so the entity name should
reflect that. Renamed from k8s-test-label to k8s-test-annotation across
entity YAML, all manifests, and the test recipe.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Display type, namespace/name, and cluster for each k8s resource found,
making it clear what the test is validating. Uses single-line python to
avoid Just parser issues with multiline scripts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Map argo-deploy rollout, argo-workloadref deployment, and
argo-workloadref rollout to the k8s-test-annotation entity so
the agent picks them up.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The cortex-key secret is created outside Helm, so configmap checksum
changes alone don't trigger a restart when the API key changes. Adding
an explicit rollout restart ensures the pod always picks up the latest
secret and configmap values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Show agent logs at end of setup (waits 15s for first cache push)
- Show the CLI command being run in test output
- Display sample JSON from first resource to make test logic visible

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New `cortex sso` subcommand with:
- list: List all SSO configurations
- create: Create OIDC connection via JSON file or CLI params
  (--provider, --identifier, --secret, --issuer)
  Google issuer auto-filled when --provider google
- delete: Delete specific connection by ID
- delete-all: Delete all SSO configurations

Supported providers: OKTA, GOOGLE, AZURE

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add `catalog aws` command to retrieve AWS resource details for an entity
- Add `catalog k8s` command to retrieve Kubernetes workload details for an entity
- Both commands support --table and --csv output (k8s) with configurable columns
- Handle ConnectionError gracefully in CortexClient instead of stack trace
- Add tests for catalog k8s command

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jeff-schnitter
jeff-schnitter requested a review from Cantaley as a code owner July 23, 2026 21:05
jeff-schnitter and others added 2 commits July 23, 2026 14:48
URLs were missing a slash between 'validate' and the alias (causing
'validate{alias}' instead of 'validate/{alias}'), and validate_all
was hitting the list endpoint instead of the validate endpoint.

Affected: launchdarkly, datadog, gitlab, azure-resources, azure-devops,
circleci, coralogix, incidentio, pagerduty, prometheus, sonarqube, aws

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- azure_resources: fix URL typo 'azure-resoures' -> 'azure-resources'
- sonarqube add-multiple: fix mock method POST -> PUT to match CLI
- config_file bad_url: update assertion for new friendly error message

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jeff-schnitter
jeff-schnitter merged commit a5239e6 into main Jul 23, 2026
4 checks passed
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.

1 participant