Skip to content

Commit

Permalink
updates for set-project-id/v0.2 (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mengqi Yu committed Aug 31, 2021
1 parent bb484ad commit 6b59781
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion examples/set-project-id-advanced/.expected/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
testType: eval
includeMetaResources: true
image: gcr.io/kpt-fn/set-project-id:unstable
image: gcr.io/kpt-fn/set-project-id:v0.2
args:
project-id: foo
6 changes: 3 additions & 3 deletions examples/set-project-id-advanced/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ Running `set-project-id` function on the example packed will:
Get the example package by running the following commands:

```shell
kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/set-project-id-advanced
kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/set-project-id-advanced@set-project-id/v0.2
```

### Function invocation

Invoke the function with the following command:

```shell
kpt fn eval set-project-id-advanced --include-meta-resources --image gcr.io/kpt-fn/set-project-id:unstable -- 'project-id=foo'
kpt fn eval set-project-id-advanced --include-meta-resources --image gcr.io/kpt-fn/set-project-id:v0.2 -- 'project-id=foo'
```

### Expected result
Expand All @@ -40,4 +40,4 @@ kpt fn eval set-project-id-advanced --include-meta-resources --image gcr.io/kpt-
IAMServiceAccount resource will include `cnrm.cloud.google.com/project-id:
foo` annotation.

[`set-project-id`]: https://catalog.kpt.dev/set-project-id/v0.1/
[`set-project-id`]: https://catalog.kpt.dev/set-project-id/v0.2/
2 changes: 1 addition & 1 deletion examples/set-project-id-simple/.expected/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
testType: eval
includeMetaResources: true
image: gcr.io/kpt-fn/set-project-id:unstable
image: gcr.io/kpt-fn/set-project-id:v0.2
args:
project-id: foo
6 changes: 3 additions & 3 deletions examples/set-project-id-simple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ Running `set-project-id` function on the example packed will:
Get the example package by running the following commands:

```shell
kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/set-project-id-simple
kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/set-project-id-simple@set-project-id/v0.2
```

### Function invocation

Invoke the function with the following command:

```shell
kpt fn eval set-project-id-simple --include-meta-resources --image gcr.io/kpt-fn/set-project-id:unstable -- 'project-id=foo'
kpt fn eval set-project-id-simple --include-meta-resources --image gcr.io/kpt-fn/set-project-id:v0.2 -- 'project-id=foo'
```

### Expected result
Expand All @@ -33,4 +33,4 @@ kpt fn eval set-project-id-simple --include-meta-resources --image gcr.io/kpt-fn
2. In resources.yaml `my-test-project-second-bucket` StorageBucket resource
will include `cnrm.cloud.google.com/project-id: foo` annotation.

[`set-project-id`]: https://catalog.kpt.dev/set-project-id/v0.1/
[`set-project-id`]: https://catalog.kpt.dev/set-project-id/v0.2/
4 changes: 2 additions & 2 deletions functions/go/set-project-id/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if they are not already set.
set-project-id function is expected to be executed imperatively like:

```shell
kpt fn eval --include-meta-resources --image gcr.io/kpt-fn/set-project-id:unstable -- 'project-id=foo'
kpt fn eval --include-meta-resources --image gcr.io/kpt-fn/set-project-id:v0.2 -- 'project-id=foo'
```

The `set-project-id` function does the following:
Expand Down Expand Up @@ -63,7 +63,7 @@ metadata:
Invoke the function:

```shell
kpt fn eval --include-meta-resources --image gcr.io/kpt-fn/set-project-id:unstable -- 'project-id=foo'
kpt fn eval --include-meta-resources --image gcr.io/kpt-fn/set-project-id:v0.2 -- 'project-id=foo'
```

Kptfile will be updated to the following:
Expand Down
4 changes: 2 additions & 2 deletions functions/go/set-project-id/generated/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions functions/go/set-project-id/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ description: Set project id setter and annotatons if unset.
tags:
- mutator
- GCP
sourceURL: https://github.com/GoogleContainerTools/kpt-functions-catalog/tree/master/functions/go/set-project-id
sourceURL: https://github.com/GoogleContainerTools/kpt-functions-catalog/tree/set-project-id/v0.2/functions/go/set-project-id
examplePackageURLs:
- https://github.com/GoogleContainerTools/kpt-functions-catalog/tree/master/examples/set-project-id-simple
- https://github.com/GoogleContainerTools/kpt-functions-catalog/tree/master/examples/set-project-id-advanced
- https://github.com/GoogleContainerTools/kpt-functions-catalog/tree/set-project-id/v0.2/examples/set-project-id-simple
- https://github.com/GoogleContainerTools/kpt-functions-catalog/tree/set-project-id/v0.2/examples/set-project-id-advanced
emails:
- kpt-team@google.com
license: Apache-2.0
Expand Down

0 comments on commit 6b59781

Please sign in to comment.