Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMPINFRA-1605, add labels to k8s workloads #3479

Merged
merged 6 commits into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions paasta_tools/kubernetes_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1588,6 +1588,8 @@ def get_kubernetes_metadata(self, git_sha: str) -> V1ObjectMeta:
"paasta.yelp.com/service": self.get_service(),
"paasta.yelp.com/instance": self.get_instance(),
"paasta.yelp.com/git_sha": git_sha,
"paasta.yelp.com/pool": self.get_pool(),
"yelp.com/owner": "compute_infra_platform_experience",
paasta_prefixed("autoscaled"): str(
self.is_autoscaling_enabled()
).lower(),
Expand Down
6 changes: 4 additions & 2 deletions tests/test_kubernetes_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1899,6 +1899,8 @@ def test_get_kubernetes_metadata(self, is_autoscaled, autoscaled_label):
"paasta.yelp.com/instance": mock_get_instance.return_value,
"paasta.yelp.com/service": mock_get_service.return_value,
"paasta.yelp.com/autoscaled": autoscaled_label,
"paasta.yelp.com/pool": "default",
"yelp.com/owner": "compute_infra_platform_experience",
},
name="kurupt-fm",
)
Expand Down Expand Up @@ -3642,7 +3644,7 @@ def test_warning_big_bounce():
job_config.format_kubernetes_app().spec.template.metadata.labels[
"paasta.yelp.com/config_sha"
]
== "config80007736"
== "config52071d00"
), "If this fails, just change the constant in this test, but be aware that deploying this change will cause every service to bounce!"


Expand Down Expand Up @@ -3688,7 +3690,7 @@ def test_warning_big_bounce_routable_pod():
job_config.format_kubernetes_app().spec.template.metadata.labels[
"paasta.yelp.com/config_sha"
]
== "config81e5b468"
== "configb47c4ff7"
), "If this fails, just change the constant in this test, but be aware that deploying this change will cause every smartstack-registered service to bounce!"


Expand Down