fix: ensure validation takes place
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone/push Build is passing
				
			Part of coop-cloud/organising#243 (comment).
This commit is contained in:
		@ -13,6 +13,11 @@ import (
 | 
			
		||||
	"github.com/sirupsen/logrus"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// DontSkipValidation ensures validation is done for compose file loading
 | 
			
		||||
func DontSkipValidation(opts *loader.Options) {
 | 
			
		||||
	opts.SkipValidation = false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// LoadComposefile parse the composefile specified in the cli and returns its Config and version.
 | 
			
		||||
func LoadComposefile(opts Deploy, appEnv map[string]string) (*composetypes.Config, error) {
 | 
			
		||||
	configDetails, err := getConfigDetails(opts.Composefiles, appEnv)
 | 
			
		||||
@ -21,13 +26,12 @@ func LoadComposefile(opts Deploy, appEnv map[string]string) (*composetypes.Confi
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	dicts := getDictsFrom(configDetails.ConfigFiles)
 | 
			
		||||
	config, err := loader.Load(configDetails)
 | 
			
		||||
	config, err := loader.Load(configDetails, DontSkipValidation)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		if fpe, ok := err.(*loader.ForbiddenPropertiesError); ok {
 | 
			
		||||
			return nil, fmt.Errorf("compose file contains unsupported options:\n\n%s",
 | 
			
		||||
				propertyWarnings(fpe.Properties))
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user