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 "last" element handling in nested arrays #80

Merged

Conversation

CezarAntohe83
Copy link
Contributor

@CezarAntohe83 CezarAntohe83 commented Oct 11, 2023

Description

Our cluster-registry integration, for the Edge GW to CGW migration tools, needs monitoring for various client CRs, during the migration process, especially their CR status, but also other parameters as well.
Sometimes the status is an array of statuses, so we would need to monitor only the last status entry, since that's the valid one for us.
We don't have the length for those arrays apriori, so we cannot call the ServiceMetadataWatcher with:

  • objectReference:
    apiVersion: pdm.adobe.io/v1
    kind: RequestProcessing
    name: maia-e2e-test-rp-mircea
    watchedFields:
    • dst: policy_id
      src: spec.authPolicies[X].policyId
      where X is a number, the last in the array, so we would need a "last" string in the watchedFields, to represent the last monitored entry in the array, no matter its length.
      This PR adds the "last" string in the CR handling.

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@CezarAntohe83 CezarAntohe83 requested a review from a team as a code owner October 11, 2023 08:09
Copy link
Contributor

@victorvarza victorvarza left a comment

Choose a reason for hiding this comment

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

Please add a short description to the PR.

@victorvarza victorvarza merged commit c4b2491 into adobe:main Oct 17, 2023
1 of 2 checks passed
@CezarAntohe83 CezarAntohe83 deleted the Add-last-element-handling-nested-arrays branch October 17, 2023 11:16
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.

3 participants