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

(CONT-1229) - Allow nested extra networking facts #529

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

jordanbreen28
Copy link
Contributor

@jordanbreen28 jordanbreen28 commented Jul 18, 2023

Summary

This change allows the user to specify nested facts within their .sync.yml.
Before, if a user specified a networking fact in their .sync.yml with the below

spec/default_facts.yml:
  extra_facts:
    networking:
      hostname: "kubernetes.localhost"

it would result in a duplicate key error in the default_facts.yml, like this:

networking:
  ip: "172.16.254.254"
  ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA"
  mac: "AA:AA:AA:AA:AA:AA"
is_pe: false
networking:
  hostname: "kubernetes.localhost"

Additional Context

Now, when extra_facts is passed it will check for networking facts first, before clearing them and adding extra_facts as before.
A .sync.yml like below, will result in the following:

spec/default_facts.yml:
  extra_facts:
    networking:
      hostname: "kubernetes.localhost"
      domain: "localhost"
      fqdn: "foo.example.com"
    os:
      family: "debian"
      name: "debian"

default_facts.yml

---
networking:
  ip: "172.16.254.254"
  ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA"
  mac: "AA:AA:AA:AA:AA:AA"
  hostname: "kubernetes.localhost"
  domain: "localhost"
  fqdn: "foo.example.com"
is_pe: false
os:
  family: debian
  name: debian

Related Issues (if any)

Mention any related issues or pull requests.

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified.

@jordanbreen28 jordanbreen28 requested a review from a team as a code owner July 18, 2023 12:09
@jordanbreen28 jordanbreen28 force-pushed the CONT-1229-nested_extra_facts branch 19 times, most recently from 61f5173 to 57aaf55 Compare July 18, 2023 12:47
Copy link
Member

@david22swan david22swan left a comment

Choose a reason for hiding this comment

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

LGTM

@david22swan david22swan merged commit 9b627e8 into main Jul 18, 2023
2 checks passed
@david22swan david22swan deleted the CONT-1229-nested_extra_facts branch July 18, 2023 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants