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

Unable to reference schedule in Policy resource #35

Open
asafhm opened this issue Feb 29, 2024 · 2 comments
Open

Unable to reference schedule in Policy resource #35

asafhm opened this issue Feb 29, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@asafhm
Copy link

asafhm commented Feb 29, 2024

What happened?

Following the docs, I tried setting up my policy resource with a schedule resource using the terraform ${pagerduty_schedule.example.id} syntax but the following error is shown in the policy events:

Warning CannotObserveExternalResource 20s (x17 over 16m) managed/escalation.pagerduty.crossplane.io/v1alpha1, kind=policy cannot run refresh: refresh failed: Reference to undeclared resource: A managed resource "pagerduty_schedule" "example" has not been declared in the root module.

How can we reproduce it?

I tried using the following code:

apiVersion: schedule.pagerduty.crossplane.io/v1alpha1
kind: Schedule
metadata:
  name: example
  labels:
    schedule: example
  annotations:
    crossplane.io/external-name: xxx # redacted
spec:
  managementPolicies: ["Observe"]
  forProvider: {}
---
apiVersion: escalation.pagerduty.crossplane.io/v1alpha1
kind: Policy
metadata:
  labels:
    escalation-policy: example
  name: example
spec:
  forProvider:
    name: example Escalation Policy
    description: Managed by Crossplane
    numLoops: 2
    teamSelector:
      matchLabels:
        team: example-team
    rule:
      - escalationDelayInMinutes: 10
        target:
          - id: ${pagerduty_schedule.example.id}
            type: schedule_reference

I made sure the schedule managed resource is populated with real data from the external resource, including its id.

What environment did it happen in?

Crossplane version: v1.15.0
Provider version: v0.6.1

Kubernetes: GKE 1.28

@asafhm asafhm added the bug Something isn't working label Feb 29, 2024
@haarchri
Copy link
Member

You need to add a real id

@asafhm
Copy link
Author

asafhm commented Mar 3, 2024

I see... I assume it's related to #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants