not proper enum compararison

This commit is contained in:
mr
2026-05-29 10:38:45 +02:00
parent ce110ee634
commit b1429596bb
5 changed files with 25 additions and 5 deletions
+2 -2
View File
@@ -38,8 +38,8 @@ type LiveDatacenter struct {
}
func (r *LiveDatacenter) IsCompatible(service map[string]interface{}) bool {
fmt.Println("COMPARE <", service["infrastructure"], "> <", r.Infrastructure, "> AND <", service["architecture"], "> <", r.Architecture, ">")
return service["infrastructure"] == r.Infrastructure && service["architecture"] == r.Architecture
fmt.Println("COMPARE <", r.Infrastructure.Compare(service["infrastructure"]), "> AND <", service["architecture"], "> <", r.Architecture, ">")
return r.Infrastructure.Compare(service["infrastructure"]) && service["architecture"] == r.Architecture
}
func (d *LiveDatacenter) GetAccessor(request *tools.APIRequest) utils.Accessor {
+1 -1
View File
@@ -42,5 +42,5 @@ func (d *LiveService) GetAccessor(request *tools.APIRequest) utils.Accessor {
func (r *LiveService) IsCompatible(service map[string]interface{}) bool {
fmt.Println("COMPARE <", service["infrastructure"], "> <", r.Infrastructure, ">")
return service["infrastructure"] == r.Infrastructure
return r.Infrastructure.Compare(service["infrastructure"])
}
+2 -2
View File
@@ -28,9 +28,9 @@ type LiveStorage struct {
}
func (r *LiveStorage) IsCompatible(service map[string]interface{}) bool {
fmt.Println("COMPARE <", service["storage_type"], "> <", r.StorageType, ">")
fmt.Println("COMPARE <", r.StorageType.Compare(service["storage_type"]), ">")
return service["storage_type"] == r.StorageType
return r.StorageType.Compare(service["storage_type"])
}
func (d *LiveStorage) GetAccessor(request *tools.APIRequest) utils.Accessor {