Class: Kamal::Lint::Checks::UnknownKeys

Inherits:
Kamal::Lint::Check show all
Defined in:
lib/kamal/lint/checks/unknown_keys.rb

Overview

Flags keys at the top level and under proxy: that aren't part of Kamal's configuration schema.

Drives off Kamal's own lib/kamal/configuration/docs/*.yml example files — the same source kamal's runtime validator uses for check_unknown_keys!. That makes the lint stay in sync with whichever kamal version is installed.

Also surfaces a targeted hint when an unknown key under proxy: is actually a valid top-level Kamal key (the classic deploy_timeout / drain_timeout misplacement after the 2.10 → 2.11 schema move).

Instance Attribute Summary

Attributes inherited from Kamal::Lint::Check

#context

Instance Method Summary collapse

Methods inherited from Kamal::Lint::Check

applies_to?, id, #initialize, severity, since, title, until_version

Constructor Details

This class inherits a constructor from Kamal::Lint::Check

Instance Method Details

#callObject



27
28
29
30
31
32
33
34
# File 'lib/kamal/lint/checks/unknown_keys.rb', line 27

def call
  findings = []
  walk_keys(parsed, top_level_schema, [], findings)
  if parsed.is_a?(Hash) && parsed["proxy"].is_a?(Hash)
    walk_keys(parsed["proxy"], proxy_schema, [ "proxy" ], findings)
  end
  findings
end