Instance.hs: rename 'tags' to 'exclTags', provide 'allTags'
authorDato Simó <dato@google.com>
Wed, 10 Oct 2012 16:58:37 +0000 (17:58 +0100)
committerDato Simó <dato@google.com>
Wed, 17 Oct 2012 13:13:32 +0000 (14:13 +0100)
commit2f907badb54583b4d3b58b83836375bc043ab785
tree72d6917ff74c4a1d31f5fc1246c2ca61ad1db0d2
parent0397694e7d8cd447d99accb67c7239c63d553acf
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>
htools/Ganeti/HTools/Instance.hs
htools/Ganeti/HTools/Loader.hs
htools/Ganeti/HTools/Node.hs
htools/Ganeti/HTools/Text.hs