Skip to content

Commit

Permalink
chore: align references to istio injection label
Browse files Browse the repository at this point in the history
When enabling injection, read the value of the injection label once and use that const value instead of re-reading from the labels object.
  • Loading branch information
YrrepNoj committed Jun 5, 2024
1 parent f1d3592 commit b299bc4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pepr/operator/controllers/istio/injection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export async function enableInjection(pkg: UDSPackage) {

// Mark the original namespace injection setting for if all packages are removed
if (!annotations[injectionAnnotation]) {
annotations[injectionAnnotation] = labels[injectionLabel] || "non-existent";
annotations[injectionAnnotation] = originalInjectionLabel || "non-existent";
}

// Ensure the namespace is configured
if (!annotations[pkgKey] || labels[injectionLabel] !== "enabled") {
if (!annotations[pkgKey] || originalInjectionLabel !== "enabled") {
// Ensure Istio injection is enabled
labels[injectionLabel] = "enabled";

Expand Down

0 comments on commit b299bc4

Please sign in to comment.