func constructPatch()

in webhooks/alloydb-nodeselector-mwh/handlers/pod_nodeselector_handler.go [178:194]


func constructPatch(combined map[string]string) ([]byte, error) {

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

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

}