-
Notifications
You must be signed in to change notification settings - Fork 63
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
Using the new options for image-scanning options #45
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
module ManageIQ::Providers::Kubernetes::ContainerManager::Options | ||
extend ActiveSupport::Concern | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you need ActiveSupport::Concern? what does it do here? ( I think you don't need it, this simply has methods that become class methods due to |
||
|
||
module ClassMethods | ||
def proxy_settings | ||
{ | ||
:http_proxy => { | ||
:label => N_('HTTP Proxy'), | ||
:help_text => N_('HTTP Proxy to connect ManageIQ to the provider. example: http://user:password@my_https_proxy'), | ||
:global_default => VMDB::Util.http_proxy_uri, | ||
}, | ||
} | ||
end | ||
|
||
def advanced_settings | ||
{ | ||
:image_inspector_options => { | ||
:label => N_('Image Inspector Options'), | ||
:help_text => N_('Settings for Image Inspector tool'), | ||
:settings => { | ||
:http_proxy => { | ||
:label => N_('HTTP Proxy'), | ||
:help_text => N_('HTTP Proxy to connect image inspector pods to the internet. example: http://user:password@my_https_proxy'), | ||
}, | ||
:https_proxy => { | ||
:label => N_('HTTPS Proxy'), | ||
:help_text => N_('HTTPS Proxy to connect image inspector pods to the internet. example: https://user:password@my_https_proxy'), | ||
}, | ||
:no_proxy => { | ||
:label => N_('NO Proxy'), | ||
:help_text => N_('NO Proxy lists urls that should\'nt be sent to any proxy. example: my_file_server.org'), | ||
}, | ||
:repository => { | ||
:label => N_('Image-Inspector Repository'), | ||
:help_text => N_('Image-Inspector Repository. example: openshift/image-inspector'), | ||
:global_default => Settings.ems.ems_kubernetes.image_inspector_repository, | ||
}, | ||
:registry => { | ||
:label => N_('Image-Inspector Registry'), | ||
:help_text => N_('Registry to provide the image inspector repository. example: docker.io'), | ||
:global_default => Settings.ems.ems_kubernetes.image_inspector_registry, | ||
}, | ||
:image_tag => { | ||
:label => N_('Image-Inspector Tag'), | ||
:help_text => N_('Image-Inspector image tag. example: 2.1'), | ||
:global_default => ManageIQ::Providers::Kubernetes::ContainerManager::Scanning::Job::INSPECTOR_IMAGE_TAG, | ||
}, | ||
:cve_url => { | ||
:label => N_('CVE location'), | ||
:help_text => N_('Enables defining a URL path prefix for XCCDF file instead of accessing the default location. | ||
example: http://my_file_server.org:3333/xccdf_files/ | ||
Expecting to find com.redhat.rhsa-RHEL7.ds.xml.bz2 file there.'), | ||
# Future versions of image inspector will extend this. | ||
}, | ||
} | ||
} | ||
} | ||
end | ||
|
||
def provider_settings | ||
{ | ||
:proxy_settings => { | ||
:label => N_('Proxy Settings'), | ||
:help_text => N_('Proxy Settings for connection to the provider'), | ||
:settings => proxy_settings, | ||
}, | ||
:advanced_settings => { | ||
:label => N_('Advanced Settings'), | ||
:help_text => N_('Advanced Settings for provider configuration'), | ||
:settings => advanced_settings, | ||
} | ||
} | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ def kubernetes_connect(hostname, port, options) | |
options[:version] || kubernetes_version, | ||
:ssl_options => Kubeclient::Client::DEFAULT_SSL_OPTIONS.merge(options[:ssl_options] || {}), | ||
:auth_options => kubernetes_auth_options(options), | ||
:http_proxy_uri => VMDB::Util.http_proxy_uri, | ||
:http_proxy_uri => options[:http_proxy] || VMDB::Util.http_proxy_uri, | ||
:timeouts => { | ||
:open => Settings.ems.ems_kubernetes.open_timeout.to_f_with_method, | ||
:read => Settings.ems.ems_kubernetes.read_timeout.to_f_with_method | ||
|
@@ -108,11 +108,12 @@ def ssl_cert_store(endpoint = default_endpoint) | |
|
||
def connect(options = {}) | ||
effective_options = options.merge( | ||
:hostname => options[:hostname] || address, | ||
:port => options[:port] || port, | ||
:user => options[:user] || authentication_userid(options[:auth_type]), | ||
:pass => options[:pass] || authentication_password(options[:auth_type]), | ||
:bearer => options[:bearer] || authentication_token(options[:auth_type] || 'bearer'), | ||
:hostname => options[:hostname] || address, | ||
:port => options[:port] || port, | ||
:user => options[:user] || authentication_userid(options[:auth_type]), | ||
:pass => options[:pass] || authentication_password(options[:auth_type]), | ||
:bearer => options[:bearer] || authentication_token(options[:auth_type] || 'bearer'), | ||
:http_proxy => self.options ? self.options.fetch_path(:proxy_settings, :http_proxy) : nil, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
:ssl_options => options[:ssl_options] || { | ||
:verify_ssl => verify_ssl_mode, | ||
:cert_store => ssl_cert_store | ||
|
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.
👍
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.
@enoodle @cben didn't we miss a require nested of the new file here?