Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Commit

Permalink
Remove openshift variables
Browse files Browse the repository at this point in the history
  • Loading branch information
xtuchyna committed Jan 20, 2021
1 parent 56dca04 commit 4aaa54e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ def __init__(self, github: Github, organizations: List[str] = None, repositories
self.repos = repositories
self.github_repos: Set[Repository] = set()

self.oc = OpenShift()

self._initialize_repositories_from_organizations()
self._initialize_repositories_from_raw()

Expand Down Expand Up @@ -93,23 +91,21 @@ def _initialize_repositories_from_raw(self):
def schedule_for_mi_analysis(self) -> None:
"""Schedule workflows for mi analysis."""
for repo in self.github_repos:
workflow_id = self.oc.schedule_mi_workflow(repository=repo.full_name)
workflow_id = OpenShift().schedule_mi_workflow(repository=repo.full_name)
_LOGGER.info("Scheduled mi with id %r", workflow_id)

def schedule_for_kebechet_analysis(self):
"""Schedule workflows for kebechet analysis."""
for repo in self.github_repos:
workflow_id = self.oc.schedule_mi_workflow(repository=repo.full_name, entities=KEBECHET_ENTITIES)
workflow_id = OpenShift().schedule_mi_workflow(repository=repo.full_name, entities=KEBECHET_ENTITIES)
_LOGGER.info("Scheduled mi-kebechet analysis with id %r", workflow_id)


def main():
"""MI-Scheduler entrypoint."""
gh = Github(login_or_token=GITHUB_ACCESS_TOKEN)

oc = OpenShift()

repos, orgs = oc.get_mi_repositories_and_organizations()
repos, orgs = OpenShift().get_mi_repositories_and_organizations()
Schedule(gh, orgs, repos).schedule_for_mi_analysis()

graph = GraphDatabase()
Expand Down

0 comments on commit 4aaa54e

Please sign in to comment.