...

Source file src/github.com/redhat-developer/odo/tests/helper/helper_experimental.go

Documentation: github.com/redhat-developer/odo/tests/helper

     1  package helper
     2  
     3  import (
     4  	"os"
     5  
     6  	_ "github.com/onsi/ginkgo/v2"
     7  	. "github.com/onsi/gomega"
     8  
     9  	"github.com/redhat-developer/odo/pkg/odo/cli/feature"
    10  )
    11  
    12  // EnableExperimentalMode enables the experimental mode, so that experimental features of odo can be used.
    13  func EnableExperimentalMode() {
    14  	err := os.Setenv(feature.OdoExperimentalModeEnvVar, "true")
    15  	Expect(err).ShouldNot(HaveOccurred())
    16  }
    17  
    18  // ResetExperimentalMode disables the experimental mode.
    19  //
    20  // Note that calling any experimental feature of odo right is expected to error out if experimental mode is not enabled.
    21  func ResetExperimentalMode() {
    22  	if _, ok := os.LookupEnv(feature.OdoExperimentalModeEnvVar); ok {
    23  		err := os.Unsetenv(feature.OdoExperimentalModeEnvVar)
    24  		Expect(err).ShouldNot(HaveOccurred())
    25  	}
    26  }
    27  

View as plain text