Created
April 1, 2022 15:40
-
-
Save jsturtevant/94b82838fbc8950449157496ae541244 to your computer and use it in GitHub Desktop.
Run a sub project of capz e2e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//go:build e2e | |
// +build e2e | |
package main | |
import ( | |
"context" | |
"sigs.k8s.io/cluster-api-provider-azure/test/e2e" | |
. "github.com/onsi/gomega" | |
"sigs.k8s.io/cluster-api/test/framework/clusterctl" | |
infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" | |
expv1 "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" | |
clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1beta1" | |
"k8s.io/apimachinery/pkg/runtime" | |
"sigs.k8s.io/cluster-api/test/framework" | |
) | |
func Fail(message string, callerSkip ...int) { | |
panic(message) | |
} | |
func main() { | |
// needed for ginkgo | |
RegisterFailHandler(Fail) | |
kubeconfigPath := "cluster-api-provider-azure/kubeconfig.e2e" | |
kubeconfigPathWorkload := "cluster-api-provider-azure/kubeconfig.windows.ctrd" | |
clustername := "capz-conf-xi3nvp" | |
configPath := "cluster-api-provider-azure/test/e2e/config/azure-dev-envsubst.yaml" | |
bootstrapClusterProxy, _ := framework.NewClusterProxy("bootstrap", kubeconfigPath, initScheme(), []framework.Option{}...).(framework.ClusterProxy) | |
workloadproxy, _ := framework.NewClusterProxy("azure", kubeconfigPathWorkload, initScheme(), []framework.Option{}...).(framework.ClusterProxy) | |
e2eConfig := clusterctl.LoadE2EConfig(context.TODO(), clusterctl.LoadE2EConfigInput{ConfigPath: configPath}) | |
e2e.ConfigureGmsa(context.Background(), workloadproxy, bootstrapClusterProxy, clustername, clustername, e2eConfig) | |
} | |
func initScheme() *runtime.Scheme { | |
scheme := runtime.NewScheme() | |
framework.TryAddDefaultSchemes(scheme) | |
infrav1.AddToScheme(scheme) | |
expv1.AddToScheme(scheme) | |
clusterv1exp.AddToScheme(scheme) | |
return scheme | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment