mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
fix: compare container specs with equate empty option (nil map == {} map)
This commit is contained in:
+3
-2
@@ -4,11 +4,12 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"maps"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"slices"
|
||||
|
||||
"github.com/distribution/reference"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/google/go-cmp/cmp/cmpopts"
|
||||
"github.com/psviderski/uncloud/internal/machine/api/pb"
|
||||
)
|
||||
|
||||
@@ -213,7 +214,7 @@ func (s *ContainerSpec) Equals(spec ContainerSpec) bool {
|
||||
sortVolumeMounts(orig.VolumeMounts)
|
||||
sortVolumeMounts(spec.VolumeMounts)
|
||||
|
||||
return reflect.DeepEqual(orig, spec)
|
||||
return cmp.Equal(orig, spec, cmpopts.EquateEmpty())
|
||||
}
|
||||
|
||||
func (s *ContainerSpec) Clone() ContainerSpec {
|
||||
|
||||
Reference in New Issue
Block a user