From ceebb28d58b3a52827ac385c6d89fdb3a7f0dce9 Mon Sep 17 00:00:00 2001 From: Abhishek Dalbanjan Date: Wed, 1 Jul 2026 11:35:21 +0530 Subject: [PATCH] Fix resolving 'latest' version in addon update When updating an addon with 'version: latest', eksctl successfully resolved the latest version for the AWS API payload, but forgot to update the internal addon struct. This caused subsequent policy lookups to fail because they still used 'latest' instead of the resolved version. This commit updates the internal struct with the resolved version to fix the error. Fixes #7841 Signed-off-by: Abhishek Dalbanjan --- pkg/actions/addon/update.go | 1 + pkg/actions/addon/update_test.go | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/actions/addon/update.go b/pkg/actions/addon/update.go index c15e82edda..987ad23f3f 100644 --- a/pkg/actions/addon/update.go +++ b/pkg/actions/addon/update.go @@ -74,6 +74,7 @@ func (a *Manager) Update(ctx context.Context, addon *api.Addon, podIdentityIAMUp logger.Info("new version provided %s", latestVersion) } updateAddonInput.AddonVersion = &latestVersion + addon.Version = latestVersion } var deleteServiceAccountIAMResources []string diff --git a/pkg/actions/addon/update_test.go b/pkg/actions/addon/update_test.go index adc336b293..93d69f0da6 100644 --- a/pkg/actions/addon/update_test.go +++ b/pkg/actions/addon/update_test.go @@ -182,10 +182,11 @@ var _ = Describe("Update", func() { When("the version is set to latest", func() { It("discovers and uses the latest available version", func() { - err := addonManager.Update(context.Background(), &api.Addon{ + addonObj := &api.Addon{ Name: "my-addon", Version: "latest", - }, &podIdentityIAMUpdater, 0) + } + err := addonManager.Update(context.Background(), addonObj, &podIdentityIAMUpdater, 0) Expect(err).NotTo(HaveOccurred()) Expect(*describeAddonInput.ClusterName).To(Equal("my-cluster")) @@ -194,6 +195,7 @@ var _ = Describe("Update", func() { Expect(*updateAddonInput.AddonName).To(Equal("my-addon")) Expect(*updateAddonInput.AddonVersion).To(Equal("v1.7.7-eksbuild.2")) Expect(*updateAddonInput.ServiceAccountRoleArn).To(Equal("original-arn")) + Expect(addonObj.Version).To(Equal("v1.7.7-eksbuild.2")) }) })