Skip to content

Commit 623f05a

Browse files
committed
added comment: we create up to three times the HLCOUD_KEY in the secret.
1 parent 343c68d commit 623f05a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

api/v1beta1/types.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,11 @@ type HetznerSecretRef struct {
122122
// HetznerSecretKeyRef defines the key name of the HetznerSecret.
123123
// Need to specify either HCloudToken or both HetznerRobotUser and HetznerRobotPassword.
124124
type HetznerSecretKeyRef struct {
125-
// HCloudToken defines the name of the key where the token for the Hetzner Cloud API is stored.
126-
// We recommend to use "token", because this is the default of upstream hcloud-ccm.
125+
// hcloudToken defines the name of the key where the token for the Hetzner Cloud API is stored.
126+
// We recommend to use "token", because this is the default of upstream hcloud-ccm, while the
127+
// legacy Syself ccm uses "hcloud". For maximal compatibility up to three keys get created in the
128+
// secret for HCLOUD_TOKEN: "hcloud", "token" and the value of hcloudToken. This way we ensure
129+
// that the ccm in the wl-cluster finds the secret.
127130
//
128131
// +optional
129132
// +kubebuilder:default=token

controllers/hetznercluster_controller.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,10 @@ func reconcileWorkloadClusterSecrets(ctx context.Context, clusterScope *scope.Cl
533533
return reconcile.Result{}, nil
534534
}
535535

536+
// reconcileOneWorkloadClusterSecret creates/updates the secret in the wl-cluster. For maximal
537+
// compatibility up to three keys get created in the secret for HCLOUD_TOKEN: "hcloud", "token" and
538+
// the value of HetznerCluster.Spec.HetznerSecret.Key.HCloudToken. See docstring of
539+
// HetznerCluster.Spec.HetznerSecret.Key.HCloudToken.
536540
func reconcileOneWorkloadClusterSecret(ctx context.Context, clusterScope *scope.ClusterScope, wlClient client.Client, name string) error {
537541
wlSecret := &corev1.Secret{
538542
ObjectMeta: metav1.ObjectMeta{

0 commit comments

Comments
 (0)