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 Support for Observe Only Resources #47

Merged
merged 1 commit into from
Apr 24, 2023

Conversation

turkenf
Copy link
Collaborator

@turkenf turkenf commented Apr 18, 2023

Description of your changes

This PR adds support for Observe Only resources. It also bumps up to v0.16.1.
Related PR: crossplane-contrib/provider-upjet-aws#672

I have:

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

I have created an application resource without enabling management-policies. Then I edited the resource and added
managementPolicy: ObserveOnly to spec. I get the following message and situation:

    message: managementPolicy is set to a non-default value but the feature is not
    enabled.
NAME                                                  READY   SYNCED   EXTERNAL-NAME                          AGE
application.applications.azuread.upbound.io/example   True    False    96558175-82d0-4a9d-8596-ddb2a049b738   15m

Then I activated the management-policies by making changes in the Makefile. I created a new application resource in AAD console and I successfully imported it using the following manifest:

apiVersion: applications.azuread.upbound.io/v1beta1
kind: Application
metadata:
  annotations:
    crossplane.io/external-name: 36b8a7c7-5f9e-43e7-8d07-552b049b8d85
  name: example
spec:
  managementPolicy: ObserveOnly
  forProvider:
    displayName: exampletest

I can see the managed resource is ready & synced:

NAME                                                  READY   SYNCED   EXTERNAL-NAME                          AGE
application.applications.azuread.upbound.io/example   True    True     36b8a7c7-5f9e-43e7-8d07-552b049b8d85   44s

status.atProvider is up to date with the actual status of the resource:

status:
  atProvider:
    api:
    - mappedClaimsEnabled: false
      requestedAccessTokenVersion: 2
    applicationId: 9cf7ca76-2521-4106-8368-5d63fb00af45
    description: ""
    deviceOnlyAuthEnabled: false
    disabledByMicrosoft: <nil>
    displayName: exampletest
    fallbackPublicClientEnabled: false
    featureTags:
    - customSingleSignOn: false
      enterprise: false
      gallery: false
      hide: false
    id: 36b8a7c7-5f9e-43e7-8d07-552b049b8d85
    logoImage: ""
    logoUrl: ""
    marketingUrl: ""
    notes: ""
    oauth2PostResponseRequired: false
    objectId: 36b8a7c7-5f9e-43e7-8d07-552b049b8d85
    owners:
    - 70e0f1d0-9d4b-4ef9-aef1-5242c6784d40
    preventDuplicateNames: false
    privacyStatementUrl: ""
    publicClient:
    - {}
    publisherDomain: devopsupbound.onmicrosoft.com
    requiredResourceAccess:
    - resourceAccess:
      - id: e1fe6dd8-ba31-4d61-89e7-88639da4683d
        type: Scope
      resourceAppId: 00000003-0000-0000-c000-000000000000
    signInAudience: AzureADandPersonalMicrosoftAccount
    singlePageApplication:
    - {}
    supportUrl: ""
    templateId: ""
    termsOfServiceUrl: ""
    web:
    - homepageUrl: ""
      implicitGrant:
      - accessTokenIssuanceEnabled: false
        idTokenIssuanceEnabled: false
      logoutUrl: ""
  conditions:
  - lastTransitionTime: "2023-04-20T10:30:44Z"
    reason: Available
    status: "True"
    type: Ready
  - lastTransitionTime: "2023-04-20T10:30:44Z"
    reason: ReconcileSuccess
    status: "True"
    type: Synced

@turkenf turkenf force-pushed the observe-only-support branch from f592d79 to c154055 Compare April 19, 2023 21:50
@turkenf turkenf marked this pull request as ready for review April 20, 2023 10:41
@turkenf turkenf requested a review from turkenh April 20, 2023 10:42
@turkenf turkenf merged commit f411533 into crossplane-contrib:main Apr 24, 2023
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.

2 participants