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

Field apiextensions.fn.proto.v1.RunFunctionRequest.credentials does not have presence when "resource.get_credentials()" called. #137

Open
my-dev-ops-pro opened this issue Mar 26, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@my-dev-ops-pro
Copy link

my-dev-ops-pro commented Mar 26, 2025

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()", I 'm receiving below error:

crossplane: error: cannot render composite resource: cannot run pipeline step "postInstallActivities": rpc error: code = Unknown desc = Unexpected <class 'ValueError'>: Field apiextensions.fn.proto.v1.RunFunctionRequest.credentials does not have presence.

While the RunFunctionRequest has the credential field in it, but looks like there is change in the schema.
Below is the RunFunctionRequest struct:
observed { composite { resource { fields { key: "spec" value { struct_value { } } } } } } } desired { } context { } credentials { key: "app1" value { credential_data { data { key: "init_key" value: "redacted" } } } } credentials { key: "app2" value { credential_data { data { key: "init_key" value: "redacted" } } } }

Expected Behavior: "resource.get_credentials()" should properly fetch the Credentials from the RunFunctionRequest and return credential type and data.

How can we reproduce it?

  1. Configure a composition to run a composite function and enable config = credentials to reference the secret.
    `apiVersion: apiextensions.crossplane.io/v1
    kind: Composition
    metadata:
    name: postInstall
    spec:
    compositeTypeRef:
    apiVersion: product.example.org/v1
    kind: postInstall
    mode: Pipeline
    pipeline:

    • step: postInstallStep
      functionRef:
      name: function-post-install
      credentials:
      • name: app1
        source: Secret
        secretRef:
        namespace: app1
        name: app1-secret
      • name: app2
        source: Secret
        secretRef:
        namespace: app2
        name: app2-secret`
  2. Develop a composite function to instantiate Credentials with - 'resource.get_credentials(req, "app1")'

  3. In an ideal case, the Credentials should be instantiated with type and data.

What environment did it happen in?

Function version: v0.6.0

  • Crossplane version: v1.18.1
  • Cloud provider or hardware configuration: Azure, Minikube
  • Kubernetes version: v1.29
  • Kubernetes distribution : AKS, Minikube
  • OS: Mac
  • Kernel: Darwin, arm64
@my-dev-ops-pro my-dev-ops-pro added the bug Something isn't working label Mar 26, 2025
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

1 participant