Skip to content

Commit 661dd7f

Browse files
committed
fix: requeue on spiffe-helper-config failure, remove from template list
Remove spiffe-helper-config from templateConfigMapNames since it is now derived from PlatformConfig via ensureSpiffeHelperConfigMap. Make failure in ensureSpiffeHelperConfigMap set error status and requeue (30s), matching the SCC binding pattern, to prevent stamping workloads with a stale or missing spiffe-helper-config. Addresses review feedback from kevincogan on PR #437. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Ian Miller <milleryan2003@gmail.com>
1 parent bb1c4aa commit 661dd7f

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

kagenti-operator/internal/controller/agentruntime_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ func (r *AgentRuntimeReconciler) Reconcile(ctx context.Context, req ctrl.Request
213213
r.Recorder.Eventf(rt, nil, corev1.EventTypeWarning, "ConfigMapEnsureError",
214214
"EnsureSpiffeHelperConfig", err.Error())
215215
}
216+
r.updateErrorStatus(ctx, req.NamespacedName, ConditionTypeReady, "SpiffeHelperConfigError", err.Error())
217+
return ctrl.Result{RequeueAfter: 30 * time.Second}, nil
216218
}
217219

218220
// 4.6. Ensure namespace has Istio ambient mesh labels for ztunnel mTLS.
@@ -1066,7 +1068,6 @@ func computeCardContentHash(cardData *agentv1alpha1.AgentCardData) string {
10661068
var templateConfigMapNames = []string{
10671069
"authbridge-config",
10681070
"authbridge-runtime-config",
1069-
"spiffe-helper-config",
10701071
}
10711072

10721073
// ensureNamespaceConfigMaps copies template ConfigMaps from kagenti-system to the

kagenti-operator/internal/controller/agentruntime_controller_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ var _ = Describe("AgentRuntime Controller", func() {
704704
})
705705

706706
AfterEach(func() {
707-
for _, name := range []string{"authbridge-config", "authbridge-runtime-config", "envoy-config", "spiffe-helper-config"} {
707+
for _, name := range []string{"authbridge-config", "authbridge-runtime-config", "envoy-config"} {
708708
cm := &corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: name, Namespace: ClusterDefaultsNamespace}}
709709
_ = k8sClient.Delete(ctx, cm)
710710
cm = &corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: name, Namespace: cmTestNS}}
@@ -809,8 +809,8 @@ var _ = Describe("AgentRuntime Controller", func() {
809809
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: "authbridge-config", Namespace: cmTestNS}, abCfg)).To(Succeed())
810810
Expect(abCfg.Data["KEYCLOAK_URL"]).To(Equal("http://existing"))
811811

812-
// The other 3 should be created from templates
813-
for _, name := range []string{"authbridge-runtime-config", "spiffe-helper-config"} {
812+
// authbridge-runtime-config should be created from template
813+
for _, name := range []string{"authbridge-runtime-config"} {
814814
cm := &corev1.ConfigMap{}
815815
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: name, Namespace: cmTestNS}, cm)).To(Succeed())
816816
Expect(cm.Data["config.yaml"]).To(Equal("template-" + name))

0 commit comments

Comments
 (0)