Skip to content

Commit 380ff9e

Browse files
authored
Merge branch 'main' into empty-input-lists
2 parents 5adf32a + 1d1dde4 commit 380ff9e

File tree

4 files changed

+60
-6
lines changed

4 files changed

+60
-6
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ env:
2626
# This CI job will automatically push new builds to xpkg.upbound.io if the
2727
# XPKG_ACCESS_ID and XPKG_TOKEN secrets are set in the GitHub respository (or
2828
# organization) settings. Create a token at https://accounts.upbound.io.
29-
XPKG_ACCESS_ID: ${{ secrets.XPKG_ACCESS_ID }}
29+
XPKG_ACCESS_ID: ${{ secrets.UP_ROBOT_ID }}
3030

3131
# The package to push, without a version tag. The default matches GitHub. For
3232
# example xpkg.upbound.io/crossplane/function-template-go.
@@ -152,8 +152,8 @@ jobs:
152152
if: env.XPKG_ACCESS_ID != ''
153153
with:
154154
registry: xpkg.upbound.io
155-
username: ${{ secrets.XPKG_ACCESS_ID }}
156-
password: ${{ secrets.XPKG_TOKEN }}
155+
username: ${{ secrets.UP_ROBOT_ID }}
156+
password: ${{ secrets.UP_API_TOKEN }}
157157

158158
# If a version wasn't explicitly passed as a workflow_dispatch input we
159159
# default to version v0.0.0-<git-commit-date>-<git-short-sha>, for example

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,60 @@ servicePrincipalsRef: "spec.servicePrincipalConfig.names" # Get service princip
339339
target: "status.servicePrincipals"
340340
```
341341

342+
## Using data from EnvironmentConfig
343+
344+
To use data from a Crossplane `EnvironmentConfig`, first load the data into the context using [function-environment-configs](https://github.com/crossplane-contrib/function-environment-configs). This function should be in the pipeline before you use function-msgraph.
345+
346+
function-environment-configs loads a merged map of environment config data to `context["apiextensions.crossplane.io/environment"]` but to refer to this correctly in function-msgraph the following syntax must be used: `context.[apiextensions.crossplane.io/environment]`.
347+
348+
### Example:
349+
350+
1. First, define your Environment Config:
351+
352+
```yaml
353+
apiVersion: apiextensions.crossplane.io/v1beta1
354+
kind: EnvironmentConfig
355+
metadata:
356+
name: example-config
357+
data:
358+
entraid:
359+
users:
360+
361+
```
362+
363+
2. Load the Environment Config in to your composition pipeline:
364+
365+
```yaml
366+
pipeline:
367+
- step: load-environment-config
368+
functionRef:
369+
name: crossplane-contrib-function-environment-configs
370+
input:
371+
apiVersion: environmentconfigs.fn.crossplane.io/v1beta1
372+
kind: Input
373+
spec:
374+
environmentConfigs:
375+
- type: Reference
376+
ref:
377+
name: example-config
378+
```
379+
380+
3. Reference the Environment Config data in your function input:
381+
382+
```yaml
383+
- step: load-environment-config
384+
# ... omitted for brevity
385+
- step: get-group-members
386+
functionRef:
387+
name: function-msgraph
388+
input:
389+
apiVersion: msgraph.fn.crossplane.io/v1alpha1
390+
kind: Input
391+
queryType: GroupMembership
392+
groupRef: context.[apiextensions.crossplane.io/environment].entraid.users
393+
target: "status.users"
394+
```
395+
342396
## Using Different Credentials
343397

344398
### Using ServicePrincipal credentials

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/crossplane/function-sdk-go v0.5.0-rc.0.0.20250805171053-2910b68d255d
1212
github.com/google/go-cmp v0.7.0
1313
github.com/microsoft/kiota-authentication-azure-go v1.3.1
14-
github.com/microsoftgraph/msgraph-sdk-go v1.87.0
14+
github.com/microsoftgraph/msgraph-sdk-go v1.89.0
1515
google.golang.org/protobuf v1.36.10
1616
k8s.io/apimachinery v0.34.1
1717
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ github.com/microsoft/kiota-serialization-multipart-go v1.1.2 h1:1pUyA1QgIeKslQwb
174174
github.com/microsoft/kiota-serialization-multipart-go v1.1.2/go.mod h1:j2K7ZyYErloDu7Kuuk993DsvfoP7LPWvAo7rfDpdPio=
175175
github.com/microsoft/kiota-serialization-text-go v1.1.3 h1:8z7Cebn0YAAr++xswVgfdxZjnAZ4GOB9O7XP4+r5r/M=
176176
github.com/microsoft/kiota-serialization-text-go v1.1.3/go.mod h1:NDSvz4A3QalGMjNboKKQI9wR+8k+ih8UuagNmzIRgTQ=
177-
github.com/microsoftgraph/msgraph-sdk-go v1.87.0 h1:N+BSwQggS4aC/WsImtwJ+FijMUm4RisOvYQx7j5PGtk=
178-
github.com/microsoftgraph/msgraph-sdk-go v1.87.0/go.mod h1:UdZWxbZiFvjPug9DYayD90JNiHjXyNRA39lEpcy3Kms=
177+
github.com/microsoftgraph/msgraph-sdk-go v1.89.0 h1:iavHsg7nqhVv+cMtTVAajLWbkDONVIethlojDn3gFDM=
178+
github.com/microsoftgraph/msgraph-sdk-go v1.89.0/go.mod h1:UdZWxbZiFvjPug9DYayD90JNiHjXyNRA39lEpcy3Kms=
179179
github.com/microsoftgraph/msgraph-sdk-go-core v1.4.0 h1:0SrIoFl7TQnMRrsi5TFaeNe0q8KO5lRzRp4GSCCL2So=
180180
github.com/microsoftgraph/msgraph-sdk-go-core v1.4.0/go.mod h1:A1iXs+vjsRjzANxF6UeKv2ACExG7fqTwHHbwh1FL+EE=
181181
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=

0 commit comments

Comments
 (0)