func constructPatch()

in webhooks/alloydb-mutating-wh/handlers/pod_tolerations_handler.go [187:203]


func constructPatch(combined []corev1.Toleration) ([]byte, error) {

	patch := []interface{}{
		map[string]interface{}{
			"op":    "replace",
			"path":  "/spec/tolerations",
			"value": combined,
		},
	}

	patchBytes, err := json.Marshal(patch)
	if err != nil {
		return nil, err
	}
	return patchBytes, nil

}