diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c111775ca55a99ec792a336221e20dbbfdbe0d67..333d40cf7b87fafedebbcdaf03c38bcb4deffc7c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,8 +32,6 @@ test:lint: test:unit: stage: test image: golang:1.21 - variables: - NODE_NAME: "test" script: - go test ./... -v diff --git a/chart/values.yaml b/chart/values.yaml index ae7197c7ba69d99f8710fa635fa15c52bec56659..c7fc4518fa881cf57a27e87f349c0b3dae8a1d4d 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -29,10 +29,6 @@ env: secretKeyRef: name: hcloud key: token - NODE_NAME: - valueFrom: - fieldRef: - fieldPath: spec.nodeName image: repository: hetznercloud/hcloud-cloud-controller-manager diff --git a/deploy/ccm-networks.yaml b/deploy/ccm-networks.yaml index 5f7ff36a0756e0131544ca87de8a8ff3c0bb9c5b..b227a2a36130463acdde384ab74c880caa4b3c66 100644 --- a/deploy/ccm-networks.yaml +++ b/deploy/ccm-networks.yaml @@ -75,10 +75,6 @@ spec: secretKeyRef: key: token name: hcloud - - name: NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - name: HCLOUD_NETWORK valueFrom: secretKeyRef: diff --git a/deploy/ccm.yaml b/deploy/ccm.yaml index f8bd00c3c4b17a45619a4fb9b72f1abed5b3bf5e..60c38d78c807cc6ca6b5bade94be9b54bcc630f6 100644 --- a/deploy/ccm.yaml +++ b/deploy/ccm.yaml @@ -72,10 +72,6 @@ spec: secretKeyRef: key: token name: hcloud - - name: NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName image: hetznercloud/hcloud-cloud-controller-manager:v1.18.0 # x-release-please-version ports: - name: metrics diff --git a/hcloud/cloud.go b/hcloud/cloud.go index 1eb8105d0ad9b2cf1c5075849afd508420774009..d655382000c2140e72c854dff7563154bb99155c 100644 --- a/hcloud/cloud.go +++ b/hcloud/cloud.go @@ -51,7 +51,6 @@ const ( hcloudLoadBalancersDisableIPv6 = "HCLOUD_LOAD_BALANCERS_DISABLE_IPV6" hcloudMetricsEnabledENVVar = "HCLOUD_METRICS_ENABLED" hcloudMetricsAddress = ":8233" - nodeNameENVVar = "NODE_NAME" providerName = "hcloud" ) @@ -76,10 +75,6 @@ func newCloud(_ io.Reader) (cloudprovider.Interface, error) { if len(token) != 64 { return nil, fmt.Errorf("entered token is invalid (must be exactly 64 characters long)") } - nodeName := os.Getenv(nodeNameENVVar) - if nodeName == "" { - return nil, fmt.Errorf("environment variable %q is required", nodeNameENVVar) - } opts := []hcloud.ClientOption{ hcloud.WithToken(token), diff --git a/hcloud/cloud_test.go b/hcloud/cloud_test.go index e04f6b1b95b0bad9eadb3e17d5e2ec79dca32d65..0b69fc1809771cd4bc6f9ad18abb268d025621c2 100644 --- a/hcloud/cloud_test.go +++ b/hcloud/cloud_test.go @@ -68,7 +68,6 @@ func TestNewCloud(t *testing.T) { resetEnv := Setenv(t, "HCLOUD_ENDPOINT", env.Server.URL, "HCLOUD_TOKEN", "jr5g7ZHpPptyhJzZyHw2Pqu4g9gTqDvEceYpngPf79jN_NOT_VALID_dzhepnahq", - "NODE_NAME", "test", "HCLOUD_METRICS_ENABLED", "false", ) defer resetEnv() @@ -104,7 +103,6 @@ func TestNewCloudConnectionNotPossible(t *testing.T) { resetEnv := Setenv(t, "HCLOUD_ENDPOINT", "http://127.0.0.1:4711/v1", "HCLOUD_TOKEN", "jr5g7ZHpPptyhJzZyHw2Pqu4g9gTqDvEceYpngPf79jN_NOT_VALID_dzhepnahq", - "NODE_NAME", "test", "HCLOUD_METRICS_ENABLED", "false", ) defer resetEnv() @@ -121,7 +119,6 @@ func TestNewCloudInvalidToken(t *testing.T) { resetEnv := Setenv(t, "HCLOUD_ENDPOINT", env.Server.URL, "HCLOUD_TOKEN", "jr5g7ZHpPptyhJzZyHw2Pqu4g9gTqDvEceYpngPf79jN_NOT_VALID_dzhepnahq", - "NODE_NAME", "test", "HCLOUD_METRICS_ENABLED", "false", ) defer resetEnv() @@ -149,7 +146,6 @@ func TestCloud(t *testing.T) { resetEnv := Setenv(t, "HCLOUD_ENDPOINT", env.Server.URL, "HCLOUD_TOKEN", "jr5g7ZHpPptyhJzZyHw2Pqu4g9gTqDvEceYpngPf79jN_NOT_VALID_dzhepnahq", - "NODE_NAME", "test", "HCLOUD_METRICS_ENABLED", "false", ) defer resetEnv()