-
Notifications
You must be signed in to change notification settings - Fork 144
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
knative deployer failed to update the Knative Service: referenced Secret xxxis not present #2257
Comments
This does seem like a bug if you can work around the issue by removing/deploying again. |
after debugging, I find the cause is that the default service account does not have permission to get the secret.
func/pkg/knative/deployer.go: func checkResourcesArePresent(ctx context.Context, namespace string, referencedSecrets, referencedConfigMaps, referencedPVCs *sets.Set[string], referencedServiceAccount string) error {
errMsg := ""
for s := range *referencedSecrets {
_, err := k8s.GetSecret(ctx, s, namespace)
if err != nil {
// here
errMsg += fmt.Sprintf(" referenced Secret \"%s\" is not present in namespace \"%s\"\n", s, namespace)
}
} |
Thanks for running through the debugging! |
Yes, it could be fixed easily by adding permission to the service account. Maybe we can improve the error message by adding something like the original error so that it will not be confusing. |
Hi,
I got this issue when re-reploying a service:
However, the secret does exist in this namespace:
I have a env using secret in the func.yaml:
This issue only happens when re-reploying a function. The workaround is to delete the existing function first before deploy it:
The text was updated successfully, but these errors were encountered: