bug(repo-server): update-ca-certificates init container does not inherit spec.repo.resources
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 75/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- go, kubernetes
调研方向
问题位于 controllers/argocd/openshift/openshift.go 的 updateSystemCATrustBuilding() 中,其中构建 update-ca-certificates 初始化容器时没有设置 Resources 字段。请将它与 copyutil 初始化容器获取 spec.repo.resources 的方式进行比较,并检查上游 reconciler 中的 getArgoRepoResources(cr)。当 update-ca-certificates 容器具有与 spec.repo.resources 相同的 requests 和 limits 时即完成,可以使用第 3 步中的 jq 命令进行确认。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
When configuring custom CA trust via spec.repo.systemCATrust on an ArgoCD resource, the operator injects an init container named update-ca-certificates into the argocd-repo-server pod. However, this init container is created with empty compute resources (resources: {}), even when spec.repo.resources (requests and limits) is explicitly defined in the CR.
This causes pod admission failures in namespaces governed by strict ResourceQuota policies requiring explicit CPU/memory requests and limits.
To Reproduce
Steps to reproduce the behavior:
- Create a namespace and a ConfigMap containing a custom CA certificate:
oc create configmap custom-ca --from-literal=ca.crt="-----BEGIN CERTIFICATE-----..."
- Deploy an ArgoCD instance with spec.repo.resources and spec.repo.systemCATrust
apiVersion: argoproj.io/v1beta1
kind: ArgoCD
metadata:
name: argocd-sample
spec:
repo:
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
systemCATrust:
configMaps:
- name: custom-ca
- inspect the resulting repo-server deployment's init containers
oc get deployment argocd-sample-repo-server -o json | jq '.spec.template.spec.initContainers[] | {name: .name, resources: .resources}'
4, See error/output:
{
"name": "copyutil",
"resources": {
"limits": { "cpu": "500m", "memory": "512Mi" },
"requests": { "cpu": "100m", "memory": "128Mi" }
}
}
{
"name": "update-ca-certificates",
"resources": {}
}
Expected behavior The update-ca-certificates init container should inherit spec.repo.resources (requests and limits) identically to how copyutil inherits them and how upstream argocd-operator implements it via getArgoRepoResources(cr).
Screenshots N/A
Additional context
Root cause: In PR #987 (controllers/argocd/openshift/openshift.go), the downstream reconciler hook updateSystemCATrustBuilding() drops the upstream update-ca-certificates container to replace it with a RHEL-native container, but omits setting Resources on the new corev1.Container definition:
initContainer := corev1.Container{
Name: "update-ca-certificates",
Image: prodImage,
SecurityContext: argoutil.DefaultSecurityContext(),
VolumeMounts: ...,
Command: ...,
Args: ...,
// Missing: Resources field
}
Impact:
In environments with a ResourceQuota requiring resource limits/requests, the API server rejects pod creation with: failed quota: ...: must specify limits.cpu,limits.memory,requests.cpu,requests.memory for: update-ca-certificates.
Environment: Reproduced on OpenShift GitOps Operator v1.22.1 (introduced in v1.20.0 with PR #987).
- 主要语言
- Go
- 星标
- 189
- 派生
- 365
- 平均合并
- 6 天 5 小时
- 30 天内合并 PR
- 44
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
redhat-developer/gitops-operator 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 86/100
redhat-developer/gitops-operator#1287 ·
维护者通常 1 天内回复
-
Harden OpenShift manual-install SCC troubleshooting guidance可能重新可做 @olivergondza 于 34 天前认领,目前没有进行中的 PR。 未关闭
redhat-developer/gitops-operator#1295 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
redhat-developer/gitops-operator#634 · 1 条评论 ·
维护者通常 1 天内回复
-
NodePlacement or Toleration/NodeSelector not working可能已有人在做 @Pratik-Redhat-Tech 于 44 天前认领。 未关闭triage:required
难度 4/5 3-5 天 新手友好度 48/100
redhat-developer/gitops-operator#572 · 2 条评论 ·
维护者通常 1 天内回复
查看 redhat-developer/gitops-operator 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
oasdiff/oasdiff#1337 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
dataiku/kiji-proxy#635 ·
-
难度 2/5 1-3 小时 新手友好度 67/100
hyperledger-firefly/signer#126 ·
-
agent-review-finding chore
难度 2/5 1-3 小时 新手友好度 73/100
jordansmall/spindrift#5748 ·
维护者通常 1 天内回复