Skip to content

knative deployer failed to update the Knative Service: referenced Secret xxxis not present #2257

@drriguz

Description

@drriguz

Hi,
I got this issue when re-reploying a service:

func deploy --remote
...
arning: git settings are only applicable when running with --remote.  Local source code will be used.deploy error: knative deployer failed to update the Knative Service: 
  referenced Secret "bing-apikey" is not present in namespace "agent-less"

Error: knative deployer failed to update the Knative Service: 
  referenced Secret "bing-apikey" is not present in namespace "agent-less"

However, the secret does exist in this namespace:

kn secret list -n agent-less
NAME                                        TYPE
bing-apikey                                 Opaque

I have a env using secret in the func.yaml:

run:
  envs:
  - name: BING_API_KEY
    value: '{{ secret:bing-apikey:apiKey }}'

This issue only happens when re-reploying a function. The workaround is to delete the existing function first before deploy it:

func delete -n agent-less bing-search-tool
Removing Knative Service: bing-search-tool
Removing Knative Service 'bing-search-tool' and all dependent resources

func deploy --remote

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/good-first-issueDenotes an issue ready for a new contributor.

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions