Fix registry secret created in wrong namespace (#998)
Publish / Build and publish (push) Failing after 0s
Details
Deploy Test / Run deploy test suite (push) Failing after 0s
Details
Webapp Test / Run webapp test suite (push) Failing after 0s
Details
Lint Checks / Run linter (push) Failing after 0s
Details
Smoke Test / Run basic test suite (push) Failing after 0s
Details
Publish / Build and publish (push) Failing after 0s
Details
Deploy Test / Run deploy test suite (push) Failing after 0s
Details
Webapp Test / Run webapp test suite (push) Failing after 0s
Details
Lint Checks / Run linter (push) Failing after 0s
Details
Smoke Test / Run basic test suite (push) Failing after 0s
Details
`create_registry_secret()` was hardcoded to use the "default" namespace, but pods are deployed to the spec's configured namespace. The secret must be in the same namespace as the pods for `imagePullSecrets` to work. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Reviewed-on: https://git.vdb.to/cerc-io/stack-orchestrator/pulls/998 Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>pull/738/head
parent
e7483bc7d1
commit
33d3474d7d
|
|
@ -577,7 +577,7 @@ def _generate_and_store_secrets(config_vars: dict, deployment_name: str):
|
|||
return secrets
|
||||
|
||||
|
||||
def create_registry_secret(spec: Spec, deployment_name: str) -> Optional[str]:
|
||||
def create_registry_secret(spec: Spec, deployment_name: str, namespace: str = "default") -> Optional[str]:
|
||||
"""Create K8s docker-registry secret from spec + environment.
|
||||
|
||||
Reads registry configuration from spec.yml and creates a Kubernetes
|
||||
|
|
@ -586,6 +586,7 @@ def create_registry_secret(spec: Spec, deployment_name: str) -> Optional[str]:
|
|||
Args:
|
||||
spec: The deployment spec containing image-registry config
|
||||
deployment_name: Name of the deployment (used for secret naming)
|
||||
namespace: Kubernetes namespace to create the secret in
|
||||
|
||||
Returns:
|
||||
The secret name if created, None if no registry config
|
||||
|
|
@ -633,7 +634,6 @@ def create_registry_secret(spec: Spec, deployment_name: str) -> Optional[str]:
|
|||
return None
|
||||
|
||||
v1 = client.CoreV1Api()
|
||||
namespace = "default"
|
||||
|
||||
k8s_secret = client.V1Secret(
|
||||
metadata=client.V1ObjectMeta(name=secret_name),
|
||||
|
|
|
|||
|
|
@ -504,7 +504,7 @@ class K8sDeployer(Deployer):
|
|||
# Create registry secret if configured
|
||||
from stack_orchestrator.deploy.deployment_create import create_registry_secret
|
||||
|
||||
create_registry_secret(self.cluster_info.spec, self.cluster_info.app_name)
|
||||
create_registry_secret(self.cluster_info.spec, self.cluster_info.app_name, self.k8s_namespace)
|
||||
|
||||
self._create_volume_data()
|
||||
self._create_deployment()
|
||||
|
|
|
|||
Loading…
Reference in New Issue