Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
louiseschmidtgen committed Jun 13, 2024
1 parent bf4d38d commit 9fb12ac
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
17 changes: 9 additions & 8 deletions src/k8s/pkg/k8sd/features/contour/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ func ApplyIngress(ctx context.Context, snap snap.Snap, ingress types.Ingress, _
if _, err := m.Apply(ctx, chartDefaultTLS, helm.StatePresent, values); err != nil {
return fmt.Errorf("failed to install the delegation resource for default TLS secret: %w", err)
}
} else {
if _, err := m.Apply(ctx, chartDefaultTLS, helm.StateDeleted, nil); err != nil {
return fmt.Errorf("failed to uninstall the delegation resource for default TLS secret: %w", err)
}
return nil
}

if _, err := m.Apply(ctx, chartDefaultTLS, helm.StateDeleted, nil); err != nil {
return fmt.Errorf("failed to uninstall the delegation resource for default TLS secret: %w", err)

}

return nil
Expand All @@ -89,10 +91,9 @@ func applyCommonContourCRDS(ctx context.Context, snap snap.Snap, enabled bool) e
if _, err := m.Apply(ctx, chartCommonContourCRDS, helm.StatePresent, nil); err != nil {
return fmt.Errorf("failed to install common CRDS: %w", err)
}
} else {
if _, err := m.Apply(ctx, chartCommonContourCRDS, helm.StateDeleted, nil); err != nil {
return fmt.Errorf("failed to uninstall common CRDS: %w", err)
}
return nil
if _, err := m.Apply(ctx, chartCommonContourCRDS, helm.StateDeleted, nil); err != nil {
return fmt.Errorf("failed to uninstall common CRDS: %w", err)
}

return nil
Expand Down
1 change: 0 additions & 1 deletion tests/integration/tests/test_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def test_gateway(session_instance: harness.Instance):

assert gateway_http_port is not None, "No ingress nodePort found."

LOG.info(f"Gateway http port is {gateway_http_port}")
util.stubbornly(retries=5, delay_s=5).on(session_instance).until(
lambda p: "Welcome to nginx!" in p.stdout.decode()
).exec(["curl", f"localhost:{gateway_http_port}"])
4 changes: 1 addition & 3 deletions tests/integration/tests/test_ingress.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,14 @@ def test_ingress(session_instance: List[harness.Instance]):
services = json.loads(p.stdout.decode())
for svc in services["items"]:
if "ingress" in svc["metadata"]["name"]:
LOG.info(f"Found service {svc['metadata']['name']}")
for port in svc["spec"]["ports"]:
if port["port"] == 80:
ingress_http_port = port.get("nodePort")
ingress_http_port = port["nodePort"]
break
if ingress_http_port:
break

assert ingress_http_port is not None, "No ingress nodePort found."
LOG.info(f"Found http port: {ingress_http_port}")

manifest = MANIFESTS_DIR / "ingress-test.yaml"
session_instance.exec(
Expand Down

0 comments on commit 9fb12ac

Please sign in to comment.