Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update module sigs.k8s.io/controller-tools to v0.14.0 #7461

Merged
merged 12 commits into from
Jan 26, 2024
11 changes: 4 additions & 7 deletions pkg/apis/common/v1/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package v1

import (
"encoding/json"
"reflect"
"unsafe"

"github.com/pkg/errors"
Expand Down Expand Up @@ -60,10 +59,8 @@ func extractAssocConfFromAnnotation(annotations map[string]string, annotationNam
}

func unsafeStringToBytes(s string) []byte {
hdr := *(*reflect.StringHeader)(unsafe.Pointer(&s)) //nolint:govet
return *(*[]byte)(unsafe.Pointer(&reflect.SliceHeader{ //nolint:govet
Data: hdr.Data,
Len: hdr.Len,
Cap: hdr.Len,
}))
if s == "" {
return nil
}
return unsafe.Slice(unsafe.StringData(s), len(s))
thbkrkr marked this conversation as resolved.
Show resolved Hide resolved
}