Skip to content

Commit 2904edf

Browse files
nairbgamingrobot
authored andcommitted
docs: clarify the annotated-injector re-match check in ShouldDeferForOnCreate
1 parent ea22e98 commit 2904edf

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Contrast.K8s.AgentOperator/Core/Reactions/Injecting/PodTemplateInjectionHandler.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ private async ValueTask<bool> ShouldDeferForOnCreate(ResourceIdentityPair<IResou
9797
return false;
9898
}
9999

100+
// Checks whether the injector that stamped this workload STILL selects it, not the
101+
// current match MatchInjectorsHandler already resolved. On an un-match (label removed)
102+
// the incoming injector is null but the annotated one is still enabled+OnCreate, so
103+
// without this we'd defer and orphan the injection instead of stripping it.
100104
var annotatedPair = new ResourceIdentityPair<AgentInjectorResource>(
101105
NamespacedResourceIdentity.Create<AgentInjectorResource>(annotatedName, annotatedNamespace),
102106
annotatedInjector);

0 commit comments

Comments
 (0)