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

fix(kuma-cp): retrieve name from owner not parsing pod name for Deployments/CronJob #5569

Merged
merged 8 commits into from
Jan 9, 2023

Conversation

lukidzi
Copy link
Contributor

@lukidzi lukidzi commented Jan 3, 2023

Currently, for seviceless, we are retrieving the name by splitting the pod name and removing the 2 last elements. This is correct but only for Deployments and CronJob because they are creating an intermediate object that manages Pod(ReplicaSet,Job).
Example:

Deployment name = test
ReplicaSet name = test-hash
Pod name = test-hash-hash2

In the case of ReplicaSet/Job/Pod/DaemonSet it might produce the wrong name:
Example:

ReplicaSet name = test-server
Pod name = test-server-hash
result = test

Introduced change which retrieves for Deployments and CronJob name from the owner. Because of keeping backward compatibility, I had to leave the code with splitting for all cases that are not CronJob or Deployment to not introduce braking change. If we think that we want to introduce breaking change I am happy to change it because without we might have problems with overlapping names.

Example:

ReplicaSet name = test-server2
Pod name = test-server2-hash
result = test

ReplicaSet name = test-server
Pod name = test-server-hash
result = test
  • Link to docs PR or issue --
  • Link to UI issue or PR --
  • Is the [issue worked on linked][1]? -- fix: Serviceless pods and provided gateway should use deployment,daemonset,jobs name #4768
  • The PR does not hardcode values that might break projects that depend on kuma (e.g. "kumahq" as a image registry) --
  • The PR will work for both Linux and Windows, system specific functions like syscall.Mkfifo have equivalent implementation on the other OS --
  • Unit Tests --
  • E2E Tests --
  • Manual Universal Tests --
  • Manual Kubernetes Tests --
  • Do you need to update UPGRADE.md? --
  • Does it need to be backported according to the backporting policy? --
  • Do you need to explicitly set a > Changelog: entry here or add a ci/ label to run fewer/more tests?

…ronJob

Signed-off-by: Lukasz Dziedziak <lukidzi@gmail.com>
@lukidzi lukidzi requested review from a team, jakubdyszkiewicz and Automaat and removed request for a team January 3, 2023 19:13
Signed-off-by: Lukasz Dziedziak <lukidzi@gmail.com>
Signed-off-by: Lukasz Dziedziak <lukidzi@gmail.com>
Signed-off-by: Lukasz Dziedziak <lukidzi@gmail.com>
Signed-off-by: Lukasz Dziedziak <lukidzi@gmail.com>
UPGRADE.md Outdated Show resolved Hide resolved
UPGRADE.md Outdated Show resolved Hide resolved
UPGRADE.md Outdated Show resolved Hide resolved
UPGRADE.md Outdated Show resolved Hide resolved
UPGRADE.md Outdated Show resolved Hide resolved
UPGRADE.md Outdated Show resolved Hide resolved
UPGRADE.md Outdated Show resolved Hide resolved
UPGRADE.md Outdated Show resolved Hide resolved
UPGRADE.md Outdated Show resolved Hide resolved
pkg/plugins/runtime/k8s/controllers/inbound_converter.go Outdated Show resolved Hide resolved
Signed-off-by: Lukasz Dziedziak <lukidzi@gmail.com>
Signed-off-by: Lukasz Dziedziak <lukidzi@gmail.com>
@lukidzi lukidzi merged commit 04e12aa into kumahq:master Jan 9, 2023
bartsmykla pushed a commit to bartsmykla/kuma that referenced this pull request Jan 14, 2023
Currently, for seviceless, we are retrieving the name by splitting the pod name and removing the 2 last elements. This is correct but only for Deployments and CronJob because they are creating an intermediate object that manages Pod(ReplicaSet,Job).
Example:
Deployment name = test
ReplicaSet name = test-hash
Pod name = test-hash-hash2
In the case of ReplicaSet/Job/Pod/DaemonSet it might produce the wrong name:
Example:

ReplicaSet name = test-server
Pod name = test-server-hash
result = test

Signed-off-by: Lukasz Dziedziak <lukidzi@gmail.com>
Signed-off-by: Bart Smykla <bartek@smykla.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Serviceless pods and provided gateway should use deployment,daemonset,jobs name
4 participants