class CronKubernetes::KubernetesClient
Encapsulate access to Kubernetes API for different API versions.
Public Instance Methods
batch_beta1_client()
click to toggle source
# File lib/cron_kubernetes/kubernetes_client.rb, line 6 def batch_beta1_client @batch_beta1_client ||= client("/apis/batch", "v1beta1") end
namespace()
click to toggle source
# File lib/cron_kubernetes/kubernetes_client.rb, line 10 def namespace context&.namespace end
Private Instance Methods
client(scope, version = nil)
click to toggle source
# File lib/cron_kubernetes/kubernetes_client.rb, line 16 def client(scope, version = nil) return CronKubernetes.kubeclient if CronKubernetes.kubeclient return unless context Kubeclient::Client.new(context.endpoint + scope, version || context.version, context.options) end
context()
click to toggle source
# File lib/cron_kubernetes/kubernetes_client.rb, line 22 def context return nil if CronKubernetes.kubeclient @context ||= KubeclientContext.context end