K8s: fix standalone command and add hack scripts (#79052)

Co-authored-by: Charandas Batra <charandas.batra@grafana.com>
This commit is contained in:
Ryan McKinley
2023-12-05 14:31:49 -08:00
committed by GitHub
parent 66df17869d
commit 439edebcd6
21 changed files with 307 additions and 81 deletions

View File

@@ -60,6 +60,24 @@ func (j *Json) Value() (driver.Value, error) {
return j.ToDB()
}
// DeepCopyInto creates a copy by serializing JSON
func (j *Json) DeepCopyInto(out *Json) {
b, err := j.Encode()
if err == nil {
_ = out.UnmarshalJSON(b)
}
}
// DeepCopy will make a deep copy of the JSON object
func (j *Json) DeepCopy() *Json {
if j == nil {
return nil
}
out := new(Json)
j.DeepCopyInto(out)
return out
}
// NewJson returns a pointer to a new `Json` object
// after unmarshaling `body` bytes
func NewJson(body []byte) (*Json, error) {