Skip to content

attestation add fails if the default organization is different than the one provided explicitly #2822

@migmartri

Description

@migmartri

When running att init --org X followed by att add (or other subcommands), the org from the init is lost because subsequent commands connect to the control plane using the default org from the CLI config file rather than the one stored in the attestation crafting state.

The root cause is that the gRPC connection is established during PersistentPreRunE using the org from the config/viper, but the org chosen at init time is only stored in the local crafting state file — and nothing reads it back for subsequent commands.

Steps to reproduce

  1. Have two orgs, e.g. org1 (default) and org2
  2. Run:
    chainloop att init --org org2
    chainloop att add --org org2   # fails with "workflow run not found"
    

Expected behavior

Subsequent attestation commands should automatically pick up the org from the local crafting state so the gRPC connection targets the correct org.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions