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

func: add metadata for drained nodes #637

Merged
merged 9 commits into from
May 25, 2023
Merged

func: add metadata for drained nodes #637

merged 9 commits into from
May 25, 2023

Conversation

Juanadelacuesta
Copy link
Member

@Juanadelacuesta Juanadelacuesta commented May 9, 2023

Issue found here

The nomad autoscaler should be able to set up specific metadata for nodes that are being drain, in order to pick up where it left off in case of a failure. This PR introduces the change. It also adds an interface to make decoupling from the nomad cluster easier for testing on this feature and maybe some more in the future.

@Juanadelacuesta Juanadelacuesta marked this pull request as draft May 9, 2023 09:41
@Juanadelacuesta Juanadelacuesta marked this pull request as ready for review May 16, 2023 09:03
Copy link
Member

@jrasell jrasell left a comment

Choose a reason for hiding this comment

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

Looking great. I've added a couple of questions, mostly about readability.

sdk/helper/scaleutils/cluster.go Show resolved Hide resolved
sdk/helper/scaleutils/node_drain.go Outdated Show resolved Hide resolved
sdk/helper/scaleutils/node_drain_test.go Outdated Show resolved Hide resolved
Juanadelacuesta and others added 2 commits May 19, 2023 18:24
Co-authored-by: James Rasell <jrasell@users.noreply.github.com>
@Juanadelacuesta Juanadelacuesta requested a review from jrasell May 23, 2023 10:32
Copy link
Member

@jrasell jrasell left a comment

Choose a reason for hiding this comment

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

LGTM, pending the change to the const naming. We will also need a changelog entry, either in this PR or a follow up to broadcast the goodness.

sdk/helper/scaleutils/node_drain.go Outdated Show resolved Hide resolved
DrainSpec: spec,
MarkEligible: false,
Meta: map[string]string{
NODE_DRAINED_META_KEY: NODE_DRAINED_META_VALUE,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
NODE_DRAINED_META_KEY: NODE_DRAINED_META_VALUE,
nodeDrainedMetaKey: nodeDrainedMetaValue,

sdk/helper/scaleutils/node_drain_test.go Outdated Show resolved Hide resolved
Juanadelacuesta and others added 4 commits May 24, 2023 14:06
Co-authored-by: James Rasell <jrasell@users.noreply.github.com>
Co-authored-by: James Rasell <jrasell@users.noreply.github.com>
@Juanadelacuesta Juanadelacuesta merged commit 8cdff81 into main May 25, 2023
@Juanadelacuesta Juanadelacuesta deleted the f-gh-627 branch May 25, 2023 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants