diff --git a/pkg/server/server.go b/pkg/server/server.go index fd833801..db807116 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -53,6 +53,11 @@ import ( "github.com/oracle/oci-native-ingress-controller/pkg/podreadiness" ) +const ( + // OkeHostOverrideEnvVar is a hidden flag that allows NIC to hit another containerengine endpoint + okeHostOverrideEnvVar = "OKE_HOST_OVERRIDE" +) + func BuildConfig(kubeconfig string) (*rest.Config, error) { if kubeconfig != "" { cfg, err := clientcmd.BuildConfigFromFlags("", kubeconfig) @@ -200,6 +205,11 @@ func setupClient(ctx context.Context, opts types.IngressOpts, k8client clientset klog.Fatalf("failed to load container engine client configuration provider: %v", err) } + // undocumented endpoint for testing in dev + if os.Getenv(okeHostOverrideEnvVar) != "" { + containerEngineClient.BaseClient.Host = os.Getenv(okeHostOverrideEnvVar) + } + lbClient := loadbalancer.New(&ociLBClient) certificatesClient := certificate.New(&ociCertificatesMgmtClient, ociclient.NewCertificateClient(&ociCertificatesClient))