Skip to content

Commit a10150e

Browse files
committed
add badges
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
1 parent 893e310 commit a10150e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)
2-
31
# Kubernetes object matcher
42

3+
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/cisco-open/k8s-objectmatcher/ci.yaml?style=flat-square)
4+
[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/mod/github.com/cisco-open/k8s-objectmatcher)
5+
56
K8S-ObjectMatcher is a Golang library which helps to match Kubernetes objects.
67

78
### Motivation
@@ -16,7 +17,7 @@ There is a legacy version of the lib, that is now deprecated and documented here
1617

1718
The library uses the same method that `kubectl apply` does under the hood to calculate a patch using the [three way merge](http://www.drdobbs.com/tools/three-way-merging-a-look-under-the-hood/240164902) method.
1819
However for this to work properly we need to keep track of the last applied version of our object, let's call it the `original`. Unfortunately Kubernetes does
19-
not keep track of our previously submitted object versions, but we can put it into an annotation like `kubectl apply` does.
20+
not keep track of our previously submitted object versions, but we can put it into an annotation like `kubectl apply` does.
2021
Next time we query the `current` state of the object from the API Server we can extract the `original` version from the annotation.
2122

2223
Once we have the the `original`, the `current` and our new `modified` object in place the library will take care of the rest.
@@ -72,7 +73,7 @@ Example:
7273
opts := []patch.CalculateOption{
7374
patch.IgnoreStatusFields(),
7475
}
75-
76+
7677
patchResult, err := patch.DefaultPatchMaker.Calculate(existing.(runtime.Object), newObject.(runtime.Object), opts...)
7778
if err != nil {
7879
return err
@@ -89,7 +90,7 @@ This CalculateOption clears volumeClaimTemplate fields from both objects before
8990

9091
#### IgnorePdbSelector
9192

92-
Checks `selector` fields of PDB objects before comparing and removes them if they match. `reflect.DeepEquals` is used for the equality check.
93+
Checks `selector` fields of PDB objects before comparing and removes them if they match. `reflect.DeepEquals` is used for the equality check.
9394
This is required because map fields using `patchStrategy:"replace"` will always diff regardless if they are otherwise equal.
9495

9596
#### IgnoreField("field-name-to-ignore")

0 commit comments

Comments
 (0)