Look for more than just roles when detecting project type for Ansible-based Operators
@@ -39,6 +39,8 @@ const (
managerMainFile = "cmd" + fsep + "manager" + fsep + mainFile
buildDockerfile = "build" + fsep + "Dockerfile"
rolesDir = "roles"
+ requirementsFile = "requirements.yml"
+ moleculeDir = "molecule"
helmChartsDir = "helm-charts"
goModFile = "go.mod"
@@ -208,7 +210,15 @@ func IsOperatorGo() bool {
func IsOperatorAnsible() bool {
stat, err := os.Stat(rolesDir)
- return (err == nil && stat.IsDir()) || os.IsExist(err)
+ if (err == nil && stat.IsDir()) || os.IsExist(err) {
+ return true
+ }
+ stat, err = os.Stat(moleculeDir)
+ if (err == nil && stat.IsDir()) || os.IsExist(err) {
+ return true
+ }
+ _, err = os.Stat(requirementsFile)
+ return err == nil || os.IsExist(err)
}
func IsOperatorHelm() bool {
