add apply patch type (#579)

This commit is contained in:
Boshi Lian
2021-03-11 09:34:22 -08:00
committed by GitHub
parent 655a42c6bd
commit 1b831ecf78
2 changed files with 7 additions and 0 deletions

View File

@@ -37,6 +37,8 @@ namespace k8s
return MediaTypeHeaderValue.Parse("application/merge-patch+json; charset=utf-8");
case V1Patch.PatchType.StrategicMergePatch:
return MediaTypeHeaderValue.Parse("application/strategic-merge-patch+json; charset=utf-8");
case V1Patch.PatchType.ApplyPatch:
return MediaTypeHeaderValue.Parse("application/apply-patch+yaml; charset=utf-8");
default:
throw new ArgumentOutOfRangeException(nameof(body.Type), "");
}

View File

@@ -27,6 +27,11 @@ namespace k8s.Models
/// content type application/strategic-merge-patch+json
/// </summary>
StrategicMergePatch,
/// <summary>
/// content type application/apply-patch+yaml
/// </summary>
ApplyPatch,
}
public PatchType Type { get; private set; }