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

feat: remove unused variable NODE_NAME #545

Merged
merged 1 commit into from
Oct 25, 2023
Merged
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
2 changes: 0 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ test:lint:
test:unit:
stage: test
image: golang:1.21
variables:
NODE_NAME: "test"
script:
- go test ./... -v

Expand Down
4 changes: 0 additions & 4 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ env:
secretKeyRef:
name: hcloud
key: token
NODE_NAME:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
jooola marked this conversation as resolved.
Show resolved Hide resolved

image:
repository: hetznercloud/hcloud-cloud-controller-manager
Expand Down
4 changes: 0 additions & 4 deletions deploy/ccm-networks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ spec:
secretKeyRef:
key: token
name: hcloud
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: HCLOUD_NETWORK
valueFrom:
secretKeyRef:
Expand Down
4 changes: 0 additions & 4 deletions deploy/ccm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions hcloud/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const (
hcloudLoadBalancersDisableIPv6 = "HCLOUD_LOAD_BALANCERS_DISABLE_IPV6"
hcloudMetricsEnabledENVVar = "HCLOUD_METRICS_ENABLED"
hcloudMetricsAddress = ":8233"
nodeNameENVVar = "NODE_NAME"
providerName = "hcloud"
)

Expand All @@ -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),
Expand Down
4 changes: 0 additions & 4 deletions hcloud/cloud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
Loading