func()

in pkg/dubboctl/internal/kube/object.go [50:76]


func (obj *Object) IsEqual(another *Object) bool {
	if obj == nil {
		return another == nil
	}
	if another == nil {
		return false
	}
	if obj.Namespace != another.Namespace ||
		obj.Name != another.Name || obj.Group != another.Group || obj.Kind != another.Kind {
		return false
	}
	if obj.Unstructured() == nil {
		return another.Unstructured() == nil
	}
	if another.Unstructured() == nil {
		return false
	}
	objJson, err := obj.Unstructured().MarshalJSON()
	if err != nil {
		return false
	}
	anotherJson, err := another.Unstructured().MarshalJSON()
	if err != nil {
		return false
	}
	return bytes.Equal(objJson, anotherJson)
}