我正在尝试将(patchJSON6922)多个volumeMount修补到基本kustomization中。但是,当我在多个volumeMount中打补丁时,会出现错误。这是我的配置:
kustomization.yaml
commonLabels:
app: my-app
imageTags:
- name: my-app
newName: localhost/my-app
newTag: latest
bases:
- app
patchesJson6902:
- target:
group: apps
version: v1
kind: Deployment
name: my-app
path: create_volume_one.yaml
- target:
group: apps
version: v1
kind: Deployment
name: my-app
path: create_volume_two.yaml
create_volume_one.yaml
- op: add
path: /spec/template/spec/containers/0/volumeMounts
value:
name: volumeOne
mountPath: /data/one
create_volume_two.yaml
- op: add
path: /spec/template/spec/containers/0/volumeMounts/-
value:
name: volumeTwo
mountPath: /data/two
当我运行说kustomization时,出现以下错误:
$> kubectl kustomize .
Error: found conflict between different patches
&resource.Resource{Kunstructured:(*kunstruct.UnstructAdapter)(0xc000010058), options:(*types.GenArgs)(0xc00038eb00)} doesn't deep equal &resource.Resource{Kunstructured:(*kunstruct.UnstructAdapter)(0xc0000c6038), options:(*types.GenArgs)(0xc00038eb00)}
Examples:
# Use the current working directory
kubectl kustomize .
# Use some shared configuration directory
kubectl kustomize /home/configuration/production
# Use a URL
kubectl kustomize github.com/kubernetes-sigs/kustomize.git/examples/helloWorld?ref=v1.0.6
Usage:
kubectl kustomize <dir> [flags] [options]
Use "kubectl options" for a list of global command-line options (applies to all commands).
found conflict between different patches
&resource.Resource{Kunstructured:(*kunstruct.UnstructAdapter)(0xc000010058), options:(*types.GenArgs)(0xc00038eb00)} doesn't deep equal &resource.Resource{Kunstructured:(*kunstruct.UnstructAdapter)(0xc0000c6038), options:(*types.GenArgs)(0xc00038eb00)}
我尝试了各种路径(在-
之后使用volumeMounts
和不使用volumeMounts
,但均无济于事)。
当我注释掉create_volume_two.yaml部分时,一切正常。因此,我想知道我该怎么做才能正确地附加到auth().getUser()
上。
任何帮助将不胜感激。谢谢,
答案 0 :(得分:0)
显然,kubectl
(2.0.3)的kustomize
版本较旧,不支持附加到项。使用最新的kustomize(3.1.0)解决了我的问题。