Seems like provider is trying to adopt workspace environment instead of a project environment.
apiVersion: project.crossplane.infisical.com/v1alpha1
kind: ProjectEnvironment
metadata:
name: test
annotations:
crossplane.io/external-name: test
spec:
providerConfigRef:
name: infisical
deletionPolicy: Delete
managementPolicies: ["Observe", "Create", "Update", "LateInitialize"]
forProvider:
name: test
slug: test
position: 1
projectId: c36a3202-0ba4-4080-bb70-b9bed5718519
observe failed: cannot run refresh: refresh failed: Error fetching
environment from your project: Couldn't read project environment from
Infiscial, unexpected error: CallGetProjectEnvironmentByID Unsuccessful
response [GET
https://infisical.my/api/v1/workspace/environments/test]
[status-code=500] [request-id=req-Rxg0wsHa9BYML8] [message="Something
went wrong"]
Seems like provider is trying to adopt workspace environment instead of a project environment.
observe failed: cannot run refresh: refresh failed: Error fetching environment from your project: Couldn't read project environment from Infiscial, unexpected error: CallGetProjectEnvironmentByID Unsuccessful response [GET https://infisical.my/api/v1/workspace/environments/test] [status-code=500] [request-id=req-Rxg0wsHa9BYML8] [message="Something went wrong"]