Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JsonPatch ¶
type JsonPatch struct { // OP is the operation to be performed. It's a string and can be one of "add", "remove", or "replace". OP string `json:"op"` // Path is the string that contains the location in the JSON document where the operation is performed. Path string `json:"path"` // Value is the actual value that is used by the operation. // It's a pointer to a NodeCondition object from the "k8s.io/api/core/v1" package. Value *corev1.NodeCondition `json:"value"` }
JsonPatch represents a JSON Patch operation. JSON Patch is a format (identified by the media type "application/json-patch+json") for expressing a sequence of operations to apply to a JavaScript Object Notation (JSON) document. It is suitable for use with HTTP PATCH requests.
func GenerateJsonPath ¶
func GenerateJsonPath(index int, remove bool, oldConditions, newConditions *corev1.NodeCondition) JsonPatch
GenerateJsonPath is a function that generates a JSON Patch operation based on the provided parameters. It takes four parameters: - index: an integer that represents the index of the condition in the conditions array. - remove: a boolean that indicates whether the operation is a remove operation. - oldConditions: a pointer to a NodeCondition object that represents the old conditions. - newConditions: a pointer to a NodeCondition object that represents the new conditions.