@@ -546,7 +546,8 @@ func downloadFile(prefix, sourceUrl string) (string, error) {
546546 return filename , nil
547547}
548548
549- func (c * TestConfig ) deployWithManifest (bosh * BoshCommand , deploymentName string , stemcellVersion string , bwatsVersion string , manifestPath string ) error {
549+ func (c * TestConfig ) deployWithManifest (bosh * BoshCommand , deploymentName string , stemcellVersion string ,
550+ bwatsVersion string , manifestPath string , opsFiles ... string ) error {
550551 manifestProperties := ManifestProperties {
551552 DeploymentName : deploymentName ,
552553 ReleaseName : "bwats-release" ,
@@ -565,36 +566,25 @@ func (c *TestConfig) deployWithManifest(bosh *BoshCommand, deploymentName string
565566 SecurityComplianceApplied : c .SecurityComplianceApplied ,
566567 }
567568
568- var err error
569-
570- if c .RootEphemeralVmType != "" {
571- var pwd string
572- pwd , err = os .Getwd ()
573- Expect (err ).NotTo (HaveOccurred ())
574- opsFilePath := filepath .Join (pwd , "assets" , "root-disk-as-ephemeral.yml" )
575-
576- err = bosh .Run (fmt .Sprintf (
577- "-d %s deploy %s -o %s %s" ,
578- deploymentName ,
579- manifestPath ,
580- opsFilePath ,
581- manifestProperties .toVarsString (),
582- ))
583- } else {
584- err = bosh .Run (fmt .Sprintf ("-d %s deploy %s %s" , deploymentName , manifestPath , manifestProperties .toVarsString ()))
569+ var opsFileArgs strings.Builder
570+ for _ , path := range opsFiles {
571+ opsFileArgs .WriteString (fmt .Sprintf ("-o %s " , path ))
585572 }
586-
587- if err != nil {
588- return err
589- }
590-
591- return nil
573+ return bosh .Run (fmt .Sprintf ("-d %s deploy %s %s %s" , deploymentName , manifestPath , manifestProperties .toVarsString (), opsFileArgs .String ()))
592574}
593575
594576func (c * TestConfig ) deploy (bosh * BoshCommand , deploymentName string , stemcellVersion string , bwatsVersion string ) error {
595577 pwd , err := os .Getwd ()
596578 Expect (err ).NotTo (HaveOccurred ())
597579 manifestPath = filepath .Join (pwd , "assets" , "manifest.yml" )
598580
599- return c .deployWithManifest (bosh , deploymentName , stemcellVersion , bwatsVersion , manifestPath )
581+ var opsFilePaths []string
582+ if c .RootEphemeralVmType != "" {
583+ var pwd string
584+ pwd , err = os .Getwd ()
585+ Expect (err ).NotTo (HaveOccurred ())
586+ opsFilePaths = append (opsFilePaths , filepath .Join (pwd , "assets" , "root-disk-as-ephemeral.yml" ))
587+ }
588+
589+ return c .deployWithManifest (bosh , deploymentName , stemcellVersion , bwatsVersion , manifestPath , opsFilePaths ... )
600590}
0 commit comments