-
Notifications
You must be signed in to change notification settings - Fork 76
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
Add Support for Observe Only Resources #435
Add Support for Observe Only Resources #435
Conversation
5765a02
to
b0faff5
Compare
- Bump "up" to v0.16.1 Signed-off-by: Alper Rifat Ulucinar <[email protected]>
b0faff5
to
60acefe
Compare
/test-examples="examples/network/virtualnetwork.yaml" |
We can ignore check-examples job failure. The related issue about this: #433 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @ulucinar 🙏
} | ||
|
||
type ResourceGroupParameters struct { | ||
|
||
// The Azure Region where the Resource Group should exist. Changing this forces a new Resource Group to be created. | ||
// +kubebuilder:validation:Required | ||
Location *string `json:"location" tf:"location,omitempty"` | ||
// +kubebuilder:validation:Optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, should this be an identifier field 🤔
Could a resource group be observed without location?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This resource's external-name configuration is as follows:
config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .external_name }}"),
, which does not refer to the location
argument. I think this explains why it's not treated as an identifier argument.
I've also verified that using the following manifest, we can import an existing Azure resource group:
apiVersion: azure.upbound.io/v1beta1
kind: ResourceGroup
metadata:
annotations:
crossplane.io/external-name: example-resources
name: example-import
spec:
managementPolicy: ObserveOnly
forProvider: {}
The imported resource's manifest is:
apiVersion: azure.upbound.io/v1beta1
kind: ResourceGroup
metadata:
annotations:
crossplane.io/external-name: example-resources
creationTimestamp: "2023-04-18T17:12:21Z"
generation: 1
name: example-import
resourceVersion: "122209"
uid: e59544e2-04ca-49d7-92c3-47b73b339ecc
spec:
deletionPolicy: Delete
forProvider: {}
managementPolicy: ObserveOnly
providerConfigRef:
name: default
status:
atProvider:
id: /subscriptions/.../resourceGroups/example-resources
location: westeurope
tags:
provisioner: crossplane
conditions:
- lastTransitionTime: "2023-04-18T17:12:29Z"
reason: Available
status: "True"
type: Ready
- lastTransitionTime: "2023-04-18T17:12:29Z"
reason: ReconcileSuccess
status: "True"
type: Synced
Looks like we are fine.
…PostgreSQL.dataprotection to check-examples.py Signed-off-by: Alper Rifat Ulucinar <[email protected]>
Description of your changes
This PR adds support for Observe Only resources. It also bumps
up
tov0.16.1
.Related PR: crossplane-contrib/provider-upjet-aws#672
I have:
make reviewable test
to ensure this PR is ready for review.How has this code been tested
Provisioned and orphaned a
network.VirtualNetwork
resource. Then I tried importing it while running the provider with the newly introduced alpha feature disabled. As expected, I observed themanagementPolicy is set to a non-default value but the feature is not enabled
Synced == false
status condition. Then, I enabled the new alpha feature by passing--enable-management-policies
command-line option to the provider and successfully imported the managed resource using the following manifest:The full manifest of the imported resource (
spec.managementPolicy: ObserveOnly
) looks like the following:Update and performance regression tests have been done in the context of crossplane-contrib/provider-upjet-aws#672.