-
Notifications
You must be signed in to change notification settings - Fork 4.5k
awscdk-kubectl-go: Does not compile with latest cdk - "duplicate method Env" #37405
Copy link
Copy link
Open
cdklabs/awscdk-asset-kubectl
#2713Labels
aws-cdk-libRelated to the aws-cdk-lib packageRelated to the aws-cdk-lib packagebugThis issue is a bug.This issue is a bug.p0potential-regressionMarking this issue as a potential regression to be checked by team memberMarking this issue as a potential regression to be checked by team member
Description
Describe the bug
Hi, it seems kubectl-go needs to be updated to support the latest CDK, could you check?
Related: #36060
==> go.mod <==
module poc
go 1.26.1
require (
github.com/aws/aws-cdk-go/awscdk/v2 v2.245.0
github.com/aws/constructs-go/constructs/v10 v10.5.1
github.com/aws/jsii-runtime-go v1.127.0
github.com/cdklabs/awscdk-kubectl-go/kubectlv35/v2 v2.2.0
)
==> main.go <==
package main
import (
"github.com/aws/aws-cdk-go/awscdk/v2"
"github.com/aws/constructs-go/constructs/v10"
"github.com/aws/jsii-runtime-go"
kubectlv35 "github.com/cdklabs/awscdk-kubectl-go/kubectlv35/v2"
)
func main() {
app := awscdk.NewApp(nil)
stack := awscdk.NewStack(app, jsii.String("poc"), nil)
_ = kubectlv35.NewKubectlV35Layer(stack, jsii.String("kubectl"))
_ = constructs.NewConstruct(stack, jsii.String("c"))
app.Synth(nil)
}Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Library Version
v2.223.0
Expected Behavior
Builds fine
Current Behavior
Doesn't build
/tmp/kubectlv35-poc$ go mod tidy && go build .
# github.com/cdklabs/awscdk-kubectl-go/kubectlv35/v2
/home/.../go/pkg/mod/github.com/cdklabs/awscdk-kubectl-go/kubectlv35/v2@v2.2.0/KubectlV35Layer.go:16:2: duplicate method Env
/home/.../go/pkg/mod/github.com/cdklabs/awscdk-kubectl-go/kubectlv35/v2@v2.2.0/KubectlV35Layer.go:29:2: other declaration of method Env
/home/.../go/pkg/mod/github.com/cdklabs/awscdk-kubectl-go/kubectlv35/v2@v2.2.0/KubectlV35Layer.go:29:16: undefined: awscdk.ResourceEnvironment
/home/.../go/pkg/mod/github.com/cdklabs/awscdk-kubectl-go/kubectlv35/v2@v2.2.0/KubectlV35Layer.go:106:51: undefined: awscdk.ResourceEnvironment
/home/.../go/pkg/mod/github.com/cdklabs/awscdk-kubectl-go/kubectlv35/v2@v2.2.0/KubectlV35Layer.go:107:22: undefined: awscdk.ResourceEnvironmentReproduction Steps
Se POC above.
Possible Solution
I haven't checked the code in question, but type aliases and/or getting KubectlV3xLayer.go to use interfaces.ResourceEnvironment instead of awscdk.ResourceEnvironment, and renaming/removing the duplicate Env() might be relevant.
Additional Information/Context
No response
AWS CDK Library version (aws-cdk-lib)
v2.245.0
AWS CDK CLI version
N/A
Node.js Version
N/A
OS
Linux
Language
Go
Language Version
1.26.1
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
aws-cdk-libRelated to the aws-cdk-lib packageRelated to the aws-cdk-lib packagebugThis issue is a bug.This issue is a bug.p0potential-regressionMarking this issue as a potential regression to be checked by team memberMarking this issue as a potential regression to be checked by team member