Title: Field apiextensions.fn.proto.v1.RunFunctionRequest.credentials does not have presence when "resource.get_credentials()" called. · Issue #137 · crossplane/function-sdk-python · GitHub
Open Graph Title: Field apiextensions.fn.proto.v1.RunFunctionRequest.credentials does not have presence when "resource.get_credentials()" called. · Issue #137 · crossplane/function-sdk-python
X Title: Field apiextensions.fn.proto.v1.RunFunctionRequest.credentials does not have presence when "resource.get_credentials()" called. · Issue #137 · crossplane/function-sdk-python
Description: What happened? I have a composition which is configured to inject kubernetes secret by using "credentials" config. Upon loading this secret inside my composite function, fetching the credential data by using "resource.get_credentials()",...
Open Graph Description: What happened? I have a composition which is configured to inject kubernetes secret by using "credentials" config. Upon loading this secret inside my composite function, fetching the credential dat...
X Description: What happened? I have a composition which is configured to inject kubernetes secret by using "credentials" config. Upon loading this secret inside my composite function, fetching the cred...
Opengraph URL: https://github.com/crossplane/function-sdk-python/issues/137
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Field apiextensions.fn.proto.v1.RunFunctionRequest.credentials does not have presence when \"resource.get_credentials()\" called.","articleBody":"### What happened?\n\nI have a composition which is configured to inject kubernetes secret by using \"credentials\" config. Upon loading this secret inside my composite function, fetching the credential data by using \"resource.get_credentials()\", I 'm receiving below error:\n\n\u003e crossplane: error: cannot render composite resource: cannot run pipeline step \"postInstallActivities\": rpc error: code = Unknown desc = Unexpected \u003cclass 'ValueError'\u003e: Field apiextensions.fn.proto.v1.RunFunctionRequest.credentials does not have presence.\n\nWhile the RunFunctionRequest has the credential field in it, but looks like there is change in the schema.\nBelow is the RunFunctionRequest struct:\n`observed {\n composite {\n resource {\n fields {\n key: \"spec\"\n value {\n struct_value { \n }\n }\n }\n }\n }\n }\n }\n desired {\n }\n context {\n }\n credentials {\n key: \"app1\"\n value {\n credential_data {\n data {\n key: \"init_key\"\n value: \"redacted\"\n }\n }\n }\n }\n credentials {\n key: \"app2\"\n value {\n credential_data {\n data {\n key: \"init_key\"\n value: \"redacted\"\n }\n }\n }\n }`\n\n\nExpected Behavior: \"resource.get_credentials()\" should properly fetch the Credentials from the RunFunctionRequest and return credential type and data.\n\n\n### How can we reproduce it?\n\n1. Configure a composition to run a composite function and enable config = credentials to reference the secret.\n`apiVersion: apiextensions.crossplane.io/v1\nkind: Composition\nmetadata:\n name: postInstall\nspec:\n compositeTypeRef:\n apiVersion: product.example.org/v1\n kind: postInstall\n mode: Pipeline\n pipeline:\n - step: postInstallStep\n functionRef:\n name: function-post-install\n credentials:\n - name: app1\n source: Secret\n secretRef:\n namespace: app1\n name: app1-secret\n - name: app2\n source: Secret\n secretRef:\n namespace: app2\n name: app2-secret`\n\n2. Develop a composite function to instantiate Credentials with - 'resource.get_credentials(req, \"app1\")' \n3. In an ideal case, the Credentials should be instantiated with type and data.\n\n\n### What environment did it happen in?\nFunction version: v0.6.0\n* Crossplane version: v1.18.1\n* Cloud provider or hardware configuration: Azure, Minikube\n* Kubernetes version: v1.29\n* Kubernetes distribution : AKS, Minikube\n* OS: Mac\n* Kernel: Darwin, arm64\n\n","author":{"url":"https://github.com/my-dev-ops-pro","@type":"Person","name":"my-dev-ops-pro"},"datePublished":"2025-03-26T17:29:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/137/function-sdk-python/issues/137"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:faa2f175-38b4-fabf-1345-f6d7c6e10e0b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ECEE:B1596:10C62A:181B32:6A61DCE8 |
| html-safe-nonce | cc74dffa514a860ab60cce5be0576f991a7181b97498bfc748868f60db485e1d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQ0VFOkIxNTk2OjEwQzYyQToxODFCMzI6NkE2MURDRTgiLCJ2aXNpdG9yX2lkIjoiODUxNDUyNTI0OTEwMjA2MTg0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d9fa6a727da9fa4555d7c081dc4e8d457c59cb3242422826382f28fc3bd64698 |
| hovercard-subject-tag | issue:2950338562 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/crossplane/function-sdk-python/137/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7a0a1bf3aa0a0e92825feb0f188f67948a5e06cd099a2508ed6f793f1c563fc1/crossplane/function-sdk-python/issues/137 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7a0a1bf3aa0a0e92825feb0f188f67948a5e06cd099a2508ed6f793f1c563fc1/crossplane/function-sdk-python/issues/137 |
| og:image:alt | What happened? I have a composition which is configured to inject kubernetes secret by using "credentials" config. Upon loading this secret inside my composite function, fetching the credential dat... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | my-dev-ops-pro |
| hostname | github.com |
| expected-hostname | github.com |
| None | b2de8c74e5e61e893155ba46ee41bc66170c1644cb795adefa8386d490f7781c |
| turbo-cache-control | no-preview |
| go-import | github.com/crossplane/function-sdk-python git https://github.com/crossplane/function-sdk-python.git |
| octolytics-dimension-user_id | 45158470 |
| octolytics-dimension-user_login | crossplane |
| octolytics-dimension-repository_id | 721365259 |
| octolytics-dimension-repository_nwo | crossplane/function-sdk-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 721365259 |
| octolytics-dimension-repository_network_root_nwo | crossplane/function-sdk-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d1866027ded575df8a15c731dd8b9986c9483ceb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width