Skip to content

Commit

Permalink
Merge pull request #8 from citizensadvice/fix/stale-serviceaccount-token
Browse files Browse the repository at this point in the history
Fix stale serviceaccount tokens
  • Loading branch information
michelesr authored May 19, 2022
2 parents ff543bc + 2d794f6 commit 7a87f63
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions schedule_scaling/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ def get_kube_api():
return pykube.HTTPClient(pykube.KubeConfig.from_env())


api = get_kube_api()


def deployments_to_scale():
""" Getting the deployments configured for schedule scaling """
deployments = []
Expand Down Expand Up @@ -193,6 +190,9 @@ def scale_hpa(name, namespace, min_replicas, max_replicas):
if __name__ == "__main__":
logging.info("Main loop started")
while True:
global api
api = get_kube_api()

logging.debug("Waiting until the next minute")
sleep(get_wait_sec())
logging.debug("Getting deployments")
Expand Down

0 comments on commit 7a87f63

Please sign in to comment.