Skip to content

Commit d597776

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 e64b378 commit d597776

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
@@ -209,6 +209,8 @@ func (r *AgentRuntimeReconciler) Reconcile(ctx context.Context, req ctrl.Request
209209
r.Recorder.Eventf(rt, nil, corev1.EventTypeWarning, "ConfigMapEnsureError",
210210
"EnsureSpiffeHelperConfig", err.Error())
211211
}
212+
r.updateErrorStatus(ctx, req.NamespacedName, ConditionTypeReady, "SpiffeHelperConfigError", err.Error())
213+
return ctrl.Result{RequeueAfter: 30 * time.Second}, nil
212214
}
213215

214216
// 4.6. Ensure namespace has Istio ambient mesh labels for ztunnel mTLS.
@@ -993,7 +995,6 @@ func computeCardContentHash(cardData *agentv1alpha1.AgentCardData) string {
993995
var templateConfigMapNames = []string{
994996
"authbridge-config",
995997
"authbridge-runtime-config",
996-
"spiffe-helper-config",
997998
}
998999

9991000
// 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)