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

Fix EKS autoMode preview with unknown values #1603

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

flostadler
Copy link
Contributor

The diff customizer of the upstream provider is not taking possibly unknown values into account (see https://github.com/hashicorp/terraform-provider-aws/blob/ae93494f39ba70fe442e891caf05f8df21bde1ac/internal/service/eks/cluster.go#L1776-L1791), which causes failures like this one:

* compute_config.enabled, kubernetes_networking_config.elastic_load_balancing.enabled, and storage_config.block_storage.enabled must all be set to either true or false

This happens because unknown attributes just default to their empty values in a diff customizer if they're unknown .

This change acts a hot fix until we can properly fix upstream's behavior here. The current diff for auto mode is quite broken and needs some more involved fixes (see hashicorp/terraform-provider-aws#40582).

Fixes #1597

@flostadler flostadler requested review from t0yv0, corymhall and a team January 28, 2025 18:43
@flostadler flostadler self-assigned this Jan 28, 2025
Copy link

github-actions bot commented Jan 28, 2025

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Maintainer note: consult the runbook for dealing with any breaking changes.

// Make all eks auto mode options depend on the other options to ensure
// that they're all either known or unknown when auto mode is enabled.
const autoModeConfig =
args.autoMode?.enabled && computeConfig && storageConfig && kubernetesNetworkConfig
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof.

The upstream EKS cluster resource requires that all auto mode settings
are either enabled or disabled and does not handle unknown values.
Make all eks auto mode options depend on the other options to ensure
that they're all either known or unknown when auto mode is enabled.
@flostadler flostadler force-pushed the flostadler/auto-mode-preview branch from cf3540c to b23ce14 Compare January 29, 2025 08:38
Copy link

codecov bot commented Jan 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (e2e7a7a) to head (b23ce14).
Report is 1 commits behind head on master.

Additional details and impacted files
@@          Coverage Diff           @@
##           master   #1603   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files           1       1           
  Lines        2804    2804           
======================================
  Misses       2804    2804           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@flostadler flostadler merged commit 8800ecb into master Jan 29, 2025
45 checks passed
@flostadler flostadler deleted the flostadler/auto-mode-preview branch January 29, 2025 10:17
@pulumi-bot
Copy link
Contributor

This PR has been shipped in release v3.8.1.

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.

EKS auto mode with ComputeConfig set yields terraform error
3 participants