Check for None before creating k8s service

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() service = self.cluster_info.get_service()
if opts.o.debug: if opts.o.debug:
print(f"Sending this service: {service}") 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( service_resp = self.core_api.create_namespaced_service(
namespace=self.k8s_namespace, body=service namespace=self.k8s_namespace, body=service
) )