mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Make libvirt-coreos generate a .kubeconfig file and have e2e tests use it
This commit is contained in:
		@@ -220,6 +220,13 @@ function kube-up {
 | 
				
			|||||||
    rm $domain_xml
 | 
					    rm $domain_xml
 | 
				
			||||||
  done
 | 
					  done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  export KUBECONFIG="${HOME}/.kube/.kubeconfig"
 | 
				
			||||||
 | 
					  local kubectl="${KUBE_ROOT}/cluster/kubectl.sh"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  "${kubectl}" config set-cluster libvirt-coreos --server=http://${KUBE_MASTER_IP-}:8080
 | 
				
			||||||
 | 
					  "${kubectl}" config set-context libvirt-coreos --cluster=libvirt-coreos
 | 
				
			||||||
 | 
					  "${kubectl}" config use-context libvirt-coreos --cluster=libvirt-coreos
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  wait-cluster-readiness
 | 
					  wait-cluster-readiness
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  echo "Kubernetes cluster is running. The master is running at:"
 | 
					  echo "Kubernetes cluster is running. The master is running at:"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -109,6 +109,10 @@ if [[ -z "${AUTH_CONFIG:-}" ]];  then
 | 
				
			|||||||
      auth_config=(
 | 
					      auth_config=(
 | 
				
			||||||
        "--auth_config=${HOME}/.kube/${INSTANCE_PREFIX}/kubernetes_auth"
 | 
					        "--auth_config=${HOME}/.kube/${INSTANCE_PREFIX}/kubernetes_auth"
 | 
				
			||||||
      )
 | 
					      )
 | 
				
			||||||
 | 
					    elif [[ "${KUBERNETES_PROVIDER}" == "libvirt-coreos" ]]; then
 | 
				
			||||||
 | 
					      auth_config=(
 | 
				
			||||||
 | 
					        "--kubeconfig=${HOME}/.kube/.kubeconfig"
 | 
				
			||||||
 | 
					      )
 | 
				
			||||||
    elif [[ "${KUBERNETES_PROVIDER}" == "conformance_test" ]]; then
 | 
					    elif [[ "${KUBERNETES_PROVIDER}" == "conformance_test" ]]; then
 | 
				
			||||||
      auth_config=(
 | 
					      auth_config=(
 | 
				
			||||||
        "--auth_config=${KUBERNETES_CONFORMANCE_TEST_AUTH_CONFIG:-}"
 | 
					        "--auth_config=${KUBERNETES_CONFORMANCE_TEST_AUTH_CONFIG:-}"
 | 
				
			||||||
@@ -117,12 +121,6 @@ if [[ -z "${AUTH_CONFIG:-}" ]];  then
 | 
				
			|||||||
    else
 | 
					    else
 | 
				
			||||||
      auth_config=()
 | 
					      auth_config=()
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					 | 
				
			||||||
    if [[ "$KUBERNETES_PROVIDER" == "libvirt-coreos" ]]; then
 | 
					 | 
				
			||||||
        host="http://${KUBE_MASTER_IP-}:8080"
 | 
					 | 
				
			||||||
    else
 | 
					 | 
				
			||||||
        host="https://${KUBE_MASTER_IP-}"
 | 
					 | 
				
			||||||
    fi
 | 
					 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
  echo "Conformance Test.  No cloud-provider-specific preparation."
 | 
					  echo "Conformance Test.  No cloud-provider-specific preparation."
 | 
				
			||||||
  KUBERNETES_PROVIDER=""
 | 
					  KUBERNETES_PROVIDER=""
 | 
				
			||||||
@@ -130,13 +128,12 @@ else
 | 
				
			|||||||
    "--auth_config=${AUTH_CONFIG:-}"
 | 
					    "--auth_config=${AUTH_CONFIG:-}"
 | 
				
			||||||
    "--cert_dir=${CERT_DIR:-}"
 | 
					    "--cert_dir=${CERT_DIR:-}"
 | 
				
			||||||
  )
 | 
					  )
 | 
				
			||||||
  host="https://${KUBE_MASTER_IP-}"
 | 
					 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Use the kubectl binary from the same directory as the e2e binary.
 | 
					# Use the kubectl binary from the same directory as the e2e binary.
 | 
				
			||||||
export PATH=$(dirname "${e2e}"):"${PATH}"
 | 
					export PATH=$(dirname "${e2e}"):"${PATH}"
 | 
				
			||||||
"${e2e}" "${auth_config[@]:+${auth_config[@]}}" \
 | 
					"${e2e}" "${auth_config[@]:+${auth_config[@]}}" \
 | 
				
			||||||
  --host="$host" \
 | 
					  --host="https://${KUBE_MASTER_IP-}" \
 | 
				
			||||||
  --provider="${KUBERNETES_PROVIDER}" \
 | 
					  --provider="${KUBERNETES_PROVIDER}" \
 | 
				
			||||||
  --gce_project="${PROJECT:-}" \
 | 
					  --gce_project="${PROJECT:-}" \
 | 
				
			||||||
  --gce_zone="${ZONE:-}" \
 | 
					  --gce_zone="${ZONE:-}" \
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user