Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have managed resource DeletionPolicy default to 'Delete' #255

Merged
merged 1 commit into from
Mar 16, 2021

Conversation

negz
Copy link
Member

@negz negz commented Mar 15, 2021

Signed-off-by: Nic Cope negz@rk0n.org

Description of your changes

Fixes #205

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

I added a replace to my my provider-gcp go.mod and ran make generate:

--- a/package/crds/cache.gcp.crossplane.io_cloudmemorystoreinstances.yaml
+++ b/package/crds/cache.gcp.crossplane.io_cloudmemorystoreinstances.yaml
@@ -51,7 +51,8 @@ spec:
             description: A CloudMemorystoreInstanceSpec defines the desired state of a CloudMemorystoreInstance.
             properties:
               deletionPolicy:
-                description: DeletionPolicy specifies what will happen to the underlying external when this managed resource is deleted - either "Delete" or "Orphan" the external resource. The "Delete" policy is the default when no policy is specified.
+                default: Delete
+                description: DeletionPolicy specifies what will happen to the underlying external when this managed resource is deleted - either "Delete" or "Orphan" the external resource.
                 enum:
                 - Orphan
                 - Delete
@@ -106,6 +107,8 @@ spec:
                 - tier
                 type: object
               providerConfigRef:
+                default:
+                  name: default
                 description: ProviderConfigReference specifies how the provider that will be used to create, observe, update, and delete this managed resource should be configured.
                 properties:
                   name:

Note the providerConfigRed change is because provider-gcp master hasn't been bumped to include #252 yet.

Signed-off-by: Nic Cope <negz@rk0n.org>
Copy link
Member

@hasheddan hasheddan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @negz!

@negz negz merged commit fe13ff9 into crossplane:master Mar 16, 2021
negz added a commit to negz/conformance that referenced this pull request Jun 12, 2021
crossplane/crossplane-runtime#255

The defaulting of these fields will be introduced in crossplane-runtime v0.14
per the above PR. We'd like to support a transition period during which a
provider may either specify the default or not. Unfortunately it's not easy to
use cmp to test for "must be unset or value X" so I've just ignored the field
for the time being.

Signed-off-by: Nic Cope <negz@rk0n.org>
github-actions bot pushed a commit to crossplane/conformance that referenced this pull request Jun 14, 2021
crossplane/crossplane-runtime#255

The defaulting of these fields will be introduced in crossplane-runtime v0.14
per the above PR. We'd like to support a transition period during which a
provider may either specify the default or not. Unfortunately it's not easy to
use cmp to test for "must be unset or value X" so I've just ignored the field
for the time being.

Signed-off-by: Nic Cope <negz@rk0n.org>
(cherry picked from commit aa8cbd1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Late initialize deletion policy
2 participants