faas-cli
faas-cli copied to clipboard
chore: additional tidying and use ctx propogation to enable docker build cancellation
Copy the execute package into the project to add the require context passing. This can be pulled back later once we are happy with the implementation.
Streamline some of the watch and local-run code to use the native Context object instead of the Cancel object.
Use a WaitGroup to ensure that each run of the onChange is finished before starting the next invocation. This avoids a potential race-condition due to cmd object being a shared pointer and the context being cancelled and replaced.
Reduce the number of FAAS_DEBUG checks required for logging, by creating a shared logger package for this.
Motivation and Context
- [ ] I have raised an issue to propose this change (required) This is mostly a continuation of https://github.com/openfaas/faas-cli/pull/970
How Has This Been Tested?
I have manually tested this with the local-run
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I've read the CONTRIBUTION guide
- [x] I have signed-off my commits with
git commit -s - [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.