Adding a new direct resource is similar to migrating a Terraform/DCL based Alpha resource to the direct approach, with some additional challenges that you don't have the cheap option to verify each step until you have all the basic infra (API, Mapper, Controller) ready.
Developing a pure direct resource requires you to have every step setup to validate your change. Basically you need the API and mapper to write the direct controller, then you can use the controller to write the MockGCP tests. This reverses the deep-dives step 1 to the end compared to other scenarios. Thus, you first PR shall include
- A basic API from the auto-generated code, including all required fields deep-dives Step 2
- A basic direct controller deep-dives Step 3 and Step 4.
- A basic test suite to run against the real GCP (Step 1)
- Code shall come from the auto-generate code.
- Only the basic test suite is required, full and other test suites can comment out as unimplemented fields.
_http.log
and_generated_object_<resource>.golden.yaml
shall verify the basic controller is functioning correctly.- Commit the real GCP record and mockGCP record as contiguous git-commits, so the PR reviewers can verify.
Once the basic infra is done, you can add full field test coverage to prepare promoting the resource to Beta.
- The
_http.log
shall have minimum changes. - The
_generated_object_<resource>.golden.yaml
,create.yaml
andupdate.yaml
shall not change
- Add all API fields.
- Add full test suites.
For Beta resource, we require the following conditions to meet.
- No
/*NOTYET .. */
in the api and mapping. - We require the MockGCP test suits to cover all fields.
- We require the roundtrip fuzz tests to cover all the fields in
spec
andstatus.observedState
fields example - The version has to start from v1alpha1.