Skip to content

fix: validate capability configuration before cluster creation - #8864

Open
atharvaHJoshi wants to merge 1 commit into
eksctl-io:mainfrom
atharvaHJoshi:fix/8701-awsidc-validation
Open

fix: validate capability configuration before cluster creation#8864
atharvaHJoshi wants to merge 1 commit into
eksctl-io:mainfrom
atharvaHJoshi:fix/8701-awsidc-validation

Conversation

@atharvaHJoshi

Copy link
Copy Markdown

Fixes #8701

What this PR does

Prevents a nil-pointer panic (SIGSEGV during eksctl create cluster) when an
invalid/misspelled AWS IDC configuration causes the ArgoCD AWSIDC field to remain
nil.

Root cause: config parsing performs a case-insensitive YAML unmarshal but re-decodes
case-sensitively via the Kubernetes serializer. A typo such as awsIDC (instead of
awsIdc) therefore leaves ArgoCD.AWSIDC nil, and the create-cluster path never ran
Capability.Validate(), so convertConfiguration dereferenced a nil pointer.

Changes

  • Validate cluster capabilities during cluster config validation
    (NewCreateClusterLoader).
  • Add a nil guard in capability conversion that returns an actionable error:
    awsIdc configuration is required for ARGOCD capability.
  • Add regression tests (render with AWSIDC set; clean error when missing).
  • While in configfile.go, also swap the deprecated reflect.Ptr alias for
    reflect.Pointer (fixes a golangci-lint govet finding).

Validation

  • go build ./...
  • golangci-lint run --timeout=30m ./pkg/...
  • go test ./pkg/cfn/...
  • go test ./pkg/ctl/cmdutils/...

Pre-existing, unrelated failures in pkg/info and pkg/iam/oidc are environmental
(kubectl/cfssl missing locally) and remain unchanged.

Signed-off-by: Atharva Joshi <josh.atharva2005@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

Hello atharvaHJoshi 👋 Thank you for opening a Pull Request in eksctl project. The team will review the Pull Request and aim to respond within 1-10 business days. Meanwhile, please read about the Contribution and Code of Conduct guidelines here. You can find out more information about eksctl on our website

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.

How to validate cluster.yaml?

1 participant