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: add labels options to server and ssh key #92

Closed
wants to merge 1 commit into from

Conversation

janiskemper
Copy link
Contributor

Adding labels to the temporary server and ssh key objects which are needed to create the snapshot.

This is needed in some use cases where e.g. packer build stops unexpectedly due to a SIGKILL and cannot shut down properly. In order to realize that the respective server and ssh key are orphaned, labels are needed.

@janiskemper janiskemper requested a review from a team as a code owner October 23, 2023 13:54
@hashicorp-cla

This comment was marked as outdated.

@janiskemper janiskemper marked this pull request as draft October 23, 2023 13:54
@janiskemper
Copy link
Contributor Author

is this something that has a chance to get merged? If so, I will continue working on it and include unit tests

Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

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

@janiskemper this is off to a good start and will get merged in when ready and the CLA has been signed. I left a small suggestion but otherwise this is looking good already. Thanks!

builder/hcloud/config.go Outdated Show resolved Hide resolved
@nywilken
Copy link
Contributor

Hi @janiskemper just a heads up in the next few days we will start the process of transferring this repo out of HashiCorp to the integrations team at Hetzner Cloud. Your PR will get transferred along with the repo if not merged before then. This message is meant to just inform. Please feel free to take the time you need to get this PR ready.

@janiskemper
Copy link
Contributor Author

thanks for the heads up! I am already in contact with the Hetzner team that warned me after they saw I created this PR!

Adding labels to the temporary server and ssh key objects which are
needed to create the snapshot.

This is needed in some use cases where e.g. packer build stops
unexpectedly due to a SIGKILL and cannot shut down properly. In order to
realize that the respective server and ssh key are orphaned, labels are needed.

Signed-off-by: janiskemper <[email protected]>
@janiskemper janiskemper marked this pull request as ready for review November 2, 2023 13:51
@janiskemper janiskemper requested a review from a team as a code owner November 2, 2023 13:51
@jooola jooola changed the title ✨ Add server and ssh key labels for temporary objects feat: add labels options to server and ssh key Nov 6, 2023
Copy link
Member

@jooola jooola left a comment

Choose a reason for hiding this comment

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

Hey thanks for the contribution.

Our documentation is not yet being extracted from the code comments, could you please also update the builder documentation with the new field.

Comment on lines 46 to +47
SSHKeys []string `mapstructure:"ssh_keys"`
SSHKeyLabels map[string]string `mapstructure:"sshkey_labels"`
Copy link
Member

Choose a reason for hiding this comment

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

Could you make the field consistent with the exiting ssh_keys field and apply the change to the rest of the PR?

Suggested change
SSHKeys []string `mapstructure:"ssh_keys"`
SSHKeyLabels map[string]string `mapstructure:"sshkey_labels"`
SSHKeys []string `mapstructure:"ssh_keys"`
SSHKeysLabels map[string]string `mapstructure:"ssh_keys_labels"`

@jooola
Copy link
Member

jooola commented Dec 12, 2023

Closing in favor of #128

@jooola jooola closed this Dec 12, 2023
jooola added a commit that referenced this pull request Dec 12, 2023
Continuation of #92 

Adding labels to the temporary server and ssh key objects which are
needed to create the snapshot.

This is needed in some use cases where e.g. packer build stops
unexpectedly due to a SIGKILL and cannot shut down properly. In order to
realize that the respective server and ssh key are orphaned, labels are
needed.

---------

Signed-off-by: janiskemper <[email protected]>
Co-authored-by: janiskemper <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants