Skip to content

Commit

Permalink
Merge pull request #28 from globocom/issue#27
Browse files Browse the repository at this point in the history
change rancher strategy
  • Loading branch information
ribeiro-rodrigo committed Mar 19, 2021
2 parents 6917398 + bcf08dd commit a0424f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 7 additions & 1 deletion app/data/source/rancher.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ def get_clusters(self) -> List[Cluster]:
}

filters: dict = self.source.rancher.filters if self.source.rancher.filters else dict()
filters.update({'state': 'active'})

if filters.get('state'):
del filters['state']

url = f"{self.secret.url}/v3/clusters"

Expand All @@ -37,6 +39,10 @@ def _filter_and_map_clusters(self, clusters_list: List[Dict], labels: dict, igno
)

def _filter_cluster(self, cluster_map: dict, labels: dict, ignore: List[str]) -> bool:

if cluster_map['state'] in ['provisioning', 'waiting']:
return False

if ignore and cluster_map['name'] in ignore:
return False

Expand Down
1 change: 0 additions & 1 deletion test/unit_tests/use_case/test_sync_rules.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from typing import List
from unittest import TestCase
from unittest.mock import MagicMock

Expand Down

0 comments on commit a0424f5

Please sign in to comment.