Skip to content

Use regexp on K3sRestarter.Restart()#705

Open
Shunpoco wants to merge 1 commit into
spinframework:mainfrom
Shunpoco:k3s-custom-name
Open

Use regexp on K3sRestarter.Restart()#705
Shunpoco wants to merge 1 commit into
spinframework:mainfrom
Shunpoco:k3s-custom-name

Conversation

@Shunpoco

@Shunpoco Shunpoco commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Describe your changes

Use regexp on K8sRestarter.Restart() so that it treats a custom systemd service name like k3s-xxx.service.

Issue ticket number and link

close #630

Checklist before requesting a review

  • I have performed a self-review of my code
  • If it is a core feature, I have added thorough tests.
  • I tested the changes with the following distributions:
    • Kind
    • MiniKube
    • MicroK8s
    • Rancher RKE2
    • Azure AKS
    • GCP GKE (Ubuntu nodes)
    • AWS EKS (AmazonLinux2 nodes)
    • AWS EKS (Ubuntu nodes)
    • Digital Ocean Kubernetes

Use regexp to treat a custom systemd service name.

Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
@Shunpoco Shunpoco marked this pull request as ready for review June 5, 2026 22:04
@vdice vdice self-requested a review June 8, 2026 17:16

@vdice vdice left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I like how the regex simplifies the code! My only reservation is around the case when no k3s service is found; then the error may not be obvious (the code will run systemctl restart with an empty string). However, perhaps that is only a theoretical scenario.

What do you think? Should we check for an empty string? Or perhaps go with this for now and revisit if/when it becomes an issue?

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.

node_installer(k3s): support custom systemd service name

2 participants