- Remove the
cnrm.cloud.google.com/tf2crd: "true"
label from the CRD will turn on SciFi controller. example
- Remove the
cnrm.cloud.google.com/dcl2crd: "true"
label from the CRD will turn on SciFi controller.
-
Copy-paste
./apis/service>/v1alpha1
to./apis/service>/v1beta1
usinggit mv
(this is for PR review) and make sure the./apis/service>/v1alpha1
is still there.- NOTE: if you have more than one resource in your service, only copy the files relevant to your resource for now. You will need to re-run
dev/tasks/generate-crds
for thedeepcopy
file.
- NOTE: if you have more than one resource in your service, only copy the files relevant to your resource for now. You will need to re-run
-
Update the new package version to
v1beta1
-
Update all direct controller imports to use the
v1beta1
api of your resource -
For all the fixtures tests under pkg/test/resourcefixture/testdata make sure your resources use the
v1beta1
version. -
Add
kubebuilder:storageversion
tag tov1beta1
API. example -
Run
dev/taks/generate-crds
to patch your resource's CRD with thev1beta1
version.
-
Add the direct resource to
config/servicemappings
, only specify thename
,kind
anddirect(true)
example -
For resource that is purely direct controller based, add the resource name to
pureDirectResources
inIsPureDirectResource
function in sets.go. -
If the resource is found in the resource-autogen allowlist, remove it from the list.
- In config/samples/resources, create a new
directory for the resource's samples:
mkdir spannerinstance
. - Follow the sample guidelines and create sample(s) for the resource.
Run the sample
go test -v -tags=integration ./config/tests/samples/create -test.run TestAll -run-tests <your_sample_test_name>
your_sample_test_name
is the sample suite directory name, i.e scheduler-job-pubsub
Replace the environment variables to real values before running the tests.
We have a script that generates snippet files for Cloud Code using our samples.
If you created multiple samples (i.e. multiple samples subdirectories), you must
tell the script which sample to use for generating snippets. Update the
preferredSampleForResource
map in
pkg/snippet/snippetgeneration/snippetgeneration.go.
To add or update the Config Connector reference doc, please do the following.
-
Copy one of existing files under scripts/generate-google3-docs/resource-reference/templates, and name it like
spanner_spannerinstance.tmpl
, (i.e., _.tmpl). -
Add a paragraph to briefly introduce the resource at the very top of the file.
-
If additional setup is necessary before the newly added resource can be applied successfully, and the setup can't be done via the Config Connector resources or features, add a "Prerequisites" section to explain the prerequisites steps, E.g. scripts/generate-google3-docs/resource-reference/generated/resource-docs/containerattached/containerattachedcluster.md and scripts/generate-google3-docs/resource-reference/generated/resource-docs/secretmanager/secretmanagersecret.md
-
Update scripts/generate-google3-docs/resource-reference/overview.md by adding a row for your resource to the resource table.
-
Update scripts/generate-google3-docs/resource-reference/_toc.yaml by adding an entry and path to the corresponding API section. If there is no entry for the API, add one.
To generate the new resource doc, run make resource-docs
. You should see your
resource generated to the
scripts/generate-google3-docs/resource-reference/generated/resource-docs
folder.