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

Add the Location Tag Binding resource #686

Merged
merged 9 commits into from
Jan 15, 2025
Merged

Conversation

akerone
Copy link
Contributor

@akerone akerone commented Dec 27, 2024

Description of your changes

Fixes #661

I have:

  • Read and followed Crossplane's [contribution process].
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Manual testing results

This is my first PR and I'm following the Configuring a resource guide as best as I can.

@turkenf
Copy link
Collaborator

turkenf commented Dec 27, 2024

/test-examples="examples/tags/v1beta1/locationtagbinding.yaml"

@akerone
Copy link
Contributor Author

akerone commented Dec 30, 2024

Hi,

I've changed references to an example project number to &{project_id} and &{project_number} like it appears in examples/tags/v1beta1/tagbinding.yaml

@turkenf
Copy link
Collaborator

turkenf commented Jan 2, 2025

/test-examples="examples/tags/v1beta1/locationtagbinding.yaml"

@akerone
Copy link
Contributor Author

akerone commented Jan 2, 2025

Hi,

I've just realized that all resources in the TagBinding example have the manual-intervention annotation, so manual testing will be required here too. Since this is my first time, it'll probably take me a while to set up the test environment. Sorry about that.

@akerone
Copy link
Contributor Author

akerone commented Jan 15, 2025

Manual testing results:

Apply:

$ k apply -f examples/tags/v1beta1/locationtagbinding.yaml
locationtagbinding.tags.gcp.upbound.io/binding created
v2service.cloudrun.gcp.upbound.io/default created
tagkey.tags.gcp.upbound.io/key created
tagvalue.tags.gcp.upbound.io/value created
$ k get managed
NAME                                        SYNCED   READY   EXTERNAL-NAME   AGE
v2service.cloudrun.gcp.upbound.io/default   True     True    default         93s

NAME                                             SYNCED   READY   EXTERNAL-NAME                                                                                                                                          AGE
locationtagbinding.tags.gcp.upbound.io/binding   True     True    REDACTED_LOCATION/tagBindings/%2F%2Frun.googleapis.com%2Fprojects%2FREDACTED%2Flocations%2FREDACTED_LOCATION%2Fservices%2Fdefault/tagValues/REDACTED   94s

NAME                             SYNCED   READY   EXTERNAL-NAME       AGE
tagkey.tags.gcp.upbound.io/key   True     True    tagKeys/REDACTED    94s

NAME                                 SYNCED   READY   EXTERNAL-NAME       AGE
tagvalue.tags.gcp.upbound.io/value   True     True    tagValues/REDACTED  94s
$ k annotate managed --all upjet.upbound.io/test=true --overwrite
locationtagbinding.tags.gcp.upbound.io/binding annotated
tagkey.tags.gcp.upbound.io/key annotated
tagvalue.tags.gcp.upbound.io/value annotated
The V2Service "default" is invalid: spec: Invalid value: "object": invalid data, expected a map for the provided schema with type=object evaluating rule: spec.forProvider.template is a required parameter
$ k get locationtagbindings.tags.gcp.upbound.io/binding -o yaml
(...)
  conditions:
  - lastTransitionTime: "2025-01-15T11:42:23Z"
    reason: ReconcileSuccess
    status: "True"
    type: Synced
  - lastTransitionTime: "2025-01-15T11:42:25Z"
    reason: Available
    status: "True"
    type: Ready
  - lastTransitionTime: "2025-01-15T11:42:24Z"
    reason: Success
    status: "True"
    type: LastAsyncOperation
  - lastTransitionTime: "2025-01-15T11:56:59Z"
    reason: UpToDate
    status: "True"
    type: Test

Import:

# make run stopped
$ k --subresource=status patch locationtagbindings.tags.gcp.upbound.io/binding --type=merge -p '{"status":{"conditions":[]}}'
locationtagbinding.tags.gcp.upbound.io/binding patched
$ k describe locationtagbindings.tags.gcp.upbound.io binding
(...)
Status:
  At Provider:
    Id:         REDACTED_LOCATION/tagBindings/%2F%2Frun.googleapis.com%2Fprojects%2FREDACTED_PROJECT%2Flocations%2FREDACTED_LOCATION%2Fservices%2Fdefault/tagValues/REDACTED_TAG_VALUE
(...)
# make run started
$ k get locationtagbindings.tags.gcp.upbound.io/binding -o yaml
(...)
status:
  atProvider:
    id: REDACTED_LOCATION/tagBindings/%2F%2Frun.googleapis.com%2Fprojects%2FREDACTED_PROJECT%2Flocations%2FREDACTED_LOCATION%2Fservices%2Fdefault/tagValues/REDACTED_TAG_VALUE
(...)
  conditions:
  - lastTransitionTime: "2025-01-15T12:21:08Z"
    reason: Available
    status: "True"
    type: Ready
  - lastTransitionTime: "2025-01-15T12:21:08Z"
    reason: UpToDate
    status: "True"
    type: Test
  - lastTransitionTime: "2025-01-15T12:21:08Z"
    reason: Success
    status: "True"
    type: LastAsyncOperation
  - lastTransitionTime: "2025-01-15T12:21:08Z"
    reason: ReconcileSuccess
    status: "True"
    type: Synced

Delete:

# Visually checked on console.cloud.google.com/run that the Cloud Run Service has the Tag
$ k delete locationtagbindings.tags.gcp.upbound.io binding 
locationtagbinding.tags.gcp.upbound.io "binding" deleted
# Visually checked on console.cloud.google.com/run that the Cloud Run Service NO LONGER has the Tag

Copy link
Collaborator

@turkenf turkenf left a comment

Choose a reason for hiding this comment

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

Thank you, @akerone! 🎉

I really appreciate the detailed explanation of all the changes and test results you provided in this PR. Your clear documentation of the manual testing process was especially helpful. Even though this is your first contribution, you followed the guide diligently and did an excellent job. 👏 I'm looking forward to seeing more contributions from you in the future! 😊

@turkenf turkenf merged commit 2af8688 into crossplane-contrib:main Jan 15, 2025
8 checks passed
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.

Request for Location Tag Binding (google_tags_location_tag_binding) resource
2 participants