-
Notifications
You must be signed in to change notification settings - Fork 125
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
Add type to ContainerTemplate to allow subclassing. #35
Conversation
@enoodle Do you mean |
1a170fd
to
82a71d4
Compare
@lfu This is what I understand from this PR. Do you know if this is a requirement now that all Container models should be moved under |
|
||
def up | ||
say_with_time("Updating type column for ContainerTemplate") do | ||
ContainerTemplate.update_all(:type => "ManageIQ::Providers::ContainerManager::ContainerTemplate") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should it be ManageIQ::Providers::OpenShift::ContainerManager::ContainerTemplate
or derive the class name with actual provider name from its container manager?
@enoodle That is correct. ManageIQ/manageiq#15523 is aimed at moving all Kube/Openshift specific code into its provider directory. Let me know if I have missed any other file. |
82a71d4
to
1ee2737
Compare
|
||
def up | ||
say_with_time("Updating type column for ContainerTemplate") do | ||
ContainerTemplate.update_all(:type => "ManageIQ::Providers::OpenShift::ContainerManager::ContainerTemplate") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lfu Tests are failing because OpenShift
here does not match the test for Openshift
(lower case "s").
You want to use "Openshift". Example: https://github.com/ManageIQ/manageiq-providers-openshift/blob/master/app/models/manageiq/providers/openshift/container_manager.rb#L1
1ee2737
to
e8552ce
Compare
Checked commit lfu@e8552ce with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 db/migrate/20170707150520_update_container_template_types.rb
|
IMO if we want to separate all the container classes that have mostly Openshift functions then we need to also move: ContainerBuild, ContainerBuildPod, ContainerDeployment and ContainerRoute. The all only Openshift meaning (I guess Route will/should be changed to include kubernetes ingress soon). |
@lfu I don't think there is anything else that is concerning templates. |
@Fryguy Please review. |
Gah I just merged this, but how do you know the container template is always openshift...what if it's kubernetes? |
I thought Openshift template is the only container template that is currently supported. |
Yeah, templates are an Openshift concept, they don't exist in Kubernetes. Currently kubernetes refresh doesn't even try to collect/parse/create ContainerTemplate, this migration's assumption is safe. (aside from related PRs not being merged yet) |
Part of refactoring kube/openshift specific template code into its own provider directory.
Part of ManageIQ/manageiq#15523.
@miq-bot add_label refactoring