-
Notifications
You must be signed in to change notification settings - Fork 897
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
Namespace the mappable object types, add Amazon VM and Image types. #14288
Conversation
@blomquisg @cben Please review. |
See comment I just left on #14236. And if we do need it, I wonder what resolution of "provider" we need. E.g. "kubernetes" here actually stands for both Kubernetes & Openshift — i.e. any containers provider. And while currently Amazon will be the only other option, will one want separate mappings for Amazon Vms vs Azure Vms vs oVirt Vms? |
@cben, the goal is to automatically map custom attributes from AWS vm's and images with any mappings the user has created. This would then be applied during a refresh. @blomquisg please correct me if I'm wrong. |
Can user have both vms and images with custom attribute
"department=propulsion"? Would they want those mapped to one "Departments"
category or independent categories for Vms and Images?
I suppose user could even have both amazon vm images and container images
labeled with "project=warp-drive". Would they want those mapped to one
"Projects" category or independent categories for amazon and containers?
|
@cben I will defer to @blomquisg and @bascar for the answer to your questions. |
@cben vm and images would use the same tagging, not independent. I think we would need containers and amazon separate since in many cases it is two independent groups who run those environments and they may not want to cooperate on the tagging. |
@blomquisg Unfortunately that's not so easy because the current code is assuming |
@bascar given the current timeframe for the Fine release, I'm thinking the first phase should be to assume Currently We want to have as little change to the mapping logic as possible to avoid the risk of impacting the Container-specific mappings. @djberg96 continue under this assumption for now. We can figure out a course correction later if @bascar comments otherwise. |
I am good with the minimized impact of the "All" mapping |
The 3rd one is subtle, it's an "All" mapping, with
I'd prefer to see a migration adding prefix to all existing mappings, rather than compatibility code in several places... |
@cben I agree that we'll need to do a migration that adds a That will be the next refactoring, but for now I'm keeping it as simple as possible. |
This is great @djberg96 ! |
I meant a migration changing |
I actually had written a message here and forgot to click "Comment", then I saw @cben's comment saying the same thing. I think there needs to be a data migration to move the existing |
@blomquisg At the moment that value isn't touched and just stores "ContainerNode" or "Vm". I'm afraid of what changing that will do. Plus, once we add a
|
Checked commits https://github.com/djberg96/manageiq/compare/3231e3993e01b3b8078ec5efada9c9c66b20479c~...9bd7d8d03a15603364079d388f33d429463e5d46 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 spec/models/container_label_tag_mapping_spec.rb
|
Ignore those last rubocop warnings, they were for a commit that I yanked. |
@miq-bot remove_label wip |
@blomquisg Ok, ready to go. |
So, the only thing we're looking for as a follow on PR is a |
Sorry, had a frantic week. |
@cben I don't see how. If you select "Kubernetes::ContainerNode", then the tag it generates is "/managed/kubernetes:container_node:foo". |
See map_labels( calls in container refresh_parser.
|
This adds Amazon images and vm's as a mappable type to the ContainerLabelTagMapping model. Furthermore, I've scoped the names by provider type.
This serves two purposes. First, it modifies the drop down menu, and lets the user know exactly which type of resource that they're mapping:
Second, rather than use the hard coded AUTOTAG_PREFIX constant, the prefix will be parsed from the name. This will require a minor modification on the UI side. The net result will be that you will see entries in this form inside the
tags
table:The UI modification is here: ManageIQ/manageiq-ui-classic#666