Skip to content

Commit

Permalink
Merge pull request #47 from oracle/oke-host-override
Browse files Browse the repository at this point in the history
Support env var to accept dev env host endpoint
  • Loading branch information
vbhargav875 authored Mar 24, 2024
2 parents 46ad7f3 + 181cf47 commit 7f2fd2a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 7f2fd2a

Please sign in to comment.