Skip to content

Commit

Permalink
Type annotation for KubeDeployment.deployment_version; remove unneces…
Browse files Browse the repository at this point in the history
…sary deployment_version property on Application
  • Loading branch information
EvanKrall committed Apr 1, 2024
1 parent f8bda91 commit 05ea9f6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
5 changes: 0 additions & 5 deletions paasta_tools/kubernetes/application/controller_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from paasta_tools.kubernetes_tools import pod_disruption_budget_for_service_instance
from paasta_tools.kubernetes_tools import update_deployment
from paasta_tools.kubernetes_tools import update_stateful_set
from paasta_tools.utils import DeploymentVersion
from paasta_tools.utils import load_system_paasta_config


Expand Down Expand Up @@ -195,10 +194,6 @@ def ensure_pod_disruption_budget(
namespace=pdr.metadata.namespace,
)

@property
def deployment_version(self):
return DeploymentVersion(self.git_sha, self.image_version)


class DeploymentWrapper(Application):
def deep_delete(
Expand Down
2 changes: 1 addition & 1 deletion paasta_tools/kubernetes_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class KubeDeployment(NamedTuple):
replicas: Optional[int]

@property
def deployment_version(self):
def deployment_version(self) -> DeploymentVersion:
return DeploymentVersion(self.git_sha, self.image_version)


Expand Down
5 changes: 4 additions & 1 deletion paasta_tools/setup_kubernetes_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
from paasta_tools.metrics import metrics_lib
from paasta_tools.utils import decompose_job_id
from paasta_tools.utils import DEFAULT_SOA_DIR
from paasta_tools.utils import DeploymentVersion
from paasta_tools.utils import InvalidJobNameError
from paasta_tools.utils import load_system_paasta_config
from paasta_tools.utils import NoConfigurationForServiceError
Expand Down Expand Up @@ -244,7 +245,9 @@ def setup_kube_deployments(
for deployment in existing_kube_deployments
}

existing_deployment_versions: Dict[Tuple[str, str, str], List[str]] = {}
existing_deployment_versions: Dict[
Tuple[str, str, str], List[DeploymentVersion]
] = {}
for deployment in existing_kube_deployments:
existing_deployment_versions.setdefault(
(deployment.service, deployment.instance, deployment.namespace), []
Expand Down

0 comments on commit 05ea9f6

Please sign in to comment.