Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
23 changes: 17 additions & 6 deletions cli/cmd/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,23 @@

// Get configuration from the installer
installerConfig := ingressInstaller.GetIngressConfig()
config := &sdk.IngressConfig{
IngressClassName: installerConfig.ClassName,
IngressService: installerConfig.ServiceName,
IngressNamespace: installerConfig.Namespace,
GatewayIPAddress: "",
IngressAnnotations: annotationsMap, // Include annotations for Contour too
var config *sdk.IngressConfig
if localCluster {
config = &sdk.IngressConfig{
IngressClassName: installerConfig.ClassName,
IngressService: installerConfig.ServiceName,
IngressNamespace: installerConfig.Namespace,
GatewayIPAddress: "127.0.0.1",

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note

Do not leave debug code in production
IngressAnnotations: annotationsMap, // Include annotations for Contour too
}
} else {
config = &sdk.IngressConfig{
IngressClassName: installerConfig.ClassName,
IngressService: installerConfig.ServiceName,
IngressNamespace: installerConfig.Namespace,
GatewayIPAddress: "",
IngressAnnotations: annotationsMap, // Include annotations for Contour too
}
}
if err := k8sPlatformClient.UpdateIngressConfig(config, output); err != nil {
return err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@
}
}
None
}

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note

Do not leave debug code in production

async fn reconcile_ingresses(&mut self) -> Result<(), Box<dyn std::error::Error>> {
if let Some(ingresses) = &self.spec.ingresses {
Expand All @@ -569,8 +569,8 @@
let ip_suffix = match self.get_ingress_external_ip().await {
Some(ip) => format!("{}.nip.io", ip),
None => {
log::warn!("Could not determine external IP, using UNAVAILABLE");
"UNAVAILABLE".to_string()
log::warn!("Could not determine external IP, using localhost");
"localhost".to_string()
}
};

Expand Down
8 changes: 4 additions & 4 deletions e2e-tests/fixtures/signalr-fixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
this.localPort = parseInt(process.env.INGRESS_PORT) || 8001;

// Generate the hostname that the ingress expects
// Format: {reaction-name}.drasi.{ip}.nip.io
// For local testing with kind, we can use localhost
this.hostname = `${this.reactionManifest.name}.drasi.localhost`;
// Format: {reaction-name}.drasi.127.0.0.1.nip.io

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note

Do not leave debug code in production
// This matches the format used by drasi ingress init --local-cluster
this.hostname = `${this.reactionManifest.name}.drasi.127.0.0.1.nip.io`;

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note

Do not leave debug code in production

console.log(`SignalRFixture: Using localhost access on port ${this.localPort}`);
console.log(`SignalRFixture: Using ingress access on port ${this.localPort}`);
console.log(`SignalRFixture: Using hostname: ${this.hostname}`);

// Initialize SignalR connection through ingress
Expand Down
3 changes: 1 addition & 2 deletions e2e-tests/kind-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
extraPortMappings:
- containerPort: 30080 # Maps to contour-envoy NodePort 30080
hostPort: 8001
listenAddress: "0.0.0.0"
- containerPort: 30443 # Maps to contour-envoy NodePort 30443
- containerPort: 30443 # Maps to contour-envoy NodePort 30443
hostPort: 443
listenAddress: "0.0.0.0"
Loading