Instance.hs: rename 'tags' to 'exclTags', provide 'allTags'
The mergeData function in Loader.hs included a step to filter an instance's tags to include only the exclusion tags (as specified via the commandline, or cluster-level tags). Later on, code in Node.hs assumed Instance.tags to contain only tags to be used for exclusion. Because in the future we will need to access the full list of an instance's tags (and not only exclusion tags), this commits deprecates the 'tags' field, and introduces Instance.exclTags and Instance.allTags. Instance.allTags is now populated from the different backends (Text, Luxi, Rapi, etc.), and Instance.exclTags is only populated from Loader.mergeData, as was done previously. This means that loading tags from e.g. Text or Simu and assuming that they'll be used as exclusion tags without going through Loader.hs will no longer work; but this was already the case with other fields, and 'mergeData' or 'loadExternalData' continue to be the only entry points to get a consistent view of the cluster. (Additionally, there were no tests that made this assumption that I could find.) Signed-off-by:Dato Simó <dato@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
Showing
- htools/Ganeti/HTools/Instance.hs 4 additions, 2 deletionshtools/Ganeti/HTools/Instance.hs
- htools/Ganeti/HTools/Loader.hs 7 additions, 7 deletionshtools/Ganeti/HTools/Loader.hs
- htools/Ganeti/HTools/Node.hs 4 additions, 4 deletionshtools/Ganeti/HTools/Node.hs
- htools/Ganeti/HTools/Text.hs 1 addition, 1 deletionhtools/Ganeti/HTools/Text.hs
Loading
Please register or sign in to comment