Infisical / infisical

♾ Infisical is the open-source secret management platform: Sync secrets across your team/infrastructure, prevent secret leaks, and manage internal PKI
https://infisical.com
Other
13.16k stars 698 forks source link

add/replace 'projectId' field in InfisicalSecret CRD (kubernetes-operator) #1973

Closed oihanitrz closed 1 month ago

oihanitrz commented 1 month ago

Describe the bug

Hello, I have a problem with the kubernetes operator that is supposed to retrieve secrets in infisical to inject them into kube. In the InfisicalSecret CRD there are 3 fields to specify the secrets: projectSlug, envSlug and secretsPath, except that the operator displays the error "Error: Missing workspace id or environment".

To Reproduce

Steps to reproduce the behavior:

  1. Install the kubernetes operator (https://infisical.com/docs/integrations/platforms/kubernetes#install-operator)
  2. Create any secret in any project via the infisical interface
  3. Create an InfisicalSecret with the Universal Auth method (https://infisical.com/docs/integrations/platforms/kubernetes#authentication-universalauth) object based on your parameters:
  4. Check operator pod logs unable to reconcile Infisical Secret because [err= failed to get secrets because [err=APIError: CallListSecretsV3Raw unsuccessful response [GET http://infisical-infisical-standalone-infisical.poc-infisical.svc.cluster.local:8080/api/v3/secrets/raw?environment=dev&expandSecretReferences=true&include_imports=true&recursive=true&secretPath=%2F&workspaceId=&workspaceSlug=poc-qdh-k] [status-code=400] Error: Missing workspace id or environment]]. Will requeue after [requeueTime=10s]

Expected behavior

In the logs, there's a workspaceId field that's always empty (in the query). I've tried querying by hand and in fact it's this field that's needed, not workspaceSlug (projectSlug in CRD). The query passes if the workspaceId is specified (even without the workspaceSlug). If I've made a mistake somewhere, please tell me, otherwise I think you should add the projectId field to the CRD (or even replace projectSlug with projectId).

Platform you are having the issue on:

Infisical self-hosted, deploy with chart infisical-standalone v1.0.8

oihanitrz commented 1 month ago

The problem was solved by changing the infisical version (of the image, not the chart helm).