-
Notifications
You must be signed in to change notification settings - Fork 981
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
Fixes #11093 - Cockpit journal and console if available #2535
Conversation
class CockpitTest < ActiveSupport::TestCase | ||
test 'cockpit is enabled if cockpit ping is successful' do | ||
dummy_cockpit = DummyCockpit.new | ||
dummy_cockpit.stubs(:operatingsystem).returns(OpenStruct.new(:type => 'Fedora')) |
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.
OpenStruct is a bit slow, if you want to suggest another altneratives that'd be great.
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.
I think this may be faster?
Os = Struct.new(:type)
dummy_cockpit.stubs(:operatingsystem).returns(Os.new('Fedora'))
Would this be better in a plugin? |
I wondered for some time, the reason why I put this in core is that Cockpit is expected to end up in all major Linux OSs, so far it's on Fedora, CentOS, Red Hat, and Arch, but there are plans to include it in Debian based OSs as well. I don't have an strong opinion on this so if anyone feels strongly against this being in core I'll launch a new plugin. |
Seeing as there's little abstraction, a hardcoded list of OS families and URLs, I'd suggest keeping it in a plugin so it can be developed more rapidly and be updated to suit any changes in Cockpit. I can't really see a reason why it needs to be core, so would default to plugin in my mind. |
I think I am leaning toward a plugin as well. The code is rather simple but it seems like it would be easier (if we decide later for some reason) to merge a cockpit plugin into foreman than vice versa. |
I have started moving this code to https://github.com/dLobatog/foreman_cockpit, closing. |
This should allow us to see a button Console/Journal if cockpit is enabled in some host, and that host is contactable by Foreman.