plugins/kubernetes/app/models/kubernetes/release.rb
def clients(version)
      scopes = release_docs.map do |release_doc|
        deploy_group = DeployGroup.with_deleted { release_doc.deploy_group }
        [
          deploy_group,
          {
            namespace: release_doc.resources.first.namespace,
            label_selector: self.class.pod_selector(id, deploy_group.id, query: true)
          }
        ]
      end

      # avoiding doing a .uniq on clients which might trigger api calls
      scopes.uniq.map { |group, query| [group.kubernetes_cluster.client(version), query] }
    end
# optimization to not do multiple queries to the same cluster+namespace because we have many roles
# ... needs to check doc namespace too since it might be not overwritten
# ... assumes that there is only 1 namespace per release_doc
# ... supports that the same namespace might exist on different clusters
optimization to not do multiple queries to the same cluster+namespace because we have many roles
needs to check doc namespace too since it might be not overwritten
assumes that there is only 1 namespace per release_doc
supports that the same namespace might exist on different clusters
optimization to not do multiple queries to the same cluster + namespace because we have many roles needs to check doc namespace too since it might be not overwritten assumes that there is only 1 namespace per release_doc supports that the same namespace might exist on different clusters
def clients(version)
      scopes = release_docs.map do |release_doc|
        deploy_group = DeployGroup.with_deleted { release_doc.deploy_group }
        [
          deploy_group,
          {
            namespace: release_doc.resources.first.namespace,
            label_selector: self.class.pod_selector(id, deploy_group.id, query: true)
          }
        ]
      end
      scopes.uniq.map { |group, query| [group.kubernetes_cluster.client(version), query] }
    end
def clients ( version ) scopes = release_docs . map do | release_doc | deploy_group = DeployGroup . with_deleted { release_doc . deploy_group } [ deploy_group , { namespace : release_doc . resources . first . namespace , label_selector : self . class . pod_selector ( id , deploy_group . id , query : true ) } ] end scopes . uniq . map { | group , query | [ group . kubernetes_cluster . client ( version ) , query ] } end
optimization to not do multiple queries to the same cluster+namespace because we have many roles
... needs to check doc namespace too since it might be not overwritten
... assumes that there is only 1 namespace per release_doc
... supports that the same namespace might exist on different clusters
optimization to not do multiple queries to the same cluster + namespace because we have many roles ... needs to check doc namespace too since it might be not overwritten ... assumes that there is only 1 namespace per release_doc ... supports that the same namespace might exist on different clusters
# avoiding doing a .uniq on clients which might trigger api calls
version