Skip to content

Commit 95a083f

Browse files
committed
Remove typo in functions.yaml and extend README with Ref fields
Signed-off-by: Yury Tsarev <[email protected]>
1 parent 28c026c commit 95a083f

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,13 @@ spec:
189189
|-------|------|-------------|
190190
| `queryType` | string | Required. Type of query to perform. Valid values: `UserValidation`, `GroupMembership`, `GroupObjectIDs`, `ServicePrincipalDetails` |
191191
| `users` | []string | List of user principal names (email IDs) for user validation |
192+
| `usersRef` | string | Reference to resolve a list of user names from `spec`, `status` or `context` (e.g., `spec.userAccess.emails`) |
192193
| `group` | string | Single group name for group membership queries |
194+
| `groupRef` | string | Reference to resolve a single group name from `spec`, `status` or `context` (e.g., `spec.groupConfig.name`) |
193195
| `groups` | []string | List of group names for group object ID queries |
196+
| `groupsRef` | string | Reference to resolve a list of group names from `spec`, `status` or `context` (e.g., `spec.groupConfig.names`) |
194197
| `servicePrincipals` | []string | List of service principal names |
198+
| `servicePrincipalsRef` | string | Reference to resolve a list of service principal names from `spec`, `status` or `context` (e.g., `spec.servicePrincipalConfig.names`) |
195199
| `target` | string | Required. Where to store the query results. Can be `status.<field>` or `context.<field>` |
196200
| `skipQueryWhenTargetHasData` | bool | Optional. When true, will skip the query if the target already has data |
197201

@@ -213,6 +217,50 @@ target: "context.results"
213217
target: "context.[apiextensions.crossplane.io/environment].results"
214218
```
215219

220+
## Using Reference Fields
221+
222+
You can reference values from XR spec, status, or context instead of hardcoding them:
223+
224+
### Using groupRef from spec
225+
226+
```yaml
227+
apiVersion: msgraph.fn.crossplane.io/v1alpha1
228+
kind: Input
229+
queryType: GroupMembership
230+
groupRef: "spec.groupConfig.name" # Get group name from XR spec
231+
target: "status.groupMembers"
232+
```
233+
234+
### Using groupsRef from spec
235+
236+
```yaml
237+
apiVersion: msgraph.fn.crossplane.io/v1alpha1
238+
kind: Input
239+
queryType: GroupObjectIDs
240+
groupsRef: "spec.groupConfig.names" # Get group names from XR spec
241+
target: "status.groupObjectIDs"
242+
```
243+
244+
### Using usersRef from spec
245+
246+
```yaml
247+
apiVersion: msgraph.fn.crossplane.io/v1alpha1
248+
kind: Input
249+
queryType: UserValidation
250+
usersRef: "spec.userAccess.emails" # Get user emails from XR spec
251+
target: "status.validatedUsers"
252+
```
253+
254+
### Using servicePrincipalsRef from spec
255+
256+
```yaml
257+
apiVersion: msgraph.fn.crossplane.io/v1alpha1
258+
kind: Input
259+
queryType: ServicePrincipalDetails
260+
servicePrincipalsRef: "spec.servicePrincipalConfig.names" # Get service principal names from XR spec
261+
target: "status.servicePrincipals"
262+
```
263+
216264
## References
217265

218266
- [Microsoft Graph API Overview](https://learn.microsoft.com/en-us/graph/api/overview?view=graph-rest-1.0)

example/functions.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ metadata:
99
spec:
1010
package: xpkg.upbound.io/upbound/function-msgraph:v0.1.0
1111
---
12-
---
1312
apiVersion: pkg.crossplane.io/v1beta1
1413
kind: Function
1514
metadata:

0 commit comments

Comments
 (0)