lib/k8s/kubeconfig/config_struct.rb
# Like `kubectl config --flatten`, returns a version where file references are read into their data fields
# @return [Object] self after file references are flattened
Like `kubectl config --flatten`, returns a version where file references are read into their data fields
Like ` kubectl config -- flatten ` returns a version where file references are read into their data fields
def flatten!
        self.class.attributes.keys.select { |k| k.end_with?('_data') }.each do |data_attr|
          reference_attr = data_attr[/(.+?)_data$/, 1]
          value = send(data_attr)
          next if value.nil?
          send("#{data_attr}=", value)
          send("#{reference_attr})", nil)
        end
        self
      end
def flatten! self . class . attributes . keys . select { | k | k . end_with? ( '_data' ) } . each do | data_attr | reference_attr = data_attr [ / (.+?)_data$ / , 1 ] value = send ( data_attr ) next if value . nil? send ( "#{data_attr}=" , value ) send ( "#{reference_attr})" , nil ) end self end
Like `kubectl config --flatten`, returns a version where file references are read into their data fields
Like ` kubectl config -- flatten ` returns a version where file references are read into their data fields
self after file references are flattened
self after file references are flattened
Object