{"action":"created","issue":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/5929","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/5929/labels{/name}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/5929/comments","events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/5929/events","html_url":"https://github.com/ManageIQ/manageiq/issues/5929","id":123163966,"number":5929,"title":"Class naming convention is different among container classes ","user":{"login":"abonas","id":6277245,"avatar_url":"https://avatars.githubusercontent.com/u/6277245?v=3","gravatar_id":"","url":"https://api.github.com/users/abonas","html_url":"https://github.com/abonas","followers_url":"https://api.github.com/users/abonas/followers","following_url":"https://api.github.com/users/abonas/following{/other_user}","gists_url":"https://api.github.com/users/abonas/gists{/gist_id}","starred_url":"https://api.github.com/users/abonas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abonas/subscriptions","organizations_url":"https://api.github.com/users/abonas/orgs","repos_url":"https://api.github.com/users/abonas/repos","events_url":"https://api.github.com/users/abonas/events{/privacy}","received_events_url":"https://api.github.com/users/abonas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-20T14:37:43Z","updated_at":"2015-12-21T13:12:25Z","closed_at":null,"body":"ContainerGroup.first.class.name returns \"ManageIQ::Providers::Kubernetes::ContainerManager::ContainerGroup\"\r\n\r\nContainerReplicator.first.class.name returns\r\n\"ContainerReplicator\"\r\n\r\nContainerService.first.class.name returns\r\n\"ContainerService\"\r\n\r\nContainer.Node.first.class.name returns\r\n\"ManageIQ::Providers::Kubernetes::ContainerManager::ContainerNode\" \r\n\r\nthis makes some generic handling more difficult.\r\n@simon3z @matthewd any idea why is the above happening? STI stuff?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments/166302487","html_url":"https://github.com/ManageIQ/manageiq/issues/5929#issuecomment-166302487","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/5929","id":166302487,"user":{"login":"simon3z","id":130393,"avatar_url":"https://avatars.githubusercontent.com/u/130393?v=3","gravatar_id":"","url":"https://api.github.com/users/simon3z","html_url":"https://github.com/simon3z","followers_url":"https://api.github.com/users/simon3z/followers","following_url":"https://api.github.com/users/simon3z/following{/other_user}","gists_url":"https://api.github.com/users/simon3z/gists{/gist_id}","starred_url":"https://api.github.com/users/simon3z/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simon3z/subscriptions","organizations_url":"https://api.github.com/users/simon3z/orgs","repos_url":"https://api.github.com/users/simon3z/repos","events_url":"https://api.github.com/users/simon3z/events{/privacy}","received_events_url":"https://api.github.com/users/simon3z/received_events","type":"User","site_admin":false},"created_at":"2015-12-21T13:12:25Z","updated_at":"2015-12-21T13:12:25Z","body":"@abonas that happens because `ContainerGroup` and `ContainerNode` have specialized classes for Kubernetes, while on the other hand `ContainerReplicator`, `ContainerService` are still generic as we don't have anything Kubernetes-specific for them yet.\r\n\r\nGoing forward I expect they may grow into `ManageIQ::Providers::Kubernetes::ContainerManager::ContainerReplicator` and `ManageIQ::Providers::Kubernetes::ContainerManager::ContainerService`, but at the moment we don't have a use-case for that other than standardizing class names of the instances.\r\n\r\nIn the current state you can use `kind_of?` to check whether a specific entity (e.g. `ManageIQ::Providers::Kubernetes::ContainerManager::ContainerGroup`) is of a certain kind (e.g. `ContainerGroup`):\r\n\r\n    ManageIQ::Providers::Kubernetes::ContainerManager::ContainerGroup.first.kind_of?(ContainerGroup)\r\n    => true\r\n\r\nInstead if you need the class name you could use `base_class`.\r\nFor example the existing ManageIQ backend has a similar problem already for `Vms`, `Hosts`, etc.:\r\n\r\nhttps://github.com/ManageIQ/manageiq/blob/capablanca/app/helpers/application_helper/toolbar_builder.rb#L1279-L1292\r\n\r\nI believe you're asking this to improve the entities handling in the dashboard/topology, if you can point us to the specific part of existing code (or PR) you want to improve we can have better understanding of what's needed.\r\n\r\n"}}