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

[Bug]: When deleting or changing Api Key name NGINX Breaks/refuses update. #7384

Open
benshalev849 opened this issue Feb 19, 2025 · 9 comments
Assignees
Labels
bug An issue reporting a potential bug needs more info Issues that require more information waiting for response Waiting for author's response

Comments

@benshalev849
Copy link

Version

3.7.0

What Kubernetes platforms are you running on?

Openshift

Steps to reproduce

Creating the following secret:

apiVersion: v1
kind: Secret
metadata:
  name: apikey-secret
type: nginx.org/apikey
stringData:
  client1: "demo"
  client2: "showcase"

Then attaching it to a policy:

apiVersion: k8s.nginx.org/v1
kind: Policy
metadata:
  name: apikey-policy
spec:
  apiKey:
    clientSecret: apikey-secret
    suppliedIn:
      header:
        - x-api-key

When deleting an api key using oc apply the object does not update, when deleting via OCP UI it deletes.

In addition when changing the name of a client the configuration will break and remove the api key authentication from the config file.

Only way that i have managed to delete/change name of API Keys is to completely delete the secret and re-create it.

@benshalev849 benshalev849 added bug An issue reporting a potential bug needs triage An issue that needs to be triaged labels Feb 19, 2025
Copy link

Hi @benshalev849 thanks for reporting!

Be sure to check out the docs and the Contributing Guidelines while you wait for a human to take a look at this 🙂

Cheers!

@jjngx
Copy link
Contributor

jjngx commented Feb 19, 2025

@benshalev849 could you please check what HTTP request OCP UI sends to delete the API key? What is the output of oc apply run in verbose mode? Are the requests send via oc cli and oc UI the same?

@jjngx jjngx added the needs more info Issues that require more information label Feb 19, 2025
@jjngx jjngx self-assigned this Feb 19, 2025
@jjngx
Copy link
Contributor

jjngx commented Feb 24, 2025

@benshalev849 we will verify the behaviour using kubectl and local K8s cluster

@benshalev849
Copy link
Author

@jjngx Okay, ty!
IF you need anything else let me know :)

@jjngx
Copy link
Contributor

jjngx commented Mar 5, 2025

@jjngx Okay, ty! IF you need anything else let me know :)

#7384 (comment)

@vepatel
Copy link
Contributor

vepatel commented Mar 11, 2025

@benshalev849 can you please provide us with above info

@benshalev849
Copy link
Author

@jjngx @vepatel

Hey, i am sorry for the late response, been a busy few weeks...

We are an on prem deployment in a closed envrionment, copying the command to github is not really possible, when running it though i have not seen anything that may suggest it is related or broken.

Have you been able to replicate it locally with k8s?

Especially the change of name of the api key which just removes the api key config.

@vepatel
Copy link
Contributor

vepatel commented Mar 24, 2025

@benshalev849 we tried to repro this but unfortunately couldn't. Would you be able to give us an failing example and partial conf please, one from the api-key example in this repo should be okay as well.

@vepatel vepatel added waiting for response Waiting for author's response and removed needs triage An issue that needs to be triaged labels Mar 24, 2025
@vepatel
Copy link
Contributor

vepatel commented Mar 27, 2025

@benshalev849 I tried changing the keys in data field of api-key-client-secret using kubectl apply and nginx seems to have picked up the changes. Can you try changing stringData to Data since keys are expected to be base64 encoded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue reporting a potential bug needs more info Issues that require more information waiting for response Waiting for author's response
Projects
None yet
Development

No branches or pull requests

3 participants