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

Add multiple SSH keys support for Hetzner #14058

Merged
merged 1 commit into from
Jul 29, 2022

Conversation

hakman
Copy link
Member

@hakman hakman commented Jul 29, 2022

No description provided.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. area/provider/hetzner Issues or PRs related to Hetzner provider labels Jul 29, 2022
@@ -33,6 +34,24 @@ type ServerGroupModelBuilder struct {
var _ fi.ModelBuilder = &ServerGroupModelBuilder{}

func (b *ServerGroupModelBuilder) Build(c *fi.ModelBuilderContext) error {
var sshkeyTasks []*hetznertasks.SSHKey
for _, sshkey := range b.SSHPublicKeys {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: If you have two ServerGroupModelBuilders, with overlapping SSHPublicKeys, this may result in duplicate tasks. So you might want to consider keeping the dedicated SSHPublicKeyBuilder task, or using EnsureTask (which allows for duplicate creation if they are identical, but is a bit more hacky). But not a blocker!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ServerGroupModelBuilder creates servers for all instance groups, so there is no need for using EnsureTask at the moment.

@@ -33,7 +33,7 @@ import (
type ServerGroup struct {
Name *string
Lifecycle fi.Lifecycle
SSHKey *SSHKey
SSHKeys []*SSHKey
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we set this anywhere? I didn't see if in the diff, which is surprising (?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't set this anywhere, except for model. They are used only when creating a new server and otherwise ignored.
Hetzner Cloud API doesn't return the keys for a running server.

@justinsb
Copy link
Member

/approve
/lgtm

Looks good to me, but you might want to keep the SSH-specific builder to avoid duplicate tasks. So I'll add a hold but feel free to cancel the hold if the potentially duplicate tasks aren't a problem in practice!

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 29, 2022
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 29, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 29, 2022
@hakman
Copy link
Member Author

hakman commented Jul 29, 2022

Looks good to me, but you might want to keep the SSH-specific builder to avoid duplicate tasks. So I'll add a hold but feel free to cancel the hold if the potentially duplicate tasks aren't a problem in practice!

I need an easy way to access the SSHKey tasks. As they are only used for creating servers, seems the best approach for now.

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 29, 2022
@hakman hakman force-pushed the hetzner_ssh_keys branch from 61ba8dc to 1cf3e5f Compare July 29, 2022 13:21
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 29, 2022
@hakman
Copy link
Member Author

hakman commented Jul 29, 2022

Rebasing to get over merge conflict with #14034.

@rifelpet
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 29, 2022
@k8s-ci-robot k8s-ci-robot merged commit 921eadd into kubernetes:master Jul 29, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.25 milestone Jul 29, 2022
k8s-ci-robot added a commit that referenced this pull request Jul 29, 2022
…14057-#14058-upstream-release-1.24

Automated cherry pick of #14034: Enable rolling updates for Hetzner
#14057: Wait for load balancer to be ready for Hetzner
#14058: Add multiple SSH keys support for Hetzner
@hakman hakman deleted the hetzner_ssh_keys branch August 31, 2022 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/hetzner Issues or PRs related to Hetzner provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants