lib/pharos/kube/config.rb
def merge!(other)
        other.config.each do |key, value|
          case key
          when 'clusters', 'contexts', 'users'
            value.each do |other_value|
              own_value = config[key].find { |c| c['name'] == other_value['name'] }
              config[key].delete(own_value) if own_value
              config[key] << other_value
            end
          when 'current-context', 'preferences'
            config[key] = value
          else
            config[key] ||= value
          end
        end

        self
      end
# Performs a merge of another kubeconfig into the current instance
# @param other [Pharos::Kube::Config]
Performs a merge of another kubeconfig into the current instance
Performs a merge of another kubeconfig into the current instance
def merge!(other)
        other.config.each do |key, value|
          case key
          when 'clusters', 'contexts', 'users'
            value.each do |other_value|
              own_value = config[key].find { |c| c['name'] == other_value['name'] }
              config[key].delete(own_value) if own_value
              config[key] << other_value
            end
          when 'current-context', 'preferences'
            config[key] = value
          else
            config[key] ||= value
          end
        end
        self
      end
def merge! ( other ) other . config . each do | key , value | case key when 'clusters' , 'contexts' , 'users' value . each do | other_value | own_value = config [ key ] . find { | c | c [ 'name' ] == other_value [ 'name' ] } config [ key ] . delete ( own_value ) if own_value config [ key ] << other_value end when 'current-context' , 'preferences' config [ key ] = value else config [ key ] ||= value end end self end
Performs a merge of another kubeconfig into the current instance
Performs a merge of another kubeconfig into the current instance
other
None