Skip to content

Commit

Permalink
fix: syntax if not labels founds
Browse files Browse the repository at this point in the history
Signed-off-by: djerfy <djerfy@gmail.com>
  • Loading branch information
djerfy committed Jan 10, 2024
1 parent c7cfcc0 commit 709c349
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/modules/kubernetes/openebs/cstorpoolclusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ def openebsGetCstorpoolclusters(config=None):
}
}

if matchLabels(config['labels']['exclude'], cstorpoolcluster.metadata.labels):
continue

if config['labels']['include'] != []:
if not matchLabels(config['labels']['exclude'], cstorpoolcluster.metadata.labels):
continue
if cstorpoolcluster.get("metadata"):
if cstorpoolcluster['metadata'].get("labels"):
if matchLabels(config['labels']['exclude'], cstorpoolcluster['metadata']['labels']):
continue
if config['labels']['include'] != []:
if not matchLabels(config['labels']['exclude'], cstorpoolcluster['metadata']['labels']):
continue

if any(c['name'] == json['name'] and c['namespace'] == json['namespace'] for c in cstorpoolclusters):
continue
Expand Down

0 comments on commit 709c349

Please sign in to comment.