-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare release candidate fro apply-replacements/v0.1.1 (#858)
- Loading branch information
Showing
117 changed files
with
2,618 additions
and
654 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
contrib/examples/delete-annotations-simple/.expected/diff.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/resources.yaml b/resources.yaml | ||
index f8ec01d..bcc8f78 100644 | ||
--- a/resources.yaml | ||
+++ b/resources.yaml | ||
@@ -3,8 +3,6 @@ kind: ConfigMap | ||
metadata: | ||
name: the-map | ||
namespace: the-namespace | ||
- annotations: | ||
- annotation-to-delete: "some_value" | ||
data: | ||
some-key: some-value | ||
--- |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: kpt.dev/v1 | ||
kind: Kptfile | ||
metadata: | ||
name: delete-annotations-simple | ||
pipeline: | ||
mutators: | ||
- image: gcr.io/kpt-fn-contrib/delete-annotations:unstable | ||
configMap: | ||
annotationKeys: annotation-to-delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# delete-annotations: Simple Example | ||
|
||
### Overview | ||
|
||
In this example, we will see how to delete annotations on a set of resources in a package/folder | ||
|
||
### Fetch the example package | ||
|
||
Get the example package by running the following commands: | ||
|
||
```shell | ||
$ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/contrib/examples/delete-annotations-simple | ||
``` | ||
|
||
### Function invocation | ||
|
||
Invoke the function by running the following command: | ||
|
||
```shell | ||
$ kpt fn render delete-annotations-simple | ||
``` | ||
|
||
### Expected result | ||
|
||
One of the two resources i.e. `ConfigMap` in `resources.yaml` should have been mutated with the annotation `annotation-to-delete` removed from `metadata.annotations` where as there shouldn't be any changes to the second resource i.e. `Namespace` as it didn't have the supplied annotation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: the-map | ||
namespace: the-namespace | ||
annotations: | ||
annotation-to-delete: "some_value" | ||
data: | ||
some-key: some-value | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: the-namespace |
6 changes: 0 additions & 6 deletions
6
contrib/examples/generate-kpt-pkg-docs-simple/.expected/exec.sh
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# delete-annotations | ||
|
||
## Overview | ||
|
||
<!--mdtogo:Short--> | ||
|
||
Deletes the supplied annotation keys from the resource(s). | ||
|
||
<!--mdtogo--> | ||
|
||
One of the use cases for this function is to help users remove annotations that are | ||
not necessary for deployment across a package. E.g. a user may add annotations to | ||
resource(s) for local processing but those annotations may not be necessary for | ||
deployment or for the functioning of the workload. This function can be used to | ||
clean up such unnecessary annotations before resources are deployed. | ||
|
||
<!--mdtogo:Long--> | ||
|
||
## Usage | ||
|
||
You can delete multiple annotations provided as a comma separated string as part of the function config. | ||
|
||
To execute imperatively: | ||
```shell | ||
$ kpt fn eval -i gcr.io/kpt-fn-contrib/delete-annotations:unstable -- annotationKeys=annotation-to-delete,another-annotation-to-delete | ||
``` | ||
|
||
To execute `delete-annotations` declaratively include the function in kpt package pipeline as follows: | ||
```yaml | ||
... | ||
pipeline: | ||
mutators: | ||
- image: gcr.io/kpt-fn-contrib/delete-annotations:unstable | ||
configMap: | ||
annotationKeys: annotation-to-delete,another-annotation-to-delete | ||
... | ||
``` | ||
|
||
### FunctionConfig | ||
|
||
This function takes the annotation key names as part of the function config parameter | ||
`annotationKeys` where the key names can be provided as comma separated values as follows: | ||
|
||
`annotationKeys=annotation-key-1,annotation-key-2` | ||
|
||
In the previous example, the function will delete annotations `annotation-key-1` and `annotation-key-2` | ||
in all resource(s) where those annotations are present. | ||
|
||
The `annotationKeys` field is a required parameter. | ||
|
||
<!--mdtogo--> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module github.com/GoogleContainerTools/kpt-functions-catalog/contrib/functions/go/delete-annotations | ||
|
||
go 1.17 | ||
|
||
require ( | ||
github.com/GoogleContainerTools/kpt-functions-sdk/go/fn v0.0.0-20220405020624-e5817d5d2014 | ||
github.com/stretchr/testify v1.7.0 | ||
) | ||
|
||
require ( | ||
github.com/PuerkitoBio/purell v1.1.1 // indirect | ||
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/go-errors/errors v1.0.1 // indirect | ||
github.com/go-logr/logr v1.2.0 // indirect | ||
github.com/go-openapi/jsonpointer v0.19.5 // indirect | ||
github.com/go-openapi/jsonreference v0.19.3 // indirect | ||
github.com/go-openapi/swag v0.19.5 // indirect | ||
github.com/kr/text v0.2.0 // indirect | ||
github.com/mailru/easyjson v0.7.0 // indirect | ||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect | ||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect | ||
github.com/pkg/errors v0.9.1 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca // indirect | ||
golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect | ||
golang.org/x/text v0.3.7 // indirect | ||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect | ||
k8s.io/klog/v2 v2.30.0 // indirect | ||
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect | ||
sigs.k8s.io/kustomize/kyaml v0.13.3 // indirect | ||
) |
Oops, something went wrong.