mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-13 05:02:50 +00:00
Fixing references to federated-context and federation-e2e
This commit is contained in:
@@ -22,8 +22,11 @@ KUBE_ROOT=$(readlink -m $(dirname "${BASH_SOURCE}")/../../)
|
|||||||
|
|
||||||
. ${KUBE_ROOT}/federation/cluster/common.sh
|
. ${KUBE_ROOT}/federation/cluster/common.sh
|
||||||
|
|
||||||
if [[ -f "${KUBE_ROOT}/federation/manifests/federated-image.tag" ]]; then
|
tagfile="${KUBE_ROOT}/federation/manifests/federated-image.tag"
|
||||||
export FEDERATION_IMAGE_TAG="$(cat "${KUBE_ROOT}/federation/manifests/federated-image.tag")"
|
if [[ ! -f "$tagfile" ]]; then
|
||||||
|
echo "FATAL: tagfile ${tagfile} does not exist. Make sure that you have run build/push-federation-images.sh"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
export FEDERATION_IMAGE_TAG="$(cat "${KUBE_ROOT}/federation/manifests/federated-image.tag")"
|
||||||
|
|
||||||
create-federation-api-objects
|
create-federation-api-objects
|
||||||
|
@@ -30,7 +30,7 @@ source "${KUBE_ROOT}/cluster/kube-util.sh"
|
|||||||
prepare-e2e
|
prepare-e2e
|
||||||
|
|
||||||
if [[ "${FEDERATION:-}" == "true" ]];then
|
if [[ "${FEDERATION:-}" == "true" ]];then
|
||||||
FEDERATION_NAMESPACE=${FEDERATION_NAMESPACE:-federation-e2e}
|
FEDERATION_NAMESPACE=${FEDERATION_NAMESPACE:-federation}
|
||||||
#TODO(colhom): the last cluster that was created in the loop above is the current context.
|
#TODO(colhom): the last cluster that was created in the loop above is the current context.
|
||||||
# Hence, it will be the cluster that hosts the federated components.
|
# Hence, it will be the cluster that hosts the federated components.
|
||||||
# In the future, we will want to loop through the all the federated contexts,
|
# In the future, we will want to loop through the all the federated contexts,
|
||||||
|
@@ -40,9 +40,13 @@ if [[ "${FEDERATION:-}" == "true" ]];then
|
|||||||
test-setup
|
test-setup
|
||||||
)
|
)
|
||||||
done
|
done
|
||||||
if [[ -f "${KUBE_ROOT}/federation/manifests/federated-image.tag" ]];then
|
tagfile="${KUBE_ROOT}/federation/manifests/federated-image.tag"
|
||||||
export FEDERATION_IMAGE_TAG="$(cat "${KUBE_ROOT}/federation/manifests/federated-image.tag")"
|
if [[ ! -f "$tagfile" ]]; then
|
||||||
|
echo "FATAL: tagfile ${tagfile} does not exist. Make sure that you have run build/push-federation-images.sh"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
export FEDERATION_IMAGE_TAG="$(cat "${KUBE_ROOT}/federation/manifests/federated-image.tag")"
|
||||||
|
|
||||||
"${KUBE_ROOT}/federation/cluster/federation-up.sh"
|
"${KUBE_ROOT}/federation/cluster/federation-up.sh"
|
||||||
else
|
else
|
||||||
test-setup
|
test-setup
|
||||||
|
@@ -27,7 +27,7 @@ import (
|
|||||||
|
|
||||||
// Create/delete cluster api objects
|
// Create/delete cluster api objects
|
||||||
var _ = framework.KubeDescribe("Federation apiserver [Feature:Federation]", func() {
|
var _ = framework.KubeDescribe("Federation apiserver [Feature:Federation]", func() {
|
||||||
f := framework.NewDefaultFederatedFramework("federated-cluster")
|
f := framework.NewDefaultFederatedFramework("federation-cluster")
|
||||||
It("should allow creation of cluster api objects", func() {
|
It("should allow creation of cluster api objects", func() {
|
||||||
framework.SkipUnlessFederated(f.Client)
|
framework.SkipUnlessFederated(f.Client)
|
||||||
|
|
||||||
|
@@ -586,7 +586,7 @@ func (f *Framework) GetUnderlyingFederatedContexts() []E2EContext {
|
|||||||
|
|
||||||
e2eContexts := []E2EContext{}
|
e2eContexts := []E2EContext{}
|
||||||
for _, context := range kubeconfig.Contexts {
|
for _, context := range kubeconfig.Contexts {
|
||||||
if strings.HasPrefix(context.Name, "federation-e2e") {
|
if strings.HasPrefix(context.Name, "federation") {
|
||||||
|
|
||||||
user := kubeconfig.findUser(context.Context.User)
|
user := kubeconfig.findUser(context.Context.User)
|
||||||
if user == nil {
|
if user == nil {
|
||||||
|
@@ -92,7 +92,7 @@ func RegisterFlags() {
|
|||||||
flag.StringVar(&TestContext.KubeConfig, clientcmd.RecommendedConfigPathFlag, os.Getenv(clientcmd.RecommendedConfigPathEnvVar), "Path to kubeconfig containing embedded authinfo.")
|
flag.StringVar(&TestContext.KubeConfig, clientcmd.RecommendedConfigPathFlag, os.Getenv(clientcmd.RecommendedConfigPathEnvVar), "Path to kubeconfig containing embedded authinfo.")
|
||||||
flag.StringVar(&TestContext.KubeContext, clientcmd.FlagContext, "", "kubeconfig context to use/override. If unset, will use value from 'current-context'")
|
flag.StringVar(&TestContext.KubeContext, clientcmd.FlagContext, "", "kubeconfig context to use/override. If unset, will use value from 'current-context'")
|
||||||
flag.StringVar(&TestContext.KubeAPIContentType, "kube-api-content-type", "", "ContentType used to communicate with apiserver")
|
flag.StringVar(&TestContext.KubeAPIContentType, "kube-api-content-type", "", "ContentType used to communicate with apiserver")
|
||||||
flag.StringVar(&federatedKubeContext, "federated-kube-context", "federated-cluster", "kubeconfig context for federated-cluster.")
|
flag.StringVar(&federatedKubeContext, "federated-kube-context", "federation-cluster", "kubeconfig context for federation-cluster.")
|
||||||
|
|
||||||
flag.StringVar(&TestContext.KubeVolumeDir, "volume-dir", "/var/lib/kubelet", "Path to the directory containing the kubelet volumes.")
|
flag.StringVar(&TestContext.KubeVolumeDir, "volume-dir", "/var/lib/kubelet", "Path to the directory containing the kubelet volumes.")
|
||||||
flag.StringVar(&TestContext.CertDir, "cert-dir", "", "Path to the directory containing the certs. Default is empty, which doesn't use certs.")
|
flag.StringVar(&TestContext.CertDir, "cert-dir", "", "Path to the directory containing the certs. Default is empty, which doesn't use certs.")
|
||||||
|
@@ -383,7 +383,7 @@ func SkipUnlessServerVersionGTE(v semver.Version, c discovery.ServerVersionInter
|
|||||||
func SkipUnlessFederated(c *client.Client) {
|
func SkipUnlessFederated(c *client.Client) {
|
||||||
federationNS := os.Getenv("FEDERATION_NAMESPACE")
|
federationNS := os.Getenv("FEDERATION_NAMESPACE")
|
||||||
if federationNS == "" {
|
if federationNS == "" {
|
||||||
federationNS = "federation-e2e"
|
federationNS = "federation"
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := c.Namespaces().Get(federationNS)
|
_, err := c.Namespaces().Get(federationNS)
|
||||||
|
Reference in New Issue
Block a user