set-project-id: Simple Example #
Overview #
This example shows how
set-project-id
function works.
Running set-project-id
function on the example packed will:
- Set
project-id
setter. - Add
cnrm.cloud.google.com/project-id
annotation on Config Connector resources that don’t have it.
Fetch the example package #
Get the example package by running the following commands:
kpt pkg get https://github.com/kptdev/krm-functions-catalog.git/examples/set-project-id-simple
Function invocation #
Invoke the function with the following command:
kpt fn eval set-project-id-simple --image ghcr.io/kptdev/krm-functions-catalog/set-project-id:latest -- 'project-id=foo'
Expected result #
- File setters.yaml will include
project-id: foo
setter. - In resources.yaml
my-test-project-second-bucket
StorageBucket resource will includecnrm.cloud.google.com/project-id: foo
annotation.