mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-19 17:42:17 +08:00
* Add missing API switch for GHES (#200) * Vidya reddy/prettier code (#203) * switch none deployment strategy to basic (#204) * switch none deployment strategy to basic * update readme * update deployment strategy fallthrough logic * comment fixed * add disclaimer for basic strategy only supporting deploy action * Hari/beautify logs (#206) * Logging changes for deploy * Logging Changes with group * format check changes * Add ncc build to build script (#208) Co-authored-by: Vidya Reddy <vidyareddy@microsoft.com> * Logging Changes for Promote, Reject actions (#207) * add clean function (#211) * Added Traffic split annotations (#215) * Added Traffic split annotations * traffic split - blueGreen deployment * traffic split - canary deployment * Traffic split annotations - canary deployment * updated Readme and action.yml * Traffic split - canary deployment * clean code * Clean code * Clean code * Create annotation object * Updated Readme and action.yml * Spelling correction Co-authored-by: Vidya Reddy <vidyareddy@microsoft.com> * Swap annotation key to actions.github.com prefix (#216) * Private Cluster functionality (#214) * Fixed Blue/Green Strategy Ingress Route-Method Glitch (#217) * Added some tests, not sure what else to try but gonna think of more examples * forgot some files * reverted package-lock.json * Added empty dir test * Cleaned up some extra spaces * Add node modules and compiled JavaScript from main * forgot to actually include functionality * removed unnecessary files * Update .gitignore * Update .gitignore * Update .gitignore * thx david * renamed searchFilesRec * integrations test fix * added examples to README * added note about depth * added additional note * removed ticks * changed version string * removed conflict on readme * Added tests for bluegreen helper and resolved issue with ingress not being read correctly, still have to figure out why new services aren't showing up * resolved services name issue * looks functional, beginning refactor now * refactored deploy methods for type error * Removed refactor comments * prettier * implemented Oliver's feedback * prettier * added optional chaining operator * removed refactor comment Co-authored-by: Jaiveer Katariya <jaiveerkatariya@Jaiveers-MacBook-Pro.local> Co-authored-by: Oliver King <oking3@uncc.edu> Co-authored-by: Jaiveer Katariya <jaiveerkatariya@Jaiveers-MBP.lan> * Add node modules and compiled JavaScript from main Co-authored-by: nv35 <76777923+nv35@users.noreply.github.com> Co-authored-by: Vidya <59590642+Vidya2606@users.noreply.github.com> Co-authored-by: David Gamero <david340804@gmail.com> Co-authored-by: Hariharan Subramanian <105889062+hsubramanianaks@users.noreply.github.com> Co-authored-by: Vidya Reddy <vidyareddy@microsoft.com> Co-authored-by: Oliver King <oking3@uncc.edu> Co-authored-by: Marcus-Hines <marcus.chris.hines@gmail.com> Co-authored-by: Jaiveer Katariya <35347859+jaiveerk@users.noreply.github.com> Co-authored-by: Jaiveer Katariya <jaiveerkatariya@Jaiveers-MacBook-Pro.local> Co-authored-by: Jaiveer Katariya <jaiveerkatariya@Jaiveers-MBP.lan>
144 lines
4.6 KiB
Markdown
144 lines
4.6 KiB
Markdown
# graceful-fs
|
|
|
|
graceful-fs functions as a drop-in replacement for the fs module,
|
|
making various improvements.
|
|
|
|
The improvements are meant to normalize behavior across different
|
|
platforms and environments, and to make filesystem access more
|
|
resilient to errors.
|
|
|
|
## Improvements over [fs module](https://nodejs.org/api/fs.html)
|
|
|
|
* Queues up `open` and `readdir` calls, and retries them once
|
|
something closes if there is an EMFILE error from too many file
|
|
descriptors.
|
|
* fixes `lchmod` for Node versions prior to 0.6.2.
|
|
* implements `fs.lutimes` if possible. Otherwise it becomes a noop.
|
|
* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or
|
|
`lchown` if the user isn't root.
|
|
* makes `lchmod` and `lchown` become noops, if not available.
|
|
* retries reading a file if `read` results in EAGAIN error.
|
|
|
|
On Windows, it retries renaming a file for up to one second if `EACCESS`
|
|
or `EPERM` error occurs, likely because antivirus software has locked
|
|
the directory.
|
|
|
|
## USAGE
|
|
|
|
```javascript
|
|
// use just like fs
|
|
var fs = require('graceful-fs')
|
|
|
|
// now go and do stuff with it...
|
|
fs.readFile('some-file-or-whatever', (err, data) => {
|
|
// Do stuff here.
|
|
})
|
|
```
|
|
|
|
## Sync methods
|
|
|
|
This module cannot intercept or handle `EMFILE` or `ENFILE` errors from sync
|
|
methods. If you use sync methods which open file descriptors then you are
|
|
responsible for dealing with any errors.
|
|
|
|
This is a known limitation, not a bug.
|
|
|
|
## Global Patching
|
|
|
|
If you want to patch the global fs module (or any other fs-like
|
|
module) you can do this:
|
|
|
|
```javascript
|
|
// Make sure to read the caveat below.
|
|
var realFs = require('fs')
|
|
var gracefulFs = require('graceful-fs')
|
|
gracefulFs.gracefulify(realFs)
|
|
```
|
|
|
|
This should only ever be done at the top-level application layer, in
|
|
order to delay on EMFILE errors from any fs-using dependencies. You
|
|
should **not** do this in a library, because it can cause unexpected
|
|
delays in other parts of the program.
|
|
|
|
## Changes
|
|
|
|
This module is fairly stable at this point, and used by a lot of
|
|
things. That being said, because it implements a subtle behavior
|
|
change in a core part of the node API, even modest changes can be
|
|
extremely breaking, and the versioning is thus biased towards
|
|
bumping the major when in doubt.
|
|
|
|
The main change between major versions has been switching between
|
|
providing a fully-patched `fs` module vs monkey-patching the node core
|
|
builtin, and the approach by which a non-monkey-patched `fs` was
|
|
created.
|
|
|
|
The goal is to trade `EMFILE` errors for slower fs operations. So, if
|
|
you try to open a zillion files, rather than crashing, `open`
|
|
operations will be queued up and wait for something else to `close`.
|
|
|
|
There are advantages to each approach. Monkey-patching the fs means
|
|
that no `EMFILE` errors can possibly occur anywhere in your
|
|
application, because everything is using the same core `fs` module,
|
|
which is patched. However, it can also obviously cause undesirable
|
|
side-effects, especially if the module is loaded multiple times.
|
|
|
|
Implementing a separate-but-identical patched `fs` module is more
|
|
surgical (and doesn't run the risk of patching multiple times), but
|
|
also imposes the challenge of keeping in sync with the core module.
|
|
|
|
The current approach loads the `fs` module, and then creates a
|
|
lookalike object that has all the same methods, except a few that are
|
|
patched. It is safe to use in all versions of Node from 0.8 through
|
|
7.0.
|
|
|
|
### v4
|
|
|
|
* Do not monkey-patch the fs module. This module may now be used as a
|
|
drop-in dep, and users can opt into monkey-patching the fs builtin
|
|
if their app requires it.
|
|
|
|
### v3
|
|
|
|
* Monkey-patch fs, because the eval approach no longer works on recent
|
|
node.
|
|
* fixed possible type-error throw if rename fails on windows
|
|
* verify that we *never* get EMFILE errors
|
|
* Ignore ENOSYS from chmod/chown
|
|
* clarify that graceful-fs must be used as a drop-in
|
|
|
|
### v2.1.0
|
|
|
|
* Use eval rather than monkey-patching fs.
|
|
* readdir: Always sort the results
|
|
* win32: requeue a file if error has an OK status
|
|
|
|
### v2.0
|
|
|
|
* A return to monkey patching
|
|
* wrap process.cwd
|
|
|
|
### v1.1
|
|
|
|
* wrap readFile
|
|
* Wrap fs.writeFile.
|
|
* readdir protection
|
|
* Don't clobber the fs builtin
|
|
* Handle fs.read EAGAIN errors by trying again
|
|
* Expose the curOpen counter
|
|
* No-op lchown/lchmod if not implemented
|
|
* fs.rename patch only for win32
|
|
* Patch fs.rename to handle AV software on Windows
|
|
* Close #4 Chown should not fail on einval or eperm if non-root
|
|
* Fix isaacs/fstream#1 Only wrap fs one time
|
|
* Fix #3 Start at 1024 max files, then back off on EMFILE
|
|
* lutimes that doens't blow up on Linux
|
|
* A full on-rewrite using a queue instead of just swallowing the EMFILE error
|
|
* Wrap Read/Write streams as well
|
|
|
|
### 1.0
|
|
|
|
* Update engines for node 0.6
|
|
* Be lstat-graceful on Windows
|
|
* first
|