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 useRawManifest hook option to install manifest as a hook unmodified #5106

Merged
merged 3 commits into from
Sep 21, 2018

Conversation

geekofalltrades
Copy link
Contributor

@geekofalltrades geekofalltrades commented May 4, 2018

Fixes #4764

I've added a useRawManifest option to the hook spec which causes the manifest to
be installed as a systemd unit with no modifications.

I've also changed the logic around naming of the unit files. Where previously the hook
system would append ".service" to the name of the unit file if it didn't end in ".service" or
".timer", it now instead checks for any valid systemd unit file extension. It still appends
".service" if no valid extension is found, to maintain backwards compatibility. Note that
this could break backwards-compatibility for users who are relying on the ".service"
extension for hooks with names that overlap the set of systemd extensions; for example,
a hook named "my-hook.slice" will no longer be installed as "my-hook.slice.service",
because ".slice" is a valid unit file extension.

The change is accompanied by updated documentation and unit tests around the
extension change.

We're using this change in our fork to add systemd-managed swapfiles to some of our
nodes.

When "useRawManifest" is set to true in the hook spec, the contents of
the "manifest" field are used unmodified as a systemd unit. The
"before" and "requires" fields are ignored, kops will not construct
the "[Unit]" section of the systemd unit file, and kops will not add a
"[Service]" header.

This gives operators access to the full suite of options available in
the "[Unit]" section, and also allows creation of unit files which
don't contain a "[Service]" section (for example, .swap units; see
https://www.freedesktop.org/software/systemd/man/systemd.swap.html).

Because this functionality is gated behind a new option, backwards
compatibility is preserved for hooks currently being created using the
old style.
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 4, 2018
@geekofalltrades
Copy link
Contributor Author

geekofalltrades commented May 4, 2018

ExtraHop Networks have signed the linuxfoundation CLA. I'm unsure what steps I specifically need to take to demonstrate that I'm authorized to submit this PR.

I'll talk to some folks here at work.

@mikesplain
Copy link
Contributor

Hi @geekofalltrades! Thanks for the contribution. Can you sign the CLA above so we can kick off tests and take a look at this? Thanks so much!

@gambol99
Copy link
Contributor

hi @geekofalltrades ... you need to run ./hack/update-bazel.sh and make apimachinery again

Previously the hook system would only allow extensions of ".service"
and ".timer". Any other name would have ".service" appended.

Now the hook system allows any suffix listed at
https://www.freedesktop.org/software/systemd/man/systemd.unit.html.
If no suffix is found, ".service" is still added to preserve backwards-
compatibility.

Note that backwards-compatibility may still break for users relying on
the previous behavior in odd ways. For example, a hook with name
"my-hook.slice" would previously have been installed as
"my-hook.slice.service", but it will now be installed as "my-hook.slice",
since ".slice" is a valid systemd unit file extension.
@geekofalltrades
Copy link
Contributor Author

@gambol99 I reran hack/update-bazel.sh. make apimachinery introduced no changes.

@mikesplain I'm working on getting added as a designated contributor on our corporate CLA. I am assured that we're very close.

@justinsb justinsb added this to the 1.10 milestone Jun 2, 2018
@justinsb justinsb modified the milestones: 1.10, 1.11 Jun 11, 2018
@idealhack
Copy link
Member

@geekofalltrades Any updates on this?

@geekofalltrades
Copy link
Contributor Author

geekofalltrades commented Jul 3, 2018

I am unfortunately still waiting to be added as a contributor on our CLA.

We've got an internal deadline now on getting our contributors list in order. I'll be on vacation next week, but if this isn't sorted by the time I get back, I'll close this PR and open one from my personal GitHub, instead.

@geekofalltrades
Copy link
Contributor Author

I believe the CLA should now be sorted. How long does the bot usually take to pick up that change?

@mikesplain
Copy link
Contributor

@geekofalltrades it should trigger on a new comment like this. Are you sure the email and github account mach those in your commits? If so, reach out to helpdesk@rt.linuxfoundation.org and they should be able to help out!

@geekofalltrades
Copy link
Contributor Author

LinuxFoundation support think it should be resolved - commenting to trigger the bot.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jul 17, 2018
@geekofalltrades
Copy link
Contributor Author

やった!

@mikesplain
Copy link
Contributor

Great! Lets get this testing!
/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 17, 2018
@geekofalltrades
Copy link
Contributor Author

At three weeks since last activity, what needs to happen next? Does a reviewer need to be assigned?

@idealhack
Copy link
Member

@kubernetes/kops-reviewers
/assign @chrislovecnm

@justinsb
Copy link
Member

This looks great - thanks for the submission & sorry for the delay.

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 21, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: geekofalltrades, 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 Sep 21, 2018
@k8s-ci-robot k8s-ci-robot merged commit a300c2a into kubernetes:master Sep 21, 2018
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. 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants