EDITD / kubetools

:nut_and_bolt: Kubetools is a tool and processes for developing and deploying microservices to Kubernetes.
MIT License
13 stars 2 forks source link

[BUG] - dry flag breaks #122

Closed ttecles closed 2 years ago

ttecles commented 2 years ago

Describe the bug when running a command with --dry flag it breaks:

(image-store) user@ubuntu ~/apps/image-store (add-sentry)$ kubetools --context <context> deploy --default-registry <registry> --dry -y add-sentry .
--> Ensuring Docker images built for image-store=c470baf
    All Docker images for image-store commit c470baf exists, skipping build

/usr/lib/python3/dist-packages/urllib3/connectionpool.py:999: InsecureRequestWarning: Unverified HTTPS request is being made to host 'rancher.edtd.net'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  warnings.warn(
--> Unexpected exception: TypeError('_dry_deploy_loop() takes 4 positional arguments but 5 were given',)
Traceback (most recent call last):
  File "/home/user/.local/bin/kubetools", line 5, in <module>
    from kubetools.cli.__main__ import main
  File "/home/user/.local/lib/python3.8/site-packages/kubetools/cli/__main__.py", line 9, in <module>
    run_cli(cli_bootstrap)
  File "/home/user/.local/lib/python3.8/site-packages/kubetools/main.py", line 14, in run_cli
    func()
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/kubetools/cli/deploy.py", line 179, in deploy
    return _dry_deploy_loop(build, namespace, services, deployments, jobs)
TypeError: _dry_deploy_loop() takes 4 positional arguments but 5 were given

To Reproduce Steps to reproduce the behavior: create a kubetools.yml like this:

name: image-store
minKubetoolsVersion: 8.0.1

containerContexts:
  image_store:
    build:
      dockerfile: docker/Dockerfile
    dev:
      volumes:
        - ./:/opt/image_store

deployments:
  image-store:
    maxReplicas: 1
    containers:
      webserver:
        containerContext: image_store
        command: [ 'uvicorn', 'image_store.entrypoints.fastapi_app:app', '--host', '0.0.0.0', '--port', '80' ]
        ports:
          - 80
        probes:
          httpGet:
            path: /ping
        dev:
          command: [ 'uvicorn', 'image_store.entrypoints.fastapi_app:app', '--host', '0.0.0.0', '--port', '80', '--reload' ]

Expected behavior We should not expect an error on the screen

ttecles commented 2 years ago

issue fixed with #123