diff --git a/docs/develop-resources/api-validations.md b/docs/develop-resources/api-conventions/validations.md similarity index 100% rename from docs/develop-resources/api-validations.md rename to docs/develop-resources/api-conventions/validations.md diff --git a/docs/develop-resources/guides/2-define-apis.md b/docs/develop-resources/guides/2-define-apis.md index 11ddca6bf35..3696d03f3ee 100644 --- a/docs/develop-resources/guides/2-define-apis.md +++ b/docs/develop-resources/guides/2-define-apis.md @@ -92,7 +92,7 @@ According to the above principles, you shall decide how to process the following * Add the parent field and mark as required - * See detailed [requirements and example](https://github.com/yuwenma/k8s-config-connector/blob/CR-validation/docs/develop-resources/api-validations.md#rule-3-parent) (TODO: update link) + * See detailed [requirements and example](../api-conventions/validations.md#rule-3-parent) (TODO: update link) * Replace any field that is a resource reference to `Ref `and add the resource to `./apis/refs` if not exist.` ` @@ -100,7 +100,7 @@ According to the above principles, you shall decide how to process the following * Add **non** output-only fields to `spec`, excluding imperative fields. -* Add other CR validations according to the [Direct Resource API Validation Guide](https://github.com/yuwenma/k8s-config-connector/blob/CR-validation/docs/develop-resources/api-validations.md) (TODO: update link) +* Add other CR validations according to the [Direct Resource API Validation Guide](../api-conventions/validations.md) * (Only for TF/DCL Beta) Existing `spec` and `status` fields should still be there, except the [output-only spec](https://paste.googleplex.com/4694303066030080) should be removed. diff --git a/docs/develop-resources/scenarios/alpha-to-beta.md b/docs/develop-resources/scenarios/alpha-to-beta.md index f451c04f16b..0be05c13522 100644 --- a/docs/develop-resources/scenarios/alpha-to-beta.md +++ b/docs/develop-resources/scenarios/alpha-to-beta.md @@ -7,5 +7,4 @@ If the resource is TF-based or DCL-based, you shall migrate them to [the Direct ## From Direct Alpha to Beta -If the resource is already a Direct resource, you can follow [step 5.2](https://github.com/yuwenma/k8s-config-connector/blob/scifi-guide/docs/develop-resources/guides/5-releases.md#52-bump-from-v1alpha1-to-v1beta1) (TODO: update the link) - and submit a single PR \ No newline at end of file +If the resource is already a Direct resource, you can follow [step 5.2](../guides/5-releases.md#52-bump-from-v1alpha1-to-v1beta1) and submit a single PR \ No newline at end of file diff --git a/docs/develop-resources/scenarios/migrate-tf-resource-alpha.md b/docs/develop-resources/scenarios/migrate-tf-resource-alpha.md index 61aa99a5477..2e80230c28c 100644 --- a/docs/develop-resources/scenarios/migrate-tf-resource-alpha.md +++ b/docs/develop-resources/scenarios/migrate-tf-resource-alpha.md @@ -2,7 +2,7 @@ ## Add MockGCP tests -Follow [Step 1](https://github.com/yuwenma/k8s-config-connector/blob/scifi-guide/docs/develop-resources/guides/1-add-mockgcp-tests.md) +Follow [Step 1](../guides/1-add-mockgcp-tests.md) 1. The 1st PR should set the `create.yaml `and `update.yaml `fields the same value for both test suites, with `_http.log `telling the matching HTTP request/response, and `_generated_object_.golden.yaml` telling the output-only fields. @@ -16,7 +16,7 @@ Follow [Step 1](https://github.com/yuwenma/k8s-config-connector/blob/scifi-guide ## Add API -Follow [Step 2](https://github.com/yuwenma/k8s-config-connector/blob/scifi-guide/docs/develop-resources/guides/2-define-apis.md) +Follow [Step 2](../guides/2-define-apis.md) The PR shall contain the types and deepcopy codes. It shall follow the Direct resource recommended styles and conventions. (TODO add the link) **It can change the existing fields since this is a Alpha resource**. @@ -30,13 +30,13 @@ The PR shall contain the types and deepcopy codes. It shall follow the Direct re ## Add the mapper -Follow [Step 3](https://github.com/yuwenma/k8s-config-connector/blob/scifi-guide/docs/develop-resources/guides/3-add-mapper.md) +Follow [Step 3](../guides/3-add-mapper.md) This PR adds the Direct mapper. You can do this together with the previous step or the next step if no additional manual changes are needed. ## Add the controller -Follow [Step 4](https://github.com/yuwenma/k8s-config-connector/blob/scifi-guide/docs/develop-resources/guides/4-add-controller.md). +Follow [Step 4](../guides/4-add-controller.md). * Use the `KCC_USE_DIRECT_RECONCILERS` flag [exampe](https://github.com/GoogleCloudPlatform/k8s-config-connector/blob/0bbac86ace6ab2f4051b574f026d5fe47fa05b75/dev/tasks/run-e2e#L27). This will override the tf2crd and dcl2crd label to force using the Direct controller. diff --git a/docs/develop-resources/scenarios/migrate-tf-resource-beta.md b/docs/develop-resources/scenarios/migrate-tf-resource-beta.md index a68e0707b68..cee8e92e70c 100644 --- a/docs/develop-resources/scenarios/migrate-tf-resource-beta.md +++ b/docs/develop-resources/scenarios/migrate-tf-resource-beta.md @@ -2,7 +2,7 @@ ## Add MockGCP tests -Follow [Step 1](https://github.com/yuwenma/k8s-config-connector/blob/scifi-guide/docs/develop-resources/guides/1-add-mockgcp-tests.md) +Follow [Step 1](../guides/1-add-mockgcp-tests.md) 1. The 1st PR should set the `create.yaml `and `update.yaml `fields the same value for both test suites, with `_http.log `telling the matching HTTP request/response, and `_generated_object_.golden.yaml` telling the output-only fields. @@ -16,7 +16,7 @@ Follow [Step 1](https://github.com/yuwenma/k8s-config-connector/blob/scifi-guide ## Add the backward compatible API -Follow [Step 2](https://github.com/yuwenma/k8s-config-connector/blob/scifi-guide/docs/develop-resources/guides/2-define-apis.md) +Follow [Step 2](../guides/2-define-apis.md) The PR shall contain the types and deepcopy codes. It shall make modifications to make sure the CRDs are the same, because Beta resource has to be backward compatible. @@ -34,13 +34,13 @@ Note: *Do not use* `excluded_resources`, we want the presubmit to validate the e ## Add the backward compatible mapper -Follow [Step 3](https://github.com/yuwenma/k8s-config-connector/blob/scifi-guide/docs/develop-resources/guides/3-add-mapper.md) +Follow [Step 3](../guides/3-add-mapper.md) The PR adds the Direct mapper. You can do this together with the previous step or the next step if no additional manual changes are needed. Using `/*NOTYET .. */` to comment out new functions, same as the last step. ## Add the direct controller -Follow [Step 4](https://github.com/yuwenma/k8s-config-connector/blob/scifi-guide/docs/develop-resources/guides/4-add-controller.md) +Follow [Step 4](../guides/4-add-controller.md) * Use the `KCC_USE_DIRECT_RECONCILERS` flag [exampe](https://github.com/GoogleCloudPlatform/k8s-config-connector/blob/0bbac86ace6ab2f4051b574f026d5fe47fa05b75/dev/tasks/run-e2e#L27). diff --git a/docs/develop-resources/scenarios/new-field.md b/docs/develop-resources/scenarios/new-field.md index 674d4e0ceea..17ec2aa45e3 100644 --- a/docs/develop-resources/scenarios/new-field.md +++ b/docs/develop-resources/scenarios/new-field.md @@ -36,6 +36,6 @@ The apis directory the contains the existing API types of the resource. ## 2. Resolve resource reference -If the newly added fields contain resource references, you should have a second PR to update the resource reference, following [4.2 resolve resource references](https://github.com/yuwenma/k8s-config-connector/blob/scifi-guide/docs/develop-resources/guides/4-add-controller.md#42-resolve-resource-references) (TODO: update the link) +If the newly added fields contain resource references, you should have a second PR to update the resource reference, following [4.2 resolve resource references](../guides/4-add-controller.md#42-resolve-resource-references) (TODO: update the link) Add a new test suite with `dependencies.yaml` to cover the referenced fields. diff --git a/docs/develop-resources/scenarios/new-resource.md b/docs/develop-resources/scenarios/new-resource.md index 088726b5404..b534d1a051c 100644 --- a/docs/develop-resources/scenarios/new-resource.md +++ b/docs/develop-resources/scenarios/new-resource.md @@ -14,7 +14,7 @@ Different than other scenarios, developing a pure Direct resource requires you t 1. A basic API from the auto-generated code, including all required fields (Step 2) 2. A basic Direct controller (Step 3 and 4). -3. Define `create.yaml` and `update.yaml` to run against the real GCP (Step 1 [record real gcp](https://github.com/yuwenma/k8s-config-connector/blob/scifi-guide/docs/develop-resources/guides/1-add-mockgcp-tests.md#record-real-gcp-log)) (TODO update link) +3. Define `create.yaml` and `update.yaml` to run against the real GCP (Step 1 [record real gcp](../guides/1-add-mockgcp-tests.md#record-real-gcp-log)) (TODO update link) ### PR reviews diff --git a/go.sum b/go.sum index e2c260a2b7d..dc3e7258abc 100644 --- a/go.sum +++ b/go.sum @@ -53,11 +53,8 @@ cloud.google.com/go/dataform v0.10.0/go.mod h1:0NKefI6v1ppBEDnwrp6gOMEA3s/RH3ypL cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -<<<<<<< HEAD cloud.google.com/go/firestore v1.16.0 h1:YwmDHcyrxVRErWcgxunzEaZxtNbc8QoFYA/JOEwDPgc= cloud.google.com/go/firestore v1.16.0/go.mod h1:+22v/7p+WNBSQwdSwP57vz47aZiY+HrDkrOsJNhk7rg= -======= ->>>>>>> b23a6e28a (doc: add direct resource API validation guide) cloud.google.com/go/iam v1.2.0 h1:kZKMKVNk/IsSSc/udOb83K0hL/Yh/Gcqpz+oAkoIFN8= cloud.google.com/go/iam v1.2.0/go.mod h1:zITGuWgsLZxd8OwAlX+eMFgZDXzBm7icj1PVTYG766Q= cloud.google.com/go/longrunning v0.6.0 h1:mM1ZmaNsQsnb+5n1DNPeL0KwQd9jQRqSqSDEkBZr+aI=