Method: Krane::ResourceCache#get_instance
- Defined in:
- lib/krane/resource_cache.rb
#get_instance(kind, resource_name, raise_if_not_found: false) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/krane/resource_cache.rb', line 17 def get_instance(kind, resource_name, raise_if_not_found: false) instance = use_or_populate_cache(kind).fetch(resource_name, {}) if instance.blank? && raise_if_not_found raise Krane::Kubectl::ResourceNotFoundError, "Resource does not exist (used cache for kind #{kind})" end instance rescue KubectlError {} end |