Browse Source

check the assume yes publish flag command before the presence of bind mounts

Signed-off-by: Guillaume Lours <[email protected]>
Guillaume Lours 3 months ago
parent
commit
c420bc44c4
1 changed files with 3 additions and 3 deletions
  1. 3 3
      pkg/compose/publish.go

+ 3 - 3
pkg/compose/publish.go

@@ -236,6 +236,9 @@ func (s *composeService) preChecks(project *types.Project, options api.PublishOp
 	if ok, err := s.checkOnlyBuildSection(project); !ok || err != nil {
 		return false, err
 	}
+	if options.AssumeYes {
+		return true, nil
+	}
 	bindMounts := s.checkForBindMount(project)
 	if len(bindMounts) > 0 {
 		fmt.Println("you are about to publish bind mounts declaration within your OCI artifact.\n" +
@@ -251,9 +254,6 @@ func (s *composeService) preChecks(project *types.Project, options api.PublishOp
 			return false, err
 		}
 	}
-	if options.AssumeYes {
-		return true, nil
-	}
 	detectedSecrets, err := s.checkForSensitiveData(project)
 	if err != nil {
 		return false, err