Scenario 2: Role Assignment Flags with --infra-json (--assign-custom-hcp-roles)

Objective: Verify that --assign-custom-hcp-roles is also caught by the same infra-json conflict validation.

Result: PASS — Same error as Scenario 1, confirming both role flags are validated.

Command

$ hypershift create cluster azure \
    --name test-s2 \
    --azure-creds creds.yaml \
    --infra-json infra.json \
    --assign-custom-hcp-roles \
    --pull-secret pull-secret.json \
    --release-image quay.io/openshift-release-dev/ocp-release:4.18.0-x86_64 \
    --workload-identities-file wi.json \
    --render --render-into /dev/null

Full Output

{"level":"error","ts":"2026-06-17T10:30:17-04:00","msg":"Failed to create cluster","error":"role assignment flags cannot be used with --infra-json; use --assign-identity-roles on 'create infra azure' instead","stacktrace":"github.com/openshift/hypershift/cmd/cluster/azure.NewCreateCommand.func1
	/Users/brcox/bryan-cox/hypershift_ws/hypershift-worktrees/OCPBUGS-84239/cmd/cluster/azure/create.go:64
github.com/spf13/cobra.(*Command).execute
	/Users/brcox/bryan-cox/hypershift_ws/hypershift-worktrees/OCPBUGS-84239/vendor/github.com/spf13/cobra/command.go:1015
github.com/spf13/cobra.(*Command).ExecuteC
	/Users/brcox/bryan-cox/hypershift_ws/hypershift-worktrees/OCPBUGS-84239/vendor/github.com/spf13/cobra/command.go:1148
github.com/spf13/cobra.(*Command).Execute
	/Users/brcox/bryan-cox/hypershift_ws/hypershift-worktrees/OCPBUGS-84239/vendor/github.com/spf13/cobra/command.go:1071
github.com/spf13/cobra.(*Command).ExecuteContext
	/Users/brcox/bryan-cox/hypershift_ws/hypershift-worktrees/OCPBUGS-84239/vendor/github.com/spf13/cobra/command.go:1064
main.main
	/Users/brcox/bryan-cox/hypershift_ws/hypershift-worktrees/OCPBUGS-84239/main.go:80
runtime.main
	/opt/homebrew/Cellar/go/1.26.0/libexec/src/runtime/proc.go:290"}
Error: role assignment flags cannot be used with --infra-json; use --assign-identity-roles on 'create infra azure' instead
role assignment flags cannot be used with --infra-json; use --assign-identity-roles on 'create infra azure' instead

Exit code: 1

Verification

CheckResult
Command exits with non-zero codePASS — Exit code: 1
Same error as Scenario 1PASSrole assignment flags cannot be used with --infra-json
← Scenario 1 Scenario 3 →