gitops-engine icon indicating copy to clipboard operation
gitops-engine copied to clipboard

Enable consumers of gitops-engine API to specify an alternative temp directory for generated manifests, as an alternative '/dev/shm'

Open jgwest opened this issue 7 months ago • 1 comments

See parent issue for details: https://github.com/argoproj/gitops-engine/issues/614

This PR:

  • When calling gitops-engine, you will now need to explicitly define the temporary path to write kubectl manifests to:
    • Add new parameter tmpManifestPath to public APIs:
      • NewEngine in pkg/engine/engine.go
      • NewClusterCache in `pkg/cache/cluster.go
    • In both cases, when calling these functions, you now must specify where to store temporary manifest files that are generated
    • If you wish to preserve the existing behaviour, just use the value from calling io.TempPathUseDevShmIfAvailable() (see examples in this PR)
  • Updates existing gitops-engine code to use new API
  • Preserves the existing behaviour of the code: code and tests that were previously using /dev/shm will continue to do so
  • Updates pkg/utils/io/io.go API to make it more explicit about behaviour

jgwest avatar Jul 17 '24 08:07 jgwest