0

当我运行make bundle.

完整的输出是

/Users/foobar/Documents/my-operator/bin/controller-gen "crd:trivialVersions=true,preserveUnknownFields=false" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
operator-sdk generate kustomize manifests -q
cd config/manager && /Users/foobar/Documents/my-operator/bin/kustomize edit set image controller=registry.io/my-operator:latest
/Users/foobar/Documents/my-operator/bin/kustomize build config/manifests | operator-sdk generate bundle -q --overwrite --version 0.0.5  
Error: accumulating resources: 2 errors occurred:
        * accumulateFile error: "accumulating resources from '../samples': '/Users/foobar/Documents/my-operator/config/samples' must resolve to a file"
        * accumulateDirector error: "recursed accumulation of path '/Users/foobar/Documents/my-operator/config/samples': accumulating resources: 2 errors occurred:\n\t* accumulateFile error: \"accumulating resources from 'myapplicationui.yaml': evalsymlink failure on '/Users/foobar/Documents/my-operator/config/samples/myapplicationui.yaml' : lstat /Users/foobar/Documents/my-operator/config/samples/myapplicationui.yaml: no such file or directory\"\n\t* loader.New error: \"error loading myapplicationui.yaml with git: url lacks orgRepo: myapplicationui.yaml, dir: evalsymlink failure on '/Users/foobar/Documents/my-operator/config/samples/myapplicationui.yaml' : lstat /Users/foobar/Documents/my-operator/config/samples/myapplicationui.yaml: no such file or directory, get: invalid source string: myapplicationui.yaml\"\n\n"


INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /Users/foobar/Documents/my-operator/bundle/metadata 
INFO[0000] Building Dockerfile                          
INFO[0000] Writing bundle.Dockerfile in /Users/foobar/Documents/my-operator 
operator-sdk bundle validate ./bundle
INFO[0000] Found annotations file                        bundle-dir=bundle container-tool=docker
INFO[0000] Could not find optional dependencies file     bundle-dir=bundle container-tool=docker
ERRO[0000] Error: Value myapplication.example.com/v1alpha1, Kind=MyApplication: CRD "myapplication.example.com/v1alpha1, Kind=MyApplication" is present in bundle "my-operator.v0.0.5" but not defined in CSV 
ERRO[0000] Error: Value myapplication.example.com/v1alpha1, Kind=MyApplicationUI: CRD "myapplication.example.com/v1alpha1, Kind=MyApplicationUI" is present in bundle "my-operator.v0.0.5" but not defined in CSV

这个错误的原因是什么?

4

1 回答 1

1

底部的错误是一个红鲱鱼。当您亲自体验时,实际的错误会进一步上升且没有颜色。具体来说,一个 Kustomize yaml 期待一个myapplicationui.yaml但找不到它。

myapplicationui_sample.yaml当您团队中的某个人尝试重命名文件(例如 to )而不检查所有引用时,很容易发生这种情况。

于 2021-03-19T07:10:09.873 回答