Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to set the settings.yaml path #45

Open
adrianriobo opened this issue Jul 27, 2022 · 8 comments
Open

Add option to set the settings.yaml path #45

adrianriobo opened this issue Jul 27, 2022 · 8 comments
Assignees
Labels
Medium Priority RFE New Feature Request
Milestone

Comments

@adrianriobo
Copy link
Collaborator

According to documentation currently the settings.yaml file should be filled and placed at ~/cloudwash/settings.yaml. I was expecting that would be the path where cloudwash looks for the file. Instead it is looking for the file at current path where the tool is been executed.

Using the image on a different context like Tekton the execution will end on error:

<<<<<<< Running the cleanup script in DRY RUN mode >>>>>>> 
Traceback (most recent call last):
  File "/opt/app-root/bin/swach", line 8, in <module>
    sys.exit(cleanup_providers())
  File "/opt/app-root/lib64/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/opt/app-root/lib64/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/opt/app-root/lib64/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/app-root/lib64/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/app-root/lib64/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/opt/app-root/lib64/python3.8/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/opt/app-root/lib64/python3.8/site-packages/cloudwash/cli.py", line 87, in ec2
    validate_provider([ctx.command.name](http://ctx.command.name/))
  File "/opt/app-root/lib64/python3.8/site-packages/cloudwash/config.py", line 13, in validate_provider
    f"{provider}.{setting_key}" for setting_key in settings.to_dict()["PROVIDERS"].get(provider)

This is because the working dir (from where swach will be executed) for the tekton task is /tekton/home and the file is at /tekton/home/cloudwash/settings.yaml

So it would be great if a new option for passing the settings file path would be added:

swach --settings-file /custom_path/settings.yaml

@lzap
Copy link

lzap commented Aug 25, 2022

Would be great to have .config/cloudwatch/ in the search path as well, it is where most of us expect config files these days :)

@jyejare jyejare added Medium Priority RFE New Feature Request labels Oct 4, 2022
@jyejare jyejare added this to the Release 1.1.0 milestone Oct 6, 2022
@bovem
Copy link

bovem commented Oct 9, 2022

Hi @adrianriobo Can I work on this issue?

@adrianriobo
Copy link
Collaborator Author

Yeah I guess you can ask @jyejare , I just reported it but can not work on it...I think it would be great if you add this feature

@jyejare
Copy link
Collaborator

jyejare commented Oct 10, 2022

Hey @bovem you are more than welcome for contribution :)

@bovem
Copy link

bovem commented Oct 10, 2022

Thanks, I'll raise a PR.

@jyejare
Copy link
Collaborator

jyejare commented Nov 4, 2022

@bovem Where are you upto on this? Are you still interested ?

@bovem
Copy link

bovem commented Nov 7, 2022

@jyejare Yes, I am working on it. I will create a WIP PR for progress tracking.

I have added the flag but I think I have to make changes to individual provider's cleanup code to add settings path param.

@jyejare
Copy link
Collaborator

jyejare commented Nov 7, 2022

@bovem I would love to see what great stuffs your PR brings up :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Medium Priority RFE New Feature Request
Projects
None yet
Development

No branches or pull requests

4 participants