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 hcloud-csi-driver #6

Merged
merged 1 commit into from
Jan 22, 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
29 changes: 9 additions & 20 deletions internal/apply_manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
)

var (
//go:embed apply_manifests_hcloud_secret.yaml
hcloudSecretManifestTmpl string
//go:embed apply_manifests_hcloud_cloud_controller_manager.yaml
hcloudCloudControllerManagerManifestTmpl string
//go:embed apply_manifests_hcloud_csi_driver.yaml
Expand All @@ -33,36 +35,23 @@ func ApplyManifests(logger *utils.Logger, dir string, opts ApplyManifestsOpts) e
return err
}

hcloudCloudControllerManagerImage := "hetznercloud/hcloud-cloud-controller-manager:v1.9.1"
hcloudCloudControllerManagerManifest, err := utils.RenderTemplate(hcloudCloudControllerManagerManifestTmpl, map[string]interface{}{
"Secret": map[string]interface{}{
"Token": cl.Config.Hcloud.Token,
"Network": network.Name,
},
"CloudControllerManager": map[string]interface{}{
"Image": hcloudCloudControllerManagerImage,
"ImagePullPolicy": "IfNotPresent",
},
hcloudSecretManifest, err := utils.RenderTemplate(hcloudSecretManifestTmpl, map[string]interface{}{
"Token": cl.Config.Hcloud.Token,
"Network": network.Name,
})

hcloudCloudControllerManagerManifest, err := utils.RenderTemplate(hcloudCloudControllerManagerManifestTmpl, map[string]interface{}{})
if err != nil {
return err
}

hcloudCsiDriverImage := "hetznercloud/hcloud-csi-driver:1.6.0"
hcloudCsiDriverManifest, err := utils.RenderTemplate(hcloudCsiDriverManifestTmpl, map[string]interface{}{
"Secret": map[string]interface{}{
"Token": cl.Config.Hcloud.Token,
},
"CsiDriver": map[string]interface{}{
"Image": hcloudCsiDriverImage,
"ImagePullPolicy": "IfNotPresent",
},
})
hcloudCsiDriverManifest, err := utils.RenderTemplate(hcloudCsiDriverManifestTmpl, map[string]interface{}{})
if err != nil {
return err
}

manifestsConcatenated := [][]byte{}
manifestsConcatenated = append(manifestsConcatenated, []byte(hcloudSecretManifest))
if !opts.NoHcloudCloudControllerManager {
manifestsConcatenated = append(manifestsConcatenated, []byte(hcloudCloudControllerManagerManifest))
}
Expand Down
12 changes: 1 addition & 11 deletions internal/apply_manifests_hcloud_cloud_controller_manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ spec:
- key: "node.kubernetes.io/not-ready"
effect: "NoSchedule"
containers:
- image: "{{ .CloudControllerManager.Image }}"
imagePullPolicy: "{{ .CloudControllerManager.ImagePullPolicy }}"
- image: hetznercloud/hcloud-cloud-controller-manager:v1.9.1
name: hcloud-cloud-controller-manager
command:
- "/bin/hcloud-cloud-controller-manager"
Expand All @@ -84,12 +83,3 @@ spec:
secretKeyRef:
name: hcloud
key: network
---
apiVersion: v1
kind: Secret
metadata:
name: hcloud
namespace: kube-system
stringData:
token: "{{ .Secret.Token }}"
network: "{{ .Secret.Network }}"
Loading