Check for None before creating k8s service
All checks were successful
Lint Checks / Run linter (push) Successful in 4m1s
K8s Deploy Test / Run deploy test suite on kind/k8s (push) Successful in 10m28s
K8s Deployment Control Test / Run deployment control suite on kind/k8s (push) Successful in 13m7s
Lint Checks / Run linter (pull_request) Successful in 14m12s
Deploy Test / Run deploy test suite (pull_request) Successful in 19m51s
K8s Deploy Test / Run deploy test suite on kind/k8s (pull_request) Successful in 24m55s
K8s Deployment Control Test / Run deployment control suite on kind/k8s (pull_request) Successful in 24m33s
Webapp Test / Run webapp test suite (pull_request) Successful in 20m56s
Smoke Test / Run basic test suite (pull_request) Successful in 22m48s

get_service() returns None when there are no http-proxy routes,
so we must check before calling create_namespaced_service().

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
A. F. Dudley 2026-01-24 16:39:11 -05:00
parent 99db75da19
commit a5b373da26

View File

@ -241,7 +241,7 @@ class K8sDeployer(Deployer):
service = self.cluster_info.get_service()
if opts.o.debug:
print(f"Sending this service: {service}")
if not opts.o.dry_run:
if service and not opts.o.dry_run:
service_resp = self.core_api.create_namespaced_service(
namespace=self.k8s_namespace, body=service
)