rancher / terraform-provider-rancher2

Terraform Rancher2 provider
https://www.terraform.io/docs/providers/rancher2/
Mozilla Public License 2.0
253 stars 218 forks source link

Use dl.k8s.io for getting kubectl #1256

Closed superseb closed 7 months ago

superseb commented 8 months ago

Issue: https://github.com/rancher/terraform-provider-rancher2/issues/1260

Problem

Preparing for GCS bucket deprecation at some point (https://github.com/kubernetes/k8s.io/issues/2396)

Solution

Change to the currently documented source

Testing

Using start_testacc.sh

Engineering Testing

Manual Testing

Automated Testing

QA Testing Considerations

Regressions Considerations

a-blender commented 8 months ago

@superseb Hey is this ready for review? Is there a linked issue? Any thoughts on the scope of testing this issue... I'm not entirely sure when/how the TF provider uses kubectl. It uses a token to access the Rancher API client and accesses downstream resources that way.

superseb commented 8 months ago

According to the script it is being used here https://github.com/rancher/terraform-provider-rancher2/blob/master/scripts/start_testacc.sh#L185.

I had two Drone builds being killed so I left it but will create the corresponding issue but this is the same as the one for terraform-provider-rke.

superseb commented 8 months ago

@a-blender There seems to be no reference to this file anywhere, can we just remove it instead?

a-blender commented 8 months ago

@superseb Not entirely sure, running make testacc runs the infrastructure tests but right now it continuously tries to create a k3s cluster without being fully successful .

+++ /Users/annablendermann/.rd/bin/docker run -i --rm curlimages/curl -sk https://172.17.0.2:6443/ping
+++ echo starting rancher k3s cluster
++ k3s_ready='starting rancher k3s cluster'
++ '[' 'starting rancher k3s cluster' '!=' pong ']'
++ sleep 5

I think tf will need KUBECTL_URL to download the kubectl binary to access the cluster if it doesn't already exist. I'd probably just update it for now.

Is that what you were referring to?

superseb commented 8 months ago

My point is that scripts/start_testacc.sh is not referenced anymore in the code. The reference to it was removed a long time ago here.

Unless there is an external dependency that uses is, or if there is a case to keep it, I would remove it to clean the codebase from unused scripts.