Class: Krane::MutatingWebhookConfiguration

Inherits:
KubernetesResource show all
Defined in:
lib/krane/kubernetes_resource/mutating_webhook_configuration.rb

Defined Under Namespace

Classes: Webhook

Constant Summary collapse

GLOBAL =
true
TIMEOUT =
30.seconds

Constants inherited from KubernetesResource

KubernetesResource::ALLOWED_DEPLOY_METHOD_OVERRIDES, KubernetesResource::DEBUG_RESOURCE_NOT_FOUND_MESSAGE, KubernetesResource::DEPLOY_METHOD_OVERRIDE_ANNOTATION, KubernetesResource::DISABLED_EVENT_INFO_MESSAGE, KubernetesResource::DISABLED_LOG_INFO_MESSAGE, KubernetesResource::DISABLE_FETCHING_EVENT_INFO, KubernetesResource::DISABLE_FETCHING_LOG_INFO, KubernetesResource::LAST_APPLIED_ANNOTATION, KubernetesResource::LOG_LINE_COUNT, KubernetesResource::SENSITIVE_TEMPLATE_CONTENT, KubernetesResource::SERVER_DRY_RUNNABLE, KubernetesResource::SERVER_DRY_RUN_DISABLED_ERROR, KubernetesResource::STANDARD_TIMEOUT_MESSAGE, KubernetesResource::SYNC_DEPENDENCIES, KubernetesResource::TIMEOUT_OVERRIDE_ANNOTATION, KubernetesResource::UNUSUAL_FAILURE_MESSAGE

Instance Attribute Summary

Attributes inherited from KubernetesResource

#context, #deploy_started_at, #global, #name, #namespace, #type

Instance Method Summary collapse

Methods inherited from KubernetesResource

#<=>, #after_sync, build, class_for_kind, #current_generation, #debug_message, #deploy_failed?, #deploy_method, #deploy_method_override, #deploy_started?, #deploy_timed_out?, #disappeared?, #exists?, #failure_message, #fetch_events, #file_path, #global?, #group, #id, kind, #kubectl_resource_type, #observed_generation, #pretty_status, #pretty_timeout_type, #report_status_to_statsd, #selected?, #sensitive_template_content?, #server_dry_run_validated?, #server_dry_runnable_resource?, #status, #sync, #sync_debug_info, #terminating?, timeout, #timeout, #timeout_message, #timeout_override, #to_kubeclient_resource, #use_generated_name, #uses_generate_name?, #validate_definition, #validation_error_msg, #validation_failed?, #version

Constructor Details

#initialize(namespace:, context:, definition:, logger:, statsd_tags:) ⇒ MutatingWebhookConfiguration

Returns a new instance of MutatingWebhookConfiguration.


70
71
72
73
74
# File 'lib/krane/kubernetes_resource/mutating_webhook_configuration.rb', line 70

def initialize(namespace:, context:, definition:, logger:, statsd_tags:)
  @webhooks = (definition.dig('webhooks') || []).map { |hook| Webhook.new(hook) }
  super(namespace: namespace, context: context, definition: definition,
    logger: logger, statsd_tags: statsd_tags)
end

Instance Method Details

#deploy_succeeded?Boolean

Returns:

  • (Boolean)

78
79
80
# File 'lib/krane/kubernetes_resource/mutating_webhook_configuration.rb', line 78

def deploy_succeeded?
  exists?
end

#webhooksObject


82
83
84
# File 'lib/krane/kubernetes_resource/mutating_webhook_configuration.rb', line 82

def webhooks
  @definition.fetch('webhooks', []).map { |webhook| Webhook.new(webhook) }
end