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

[draft] make using volatile config explicit #32558

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tommyp1ckles
Copy link
Contributor

Please ensure your pull request adheres to the following guidelines:

  • For first time contributors, read Submitting a pull request
  • All code is covered by unit and/or runtime tests where feasible.
  • All commits contain a well written commit description including a title,
    description and a Fixes: #XXX line if the commit addresses a particular
    GitHub issue.
  • If your commit description contains a Fixes: <commit-id> tag, then
    please add the commit author[s] as reviewer[s] to this issue.
  • All commits are signed off. See the section Developer’s Certificate of Origin
  • Provide a title or release-note blurb suitable for the release notes.
  • Are you a user of Cilium? Please add yourself to the Users doc
  • Thanks for contributing!

Fixes: #issue-number

<!-- Enter the release note text here if needed or remove this section! -->

As described in this issue: cilium#32557

Access to a subset of fields in *DaemonConfig is dangerous as
they are not finalized until runtime.

This makes access to those fields  explicit by putting them behind
a call to Volatile() - as well as any derived config function (i.e.
anything that uses a 'volatile' field).

This is intended to clearly distinguish daemon config that is not
finalized until newDaemon is complete.

In subsequent commits we will hook functionality into the Volatile
function to check for improper usage.

Signed-off-by: Tom Hadlaw <tom.hadlaw@isovalent.co
Accessing any fields/functions under the Volatile() api for
*DaemonConfig inside Populate (but not via the Lifecycle) is risky as
those fields are not finalized until the completion of newDaemon.

For each call to (*DaemonConfig).Volatile(), this walks the call stack
and looks to see if the config was accessed from inside a hive Invoke
or Provide which would indicate unsafe usage.

Signed-off-by: Tom Hadlaw <tom.hadlaw@isovalent.com>
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label May 15, 2024
@tommyp1ckles tommyp1ckles changed the title Pr/tp/volatile config [draft] make using volatile config explicit May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dont-merge/needs-release-note-label The author needs to describe the release impact of these changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant