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(dataplane): properly default deprecated service account name #856

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

pmalek
Copy link
Member

@pmalek pmalek commented Nov 12, 2024

What this PR does / why we need it:

API server fills in the deprecated service account field based on what's set in the service account name field. This causes the operator to incorrectly assume there's a diff which needs an update on the Deployment.

v1.PodTemplateSpec{
    ObjectMeta: {Labels: {\"app\": \"dataplane-example\", \"dataplane-pod-label\": \"example\", \"gateway-operator.konghq.com/selector\": \"86e60937-f0b6-4816-845f-ece9f4aa6a2a\"}, Annotations: {\"dataplane-pod-annotation\": \"example\"}},
    Spec: v1.PodSpec{
      ... // 8 identical fields
      NodeSelector:                 nil,
      ServiceAccountName:           \"aaa\",
-     DeprecatedServiceAccount:     \"aaa\",
+     DeprecatedServiceAccount:     \"\",
      AutomountServiceAccountToken: nil,
      NodeName:                     \"\",
      ... // 26 identical fields
    },
  }
"}

This PR fixes that by copying what's in serviceAccountName to serviceAccount (deprecated) field.

This is a temporary workaround until #500 (or similar) gets implemented.

@pmalek pmalek added this to the KGO v1.5.x milestone Nov 12, 2024
@pmalek pmalek self-assigned this Nov 12, 2024
@pmalek pmalek requested a review from a team as a code owner November 12, 2024 10:33
@pmalek pmalek force-pushed the properly-default-service-account-name branch from 24c419c to 68d3305 Compare November 12, 2024 10:43
@pmalek pmalek force-pushed the properly-default-service-account-name branch from 68d3305 to 707036e Compare November 13, 2024 12:03
@pmalek pmalek force-pushed the properly-default-service-account-name branch from 707036e to 00bf717 Compare November 14, 2024 12:22
@pmalek pmalek enabled auto-merge (squash) November 14, 2024 12:27
@pmalek pmalek merged commit f974562 into main Nov 14, 2024
21 checks passed
@pmalek pmalek deleted the properly-default-service-account-name branch November 14, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants