Skip to content

ClusterAPI Provider AWS v2.8.2 incompatible with Controller Runtime v0.20.4 #5446

@Archisman-Mridha

Description

@Archisman-Mridha

/kind bug

What steps did you take and what happened:

I am using both ClusterAPI Provider AWS and Controller Runtime in a Go project.

When I do go mod tidy, it runs successfully and this gets added to my go.mod file :

	sigs.k8s.io/cluster-api-provider-aws/v2 v2.8.2
	sigs.k8s.io/controller-runtime v0.20.4

However, an unexpected error gets thrown while I try to run the Go project :

# sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2
../../../go/pkg/mod/sigs.k8s.io/cluster-api-provider-aws/[email protected]/api/v1beta2/awscluster_webhook.go:54:12: undefined: webhook.Validator
../../../go/pkg/mod/sigs.k8s.io/cluster-api-provider-aws/[email protected]/api/v1beta2/awscluster_webhook.go:55:12: undefined: webhook.Defaulter
../../../go/pkg/mod/sigs.k8s.io/cluster-api-provider-aws/[email protected]/api/v1beta2/awsclustercontrolleridentity_webhook.go:46:12: undefined: webhook.Validator
../../../go/pkg/mod/sigs.k8s.io/cluster-api-provider-aws/[email protected]/api/v1beta2/awsclustercontrolleridentity_webhook.go:47:12: undefined: webhook.Defaulter
../../../go/pkg/mod/sigs.k8s.io/cluster-api-provider-aws/[email protected]/api/v1beta2/awsclusterroleidentity_webhook.go:44:12: undefined: webhook.Validator
../../../go/pkg/mod/sigs.k8s.io/cluster-api-provider-aws/[email protected]/api/v1beta2/awsclusterroleidentity_webhook.go:45:12: undefined: webhook.Defaulter
../../../go/pkg/mod/sigs.k8s.io/cluster-api-provider-aws/[email protected]/api/v1beta2/awsclusterstaticidentity_webhook.go:44:12: undefined: webhook.Validator
../../../go/pkg/mod/sigs.k8s.io/cluster-api-provider-aws/[email protected]/api/v1beta2/awsclusterstaticidentity_webhook.go:45:12: undefined: webhook.Defaulter
../../../go/pkg/mod/sigs.k8s.io/cluster-api-provider-aws/[email protected]/api/v1beta2/awsclustertemplate_webhook.go:38:15: undefined: webhook.Defaulter
../../../go/pkg/mod/sigs.k8s.io/cluster-api-provider-aws/[email protected]/api/v1beta2/awsclustertemplate_webhook.go:39:15: undefined: webhook.Validator
../../../go/pkg/mod/sigs.k8s.io/cluster-api-provider-aws/[email protected]/api/v1beta2/awsclustertemplate_webhook.go:39:15: too many errors

What did you expect to happen:

I expected :

  • either go mod tidy to error out complaining about incompatible depenedency versions.
  • or the Go project to run properly, since go mod tidy ran successfully.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

The error most probably occurs because of this merged PR : ⚠️ : (go/v4): Replace usage of deprecated webhook.Validator and webhook.Defaulter interfaces in the kubebuilder repository.

Currently, I have added the following in my go.mod file :

replace (
	sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.19.6
)

It'll be nice, if you guys warn users about this somewhere in the README.

Environment:

  • Cluster-api-provider-aws version: v2.8.2
  • GoLang version : 1.24.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.needs-priorityneeds-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions