ArgoCD 忽略转义斜杠和时间的特定注释

问题描述 投票:0回答:1

使用此功能,我需要忽略

openshift.io/sa.scc.supplemental-groups
类型资源同步中的注释(
Namespace
)。 我尝试了以下方法:

1- 使用

[]

  - kind: Namespace
    jsonPointers:
      - '/metadata/annotations["openshift.io/sa.scc.supplemental-groups"]'

2- 通过

.
 转义任何 
/
\

  - kind: Namespace
    jsonPointers:
      - /metadata/annotations/openshift\.io\/sa\.scc\.supplemental-groups

3-通配符

  - kind: Namespace
    jsonPointers:
      - /metadata/annotations/openshift*

没有任何作用!有什么想法吗?

jsonpath argocd
1个回答
1
投票

Argocd 的ignoreDifference 使用Json 指针语法

您需要将

/
替换为
~1
,将
~
替换为
~0

在你的例子中:

- kind: Namespace
  jsonPointers:
    - '/metadata/annotations/openshift.io~1sa.scc.supplemental-groups'

.
不需要转义。

© www.soinside.com 2019 - 2024. All rights reserved.