Skip to content

[Bug] utils update-authentication-mode fails on no-op updates (Unsupported authentication mode update from X to X) #8903

Open

Description

@wind0r

What were you trying to accomplish?

Re-run eksctl utils update-authentication-mode -f cluster.yml against a cluster whose authentication mode already matches the config file (idempotent re-runs from CI / GitOps pipelines).

What happened?

The command fails hard because it calls UpdateClusterConfig unconditionally, and the EKS API rejects an update where the target mode equals the current mode:

[ℹ]  setting cluster's authentication mode to
Error: failed to update cluster config: operation error EKS: UpdateClusterConfig,
https response error StatusCode: 400, InvalidParameterException:
Unsupported authentication mode update from API_AND_CONFIG_MAP to API_AND_CONFIG_MAP

Note the log line is also broken: setting cluster's authentication mode to prints the --authentication-mode flag value, which is empty when the mode comes from a config file via -f, instead of the mode resolved from the cluster config.

How to reproduce it?

  1. Have a cluster with accessConfig.authenticationMode: API_AND_CONFIG_MAP.
  2. Put the same mode in cluster.yml.
  3. Run eksctl utils update-authentication-mode -f cluster.yml → exits non-zero with the error above.

Expected behavior

When the cluster's authentication mode already equals the desired mode, log something like authentication mode is already API_AND_CONFIG_MAP on cluster X, skipping update and exit 0. The "setting cluster's authentication mode to %s" log should print the actual mode being sent to the API.

Versions

Present on current main (pkg/ctl/utils/update_authentication_mode.go, doUpdateAuthenticationMode).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions