Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix eks cluster conversion for Server Side Apply #1669

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion config/eks/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package eks

import (
"github.com/crossplane/upjet/pkg/config"

"github.com/upbound/provider-aws/config/common"
)

Expand Down
16 changes: 14 additions & 2 deletions config/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,26 @@ func configureSingletonListAPIConverters(r *config.Resource) error {
// no need for a Terraform conversion.
r.ControllerReconcileVersion = currentVer

var opts []conversion.SingletonListConversionOption
if r.Name == "aws_eks_cluster" {
opts = append(opts, conversion.WithConvertOptions(&conversion.ConvertOptions{
ListInjectKeys: map[string]conversion.SingletonListInjectKey{
"vpcConfig": {
Key: "index",
Value: "0",
},
},
}))
}

// assumes the first element is the identity conversion from
// the default resource and removes it because we will register another
// identity converter below.
r.Conversions = r.Conversions[1:]
r.Conversions = append([]conversion.Conversion{
conversion.NewIdentityConversionExpandPaths(conversion.AllVersions, conversion.AllVersions, conversion.DefaultPathPrefixes(), r.CRDListConversionPaths()...),
conversion.NewSingletonListConversion(conversion.AllVersions, bumped, conversion.DefaultPathPrefixes(), r.CRDListConversionPaths(), conversion.ToEmbeddedObject),
conversion.NewSingletonListConversion(bumped, conversion.AllVersions, conversion.DefaultPathPrefixes(), r.CRDListConversionPaths(), conversion.ToSingletonList),
conversion.NewSingletonListConversion(conversion.AllVersions, bumped, conversion.DefaultPathPrefixes(), r.CRDListConversionPaths(), conversion.ToEmbeddedObject, opts...),
conversion.NewSingletonListConversion(bumped, conversion.AllVersions, conversion.DefaultPathPrefixes(), r.CRDListConversionPaths(), conversion.ToSingletonList, opts...),
}, r.Conversions...)

return nil
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -442,3 +442,5 @@ require (
replace github.com/hashicorp/terraform-plugin-log => github.com/gdavison/terraform-plugin-log v0.0.0-20230928191232-6c653d8ef8fb

replace github.com/hashicorp/terraform-provider-aws => github.com/upbound/terraform-provider-aws v0.0.0-20250109090836-986571bdb591

replace github.com/crossplane/upjet => /Users/hasanturken/Workspace/upbound/upjet
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,6 @@ github.com/crossplane/crossplane-runtime v1.17.0 h1:y+GvxPT1M9s8BKt2AeZJdd2d6pg2
github.com/crossplane/crossplane-runtime v1.17.0/go.mod h1:vtglCrnnbq2HurAk9yLHa4qS0bbnCxaKL7C21cQcB/0=
github.com/crossplane/crossplane-tools v0.0.0-20230925130601-628280f8bf79 h1:HigXs5tEQxWz0fcj8hzbU2UAZgEM7wPe0XRFOsrtF8Y=
github.com/crossplane/crossplane-tools v0.0.0-20230925130601-628280f8bf79/go.mod h1:+e4OaFlOcmr0JvINHl/yvEYBrZawzTgj6pQumOH1SS0=
github.com/crossplane/upjet v1.4.1-0.20250130134024-ce71033d450f h1:4BLOlbc9bY0HDhL+2oGuKQ03gdGs1+sgd8ioP1RbXW8=
github.com/crossplane/upjet v1.4.1-0.20250130134024-ce71033d450f/go.mod h1:F2u9XwKNzxM+myfS1Opjnc6a5E1N2PC7Mytbkavawvs=
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
github.com/dave/jennifer v1.4.1 h1:XyqG6cn5RQsTj3qlWQTKlRGAyrTcsk1kUmWdZBzRjDw=
Expand Down
14 changes: 10 additions & 4 deletions internal/clients/zz_partitions_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading