fix-insecure-flag (#2072)
Signed-off-by: tcase44 <toblerone.tc@gmail.com> Co-authored-by: tcase44 <toblerone.tc@gmail.com>
This commit is contained in:
parent
f0f828b2fd
commit
3df6442bd1
|
|
@ -190,6 +190,11 @@ func (r *Remote) Fetch(path string, cacheDirOpt ...string) (string, error) {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Block remote access if insecure features are disabled and the source is remote
|
||||||
|
if disableInsecureFeatures && IsRemote(path) {
|
||||||
|
return "", fmt.Errorf("remote sources are disabled due to 'HELMFILE_DISABLE_INSECURE_FEATURES'")
|
||||||
|
}
|
||||||
|
|
||||||
srcDir := fmt.Sprintf("%s://%s/%s", u.Scheme, u.Host, u.Dir)
|
srcDir := fmt.Sprintf("%s://%s/%s", u.Scheme, u.Host, u.Dir)
|
||||||
file := u.File
|
file := u.File
|
||||||
|
|
||||||
|
|
@ -532,9 +537,6 @@ func ParseS3Url(s3URL string) (string, string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewRemote(logger *zap.SugaredLogger, homeDir string, fs *filesystem.FileSystem) *Remote {
|
func NewRemote(logger *zap.SugaredLogger, homeDir string, fs *filesystem.FileSystem) *Remote {
|
||||||
if disableInsecureFeatures {
|
|
||||||
panic("Remote sources are disabled due to 'DISABLE_INSECURE_FEATURES'")
|
|
||||||
}
|
|
||||||
remote := &Remote{
|
remote := &Remote{
|
||||||
Logger: logger,
|
Logger: logger,
|
||||||
Home: homeDir,
|
Home: homeDir,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue