Files
odo/pkg/util/httpcache.go
Parthvi Vala 19f8e0ebdb Update devfile/library to support pod-overrides and container-overrides attributes and add integration test for it (#6512)
* Update the Devfile library

* Add test for container-overrides and pod-overrides attributes

Signed-off-by: Parthvi Vala <pvala@redhat.com>

Attempt at fixing CI failures

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Fix CI failure

* Attempt at fixing OC integration test failures

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Use random name in integration test

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Rebase and fix integration test failure

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Make integration test work for podman

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Temp attempt at fixing podman test for GH

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Another attempt at fixing CI test for podman

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* One more attempt at fixing integration test for podman

Signed-off-by: Parthvi Vala <pvala@redhat.com>

Signed-off-by: Parthvi Vala <pvala@redhat.com>
2023-01-23 15:21:18 -05:00

30 lines
638 B
Go

package util
import (
"path/filepath"
"github.com/devfile/library/v2/pkg/testingutil/filesystem"
"k8s.io/klog"
)
// CleanDefaultHTTPCacheDir cleans the default directory used for HTTP caching
func CleanDefaultHTTPCacheDir() error {
return cleanDefaultHTTPCacheDir(filesystem.DefaultFs{})
}
func cleanDefaultHTTPCacheDir(fs filesystem.Filesystem) error {
cacheFiles, err := fs.ReadDir(httpCacheDir)
if err != nil {
return err
}
for _, f := range cacheFiles {
klog.V(4).Infof("Removing cache file %s", f.Name())
err := fs.Remove(filepath.Join(httpCacheDir, f.Name()))
if err != nil {
return err
}
}
return nil
}