Skip to content

Go compile error with kubectlv34 when upgrading EKS to 1.34 using CDK v2.233.0 #2503

@markus-rateboard

Description

@markus-rateboard

When upgrading an EKS cluster from Kubernetes 1.33 → 1.34 in a Go-based AWS CDK project, compilation fails when using the kubectlv34 asset.

This occurs after upgrading to the latest AWS CDK and switching to the new Kubernetes 1.34 helpers.

Environment

  • Language: Go
  • AWS CDK: github.com/aws/aws-cdk-go/awscdk/v2 v2.233.0
  • EKS Kubernetes version: awseks.KubernetesVersion_V1_34()
  • Kubectl asset: github.com/cdklabs/awscdk-kubectl-go/kubectlv34/v2 v2.0.0

What I did

  • Upgraded AWS CDK to v2.233.0
  • Updated EKS cluster version to: awseks.KubernetesVersion_V1_34()
  • Updated kubectl layer import: github.com/cdklabs/awscdk-kubectl-go/kubectlv34/v2
  • Ran go build

Expected behavior:

The project should compile successfully, similar to previous Kubernetes versions (e.g. kubectlv33).

Actual behavior

Compilation fails with the following errors:

# github.com/cdklabs/awscdk-kubectl-go/kubectlv34/v2
KubectlV34Layer.go:15:2: duplicate method Env
KubectlV34Layer.go:26:2: other declaration of method Env
KubectlV34Layer.go:26:16: undefined: awscdk.ResourceEnvironment
KubectlV34Layer.go:93:51: undefined: awscdk.ResourceEnvironment
KubectlV34Layer.go:94:22: undefined: awscdk.ResourceEnvironment

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