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

Knockouts don't work for: Hashtable Arrays #129

Open
raandree opened this issue Aug 17, 2022 · 0 comments
Open

Knockouts don't work for: Hashtable Arrays #129

raandree opened this issue Aug 17, 2022 · 0 comments

Comments

@raandree
Copy link
Contributor

Even more important than knocking out keys would be knowing out hash tables from a hash table array, similar like removing knocking out values from a base type array. This behavior is not available in Puppet.

Lower Level:

HashTables:
  Items:
    - Key1: h3
      Key2: 3
      Key3: v
    - Key1: h4
      Key2: 4
    - Key1: h5
      Key2: 5

Higher Level:

HashTables:
  Items:
    - Key1: h1
      Key2: 1
    - Key1: h2
      Key2: 2
    - Key1: --h3
      Key2: 3
      Key3: v3

Actual RSOP:

HashTables:
  Items:
  - Key1: h1                                                                                  AllNodes\Dev\DSCFile01
    Key2: 1                                                                                   AllNodes\Dev\DSCFile01
  - Key1: h2                                                                                  AllNodes\Dev\DSCFile01
    Key2: 2                                                                                   AllNodes\Dev\DSCFile01
  - Key3: v3                                                                                  AllNodes\Dev\DSCFile01
    Key1: --h3                                                                                AllNodes\Dev\DSCFile01
    Key2: 3                                                                                   AllNodes\Dev\DSCFile01
  - Key3: v                                                                                         Roles\FileServer
    Key1: h3                                                                                        Roles\FileServer
    Key2: 3                                                                                         Roles\FileServer
  - Key1: h4                                                                                        Roles\FileServer
    Key2: 4                                                                                         Roles\FileServer
  - Key1: h5                                                                                        Roles\FileServer
    Key2: 5                                                                                         Roles\FileServer

Expected RSOP:

HashTables:
  Items:
  - Key1: h1                                                                                  AllNodes\Dev\DSCFile01
    Key2: 1                                                                                   AllNodes\Dev\DSCFile01
  - Key1: h2                                                                                  AllNodes\Dev\DSCFile01
    Key2: 2                                                                                   AllNodes\Dev\DSCFile01
  - Key1: h4                                                                                        Roles\FileServer
    Key2: 4                                                                                         Roles\FileServer
  - Key1: h5                                                                                        Roles\FileServer
    Key2: 5                                                                                         Roles\FileServer

Datum.yml

  HashTables:
    merge_hash: deep
  HashTables\Items:
    merge_hash_array: UniqueKeyValTuples
    merge_options:
      tuple_keys:
        - Key1
        - Key2
      knockout_prefix: --

Instead of knocking out the hash table with the with Key1 == h3, Datum treats it as a new hash table to merge as Lower Level->Key1 is different from Higher Level->Key1.

  • How does knockout work with more than two layers / how is it supposed to work?
  • Is it sufficient to allow a knockout only on the first key in merge_options->tuple_keys
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

No branches or pull requests

1 participant