Skip to content

Oci hooks settings extension#3978

Merged
mgsharm merged 3 commits intobottlerocket-os:developfrom
mgsharm:oci-hooks-settings-extension
May 22, 2024
Merged

Oci hooks settings extension#3978
mgsharm merged 3 commits intobottlerocket-os:developfrom
mgsharm:oci-hooks-settings-extension

Conversation

@mgsharm
Copy link
Copy Markdown
Contributor

@mgsharm mgsharm commented May 22, 2024

Issue number:

Closes #3659

Description of changes:

  • Creates ock-hooks settings extension and uses it in every variant's settings model.
  • Creates settings-oci-hooks RPM package that installs the extension binary.

Testing done:

  • Built aws-dev variant with the settings-oci-hooks installed. Launched ec2 instance with the aws-dev variant ami. Connected with the instance via SSM to run apiclient commands.
  • Called apiclient to verify the settings-oci-hooks worked as expected.
[ssm-user@control]$ apiclient get settings.oci-hooks
{
  "settings": {
    "oci-hooks": {
      "log4j-hotpatch-enabled": false
    }
  }
}
[ssm-user@control]$ apiclient set settings.oci-hooks.log4j-hotpatch-enabled=true
[ssm-user@control]$ apiclient get settings.oci-hooks
{
  "settings": {
    "oci-hooks": {
      "log4j-hotpatch-enabled": true
    }
  }
}
  • Also tested by building locally.
> cargo run proto1 set --setting-version v1 --value '{"log4j-hotpatch-enabled":true}'
   Compiling settings-extension-oci-hooks v0.1.0 (/Users/mgsharm/bottlerocket/bottlerocket/sources/settings-extensions/oci-hooks)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.09s
     Running `/Users/mgsharm/bottlerocket/bottlerocket/sources/target/debug/settings-extension-oci-hooks proto1 set --setting-version v1 --value '{"log4j-hotpatch-enabled":true}'`

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@mgsharm mgsharm added the area/out-of-tree-builds Related to the efforts of making it easy to create builds outside of the main Bottlerocket repo label May 22, 2024
@mgsharm mgsharm self-assigned this May 22, 2024
@mgsharm mgsharm added this to the settings-extension-ports milestone May 22, 2024
@mgsharm mgsharm linked an issue May 22, 2024 that may be closed by this pull request
@mgsharm mgsharm force-pushed the oci-hooks-settings-extension branch from deb3cfb to d03e55b Compare May 22, 2024 06:22
@mgsharm mgsharm force-pushed the oci-hooks-settings-extension branch from d03e55b to 9b8eae1 Compare May 22, 2024 16:46
@mgsharm mgsharm force-pushed the oci-hooks-settings-extension branch from 9b8eae1 to 9caf44f Compare May 22, 2024 17:01
@mgsharm mgsharm merged commit 62f1453 into bottlerocket-os:develop May 22, 2024
@mgsharm mgsharm deleted the oci-hooks-settings-extension branch May 22, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/out-of-tree-builds Related to the efforts of making it easy to create builds outside of the main Bottlerocket repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OOTB: Port oci_hooks settings model to settings extensions

4 participants