Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support env var to accept dev env host endpoint #47

Merged
merged 1 commit into from
Mar 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading