Class: RKSeal::Commands::List
- Inherits:
-
Object
- Object
- RKSeal::Commands::List
- Defined in:
- lib/rkseal/commands/list.rb
Overview
Orchestrates the ‘rkseal list [namespace]` flow.
Lists the SealedSecret CRD objects in the cluster (all namespaces, or a single one) as a kubectl-style table. Strictly read-only and metadata-only: it prints solely each object’s namespace, name, derived scope, and age – NEVER any part of ‘spec.encryptedData` (not even its keys). No editor, no RAM workspace, no file is written.
Constant Summary collapse
- HEADERS =
Column headers, in display order.
%w[NAMESPACE NAME SCOPE AGE].freeze
- SCOPE_LABELS =
Scope symbol -> the dashed display label shown in the SCOPE column.
{ strict: "strict", namespace_wide: "namespace-wide", cluster_wide: "cluster-wide" }.freeze
Instance Attribute Summary collapse
-
#namespace ⇒ String?
readonly
The namespace filter, or nil for all namespaces.
Instance Method Summary collapse
-
#call ⇒ String
Run the list flow: read the SealedSecrets and render the table.
-
#initialize(namespace: nil, kubectl: Kubectl.new, now: Time.now) ⇒ List
constructor
A new instance of List.
Constructor Details
Instance Attribute Details
#namespace ⇒ String? (readonly)
Returns the namespace filter, or nil for all namespaces.
22 23 24 |
# File 'lib/rkseal/commands/list.rb', line 22 def namespace @namespace end |
Instance Method Details
#call ⇒ String
Run the list flow: read the SealedSecrets and render the table.
Side effects: a single read-only ‘kubectl get sealedsecret`. No editor, no workspace, no file write.
50 51 52 53 54 55 56 |
# File 'lib/rkseal/commands/list.rb', line 50 def call @kubectl.ensure_available! items = parse_items(@kubectl.list_sealedsecrets(namespace: @namespace)) return if items.empty? render_table(items.map { |item| row_for(item) }) end |