gosimple: S1004

Signed-off-by: Jake Sanders <i@am.so-aweso.me>
This commit is contained in:
Jake Sanders 2021-05-04 14:21:38 +01:00
parent aca56a7168
commit e7219a155f
No known key found for this signature in database
GPG Key ID: 7E708D7933B84690

View File

@ -42,7 +42,7 @@ func ValidateOrderUpdate(_ *admissionv1.AdmissionRequest, oldObj, newObj runtime
func ValidateOrderSpecUpdate(old, new cmacme.OrderSpec, fldPath *field.Path) field.ErrorList {
el := field.ErrorList{}
if len(old.Request) > 0 && bytes.Compare(old.Request, new.Request) != 0 {
if len(old.Request) > 0 && !bytes.Equal(old.Request, new.Request) {
el = append(el, field.Forbidden(fldPath.Child("request"), "field is immutable once set"))
}
return el
@ -59,7 +59,7 @@ func ValidateOrderStatusUpdate(old, new cmacme.OrderStatus, fldPath *field.Path)
el = append(el, field.Forbidden(fldPath.Child("finalizeURL"), "field is immutable once set"))
}
// once the Certificate has been issued, it cannot be changed
if len(old.Certificate) > 0 && bytes.Compare(old.Certificate, new.Certificate) != 0 {
if len(old.Certificate) > 0 && !bytes.Equal(old.Certificate, new.Certificate) {
el = append(el, field.Forbidden(fldPath.Child("certificate"), "field is immutable once set"))
}