Skip to content

Commit

Permalink
Add logic to handle when poddefaults use matchExpression
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Kalbach <tkalbach@athenahealth.com>
  • Loading branch information
boarder7395 committed Jun 11, 2024
1 parent 222bec2 commit 07a5a40
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ def get_poddefaults(namespace):
# forms
contents = []
for pd in pod_defaults["items"]:
label = list(pd["spec"]["selector"]["matchLabels"].keys())[0]
selector = pd["spec"]["selector"]
if "matchExpressions" in selector:
label = selector["matchExpressions"][0]["key"]
else:
label = list(selector["matchLabels"].keys())[0]
if "desc" in pd["spec"]:
desc = pd["spec"]["desc"]
else:
Expand Down

0 comments on commit 07a5a40

Please sign in to comment.