SKS-2194: Fix labeling virtual machines #163
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue SKS-2194
#162 给虚拟机增加虚拟机后,Tower 会自动给虚拟机添加系统标签导致 CAPE 不能给虚拟机添加预期的标签。
Change
如果虚拟机打上了 managed 标签就认为所有的标签就有了,就可以跳过给虚拟机加标签的逻辑。
考虑每次 Reconcile 都要从 Tower 获取 managed 标签,且 managed 标签除非被人为删除,否则不会变动。为了减少 Tower 接口访问,managed 会缓存 30m。
Test
创建 1CP + 3Workers 集群,在 ElfCluster 指定 haijian.yang@d8dc20fc-e197-41da-83b6-c903c88663fd。
观察到虚拟机指定了 owner
虚拟机也打上了预期的标签