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

Update Terraform provider version to 2.53.1 #148

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hazim1093
Copy link

Description of your changes

Updated Terraform provider version to 2.53.1

I have:

  • Read and followed Crossplane's [contribution process].
  • Run make reviewable to ensure this PR is ready for review.
    make lint seems to fail on main as well for me

How has this code been tested

  • Ran make crddiff & make test locally
  • Ran an e2e test against a local environment
  • Uptest tests in the comments below:

@hazim1093
Copy link
Author

/test-examples="examples/app/v1beta1/roleassignment.yaml"

Copy link
Collaborator

@turkenf turkenf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @hazim1093, thank you for your contribution here.

As we discussed, I have prepared the upjet-v2.53.1 branch in our fork. We also need to update go.mod, please follow the steps below:

  • Run the following command to update our fork dependency
go mod edit -replace=github.com/hashicorp/terraform-provider-azuread=github.com/upbound/[email protected]
  • Run go mod tidy
  • Run make generate
  • And push the all changes

@hazim1093
Copy link
Author

Hi @turkenf,
I tried it out and after updating the dependency to the stated version, I am getting the following error:

17:40:29 [ .. ] go generate linux_amd64
# github.com/hashicorp/terraform-provider-azuread/internal/provider
../../../../go/pkg/mod/github.com/upbound/[email protected]/internal/provider/provider.go:303:49: not enough arguments in call to environments.FromEndpoint
        have (context.Context, string)
        want (context.Context, string, string)
apis/generate.go:25: running "go": exit status 1
17:40:32 [FAIL]
make[1]: *** [go.generate] Error 1
make: *** [generate] Error 2

@hazim1093
Copy link
Author

Hi @turkenf, did you get the time to look at this?

@hazim1093 hazim1093 requested a review from turkenf October 1, 2024 07:53
@turkenf
Copy link
Collaborator

turkenf commented Oct 4, 2024

Hi @hazim1093, I haven't had a chance to look at it yet due to priorities. When I can, I'll let you know. Thank you for your patience.

@erhancagirici
Copy link
Collaborator

@hazim1093 I was able to successfully run make generate. The error you get is due to outdated version of github.com/hashicorp/go-azure-sdk/sdk in go.mod. Strangely, go mod tidy did not handle that indirect dep update as it is. Tried to push the change to your branch, but I am not permitted, so here are the steps

as Fatih mentioned, replace terraform-provider-azuread dependency to the fork @upjet-v2.53.1 if not already in go.mod

go mod edit -replace=github.com/hashicorp/terraform-provider-azuread=github.com/upbound/[email protected]

open go.mod in your text editor, remove the line

github.com/hashicorp/go-azure-sdk v0.20231018.1171511 // indirect

then, run

go mod tidy

This correctly updates the version for go-azure-sdk dependency and generation succeeds when:

make generate

Hi @turkenf, I tried it out and after updating the dependency to the stated version, I am getting the following error:

17:40:29 [ .. ] go generate linux_amd64
# github.com/hashicorp/terraform-provider-azuread/internal/provider
../../../../go/pkg/mod/github.com/upbound/[email protected]/internal/provider/provider.go:303:49: not enough arguments in call to environments.FromEndpoint
        have (context.Context, string)
        want (context.Context, string, string)
apis/generate.go:25: running "go": exit status 1
17:40:32 [FAIL]
make[1]: *** [go.generate] Error 1
make: *** [generate] Error 2

Signed-off-by: Hazim <[email protected]>
(cherry picked from commit 0d86fec)
Signed-off-by: Hazim <[email protected]>
Signed-off-by: Hazim <[email protected]>
@hazim1093
Copy link
Author

Thanks @erhancagirici.
I've updated the go-azure-sdk/sdk as you mentioned, but I still the same errors during make lint.
make generate works fine, make reviewable fails due to lint failing.

@erhancagirici
Copy link
Collaborator

@hazim1093 can you provide me push access to your fork/branch or make the following changes?
First, please rebase the PR to the latest main.
while bumping go-azure-sdk/sdk seems like your commit also bumped the following. Those should stay like below:

k8s.io/apimachinery v0.29.4
k8s.io/client-go v0.29.4
sigs.k8s.io/controller-runtime v0.17.3

then go mod tidy. I am able to successfully build & lint & run tests.
If this does not work for you, please provide access and I can push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants