Skip to content

Comments

DEVOPS-3707 remove PreSync annotation#20

Merged
creisor merged 1 commit intomainfrom
DEVOPS-3707-remove-argo-cd-pre-sync-annotation-from-cluster-external-secret-manifests
Jul 17, 2025
Merged

DEVOPS-3707 remove PreSync annotation#20
creisor merged 1 commit intomainfrom
DEVOPS-3707-remove-argo-cd-pre-sync-annotation-from-cluster-external-secret-manifests

Conversation

@creisor
Copy link
Contributor

@creisor creisor commented Jul 17, 2025

I'mn hoping this will fix Unknown status for search-service-admin. ChatGPT says:

ArgoCD hooks are best used with namespaced resources, because:

ArgoCD tracks resources under .status.resources[], which expects to resolve:

{
    "kind": "ClusterExternalSecret",
      "namespace": "...",
        "name": "search-service",
          ...
}

When you apply argocd.argoproj.io/hook to a cluster-scoped resource, the namespace field will be "", which causes ArgoCD to generate an invalid internal representation, specifically in the JSON patch sent to Kubernetes.

This corrupts .status.resources and causes errors like:

Error constructing app status patch: unable to find api field in struct
RawExtension for the json field "spec"

I'mn hoping this will fix `Unknown` status for `search-service-admin`.
ChatGPT says:

ArgoCD hooks are best used with namespaced resources, because:

ArgoCD tracks resources under .status.resources[], which expects to
resolve:

```
{
    "kind": "ClusterExternalSecret",
      "namespace": "...",
        "name": "search-service",
          ...
}
```

When you apply argocd.argoproj.io/hook to a cluster-scoped resource, the
namespace field will be "", which causes ArgoCD to generate an invalid
internal representation, specifically in the JSON patch sent to
Kubernetes.

This corrupts .status.resources and causes errors like:

```
Error constructing app status patch: unable to find api field in struct
RawExtension for the json field "spec"
```
@creisor creisor merged commit 695e1a5 into main Jul 17, 2025
@creisor creisor deleted the DEVOPS-3707-remove-argo-cd-pre-sync-annotation-from-cluster-external-secret-manifests branch July 17, 2025 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant