-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Not able to test Ansible operator locally or on a k3s cluster #4530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
hmm, that error would indicate that ansible-runner never ran, could you paste a full log? |
Yeah it looks like a preceding error caused ansible-runner to fail. The runner will always try to symlink the artifact dir, so gating symlinking on artifact dir existence should prevent this particular error. |
So the issue there is that we were not able to find the
|
and 👍 to @estroz , if we're not finding the |
Signed-off-by: rashmigottipati <[email protected]>
Signed-off-by: rashmigottipati <[email protected]>
Signed-off-by: rashmigottipati <[email protected]>
Signed-off-by: rashmigottipati <[email protected]>
…ocally or on k8s cluster Signed-off-by: rashmigottipati <[email protected]>
…ocally or on k8s cluster Signed-off-by: rashmigottipati <[email protected]>
… cluster (#4944) * Bugfix for #4530: unable to test ansible operator locally or on k8s cluster Signed-off-by: rashmigottipati <[email protected]>
Bug Report
What did you do?
I am trying to follow this doc:https://sdk.operatorframework.io/docs/building-operators/ansible/development-tips/ which creates ansible operator by using kubernetes collections to install configmap but when i am trying to run it locally via Ansible-runner or on cluster, i am not seeing any configmaps created
What did you expect to see?
configmaps get created via ansible operator
What did you see instead? Under which circumstances?
I am getting reconciler error when i am running make run command as shown below:
{"level":"error","ts":1613395806.9045317,"logger":"runner","msg":"Error symlinking latest artifacts","job":"7504504064263669287","name":"foo-sample","namespace":"default","error":"symlink /tmp/ansible-operator/runner/foo.example.com/v1alpha1/Foo/default/foo-sample/artifacts/7504504064263669287 /tmp/ansible-operator/runner/foo.example.com/v1alpha1/Foo/default/foo-sample/artifacts/latest: no such file or directory","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/home/travis/gopath/pkg/mod/github.com/go-logr/[email protected]/zapr.go:132\ngithub.com/operator-framework/operator-sdk/internal/ansible/runner.(*runner).Run.func1\n\tinternal/ansible/runner/runner.go:284"}
{"level":"error","ts":1613395806.9107356,"logger":"reconciler","msg":"Failed to get ansible-runner stdout","job":"7504504064263669287","name":"foo-sample","namespace":"default","error":"open /tmp/ansible-operator/runner/foo.example.com/v1alpha1/Foo/default/foo-sample/artifacts/7504504064263669287/stdout: no such file or directory","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/home/travis/gopath/pkg/mod/github.com/go-logr/[email protected]/zapr.go:132\ngithub.com/operator-framework/operator-sdk/internal/ansible/controller.(*AnsibleOperatorReconciler).Reconcile\n\tinternal/ansible/controller/reconcile.go:226\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/home/travis/gopath/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:293\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/travis/gopath/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:248\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1.1\n\t/home/travis/gopath/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1\n\t/home/travis/gopath/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:185\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\t/home/travis/gopath/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\t/home/travis/gopath/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/home/travis/gopath/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext\n\t/home/travis/gopath/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:185\nk8s.io/apimachinery/pkg/util/wait.UntilWithContext\n\t/home/travis/gopath/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:99"}
{"level":"error","ts":1613395806.910875,"logger":"controller-runtime.manager.controller.foo-controller","msg":"Reconciler error","name":"foo-sample","namespace":"default","error":"open /tmp/ansible-operator/runner/foo.example.com/v1alpha1/Foo/default/foo-sample/artifacts/7504504064263669287/stdout: no such file or directory","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/home/travis/gopath/pkg/mod/github.com/go-logr/[email protected]/zapr.go:132\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/home/travis/gopath/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:297\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/travis/gopath/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:248\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1.1\n\t/home/travis/gopath/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1\n\t/home/travis/gopath/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:185\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\t/home/travis/gopath/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\t/home/travis/gopath/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/home/travis/gopath/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext\n\t/home/travis/gopath/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:185\nk8s.io/apimachinery/pkg/util/wait.UntilWithContext\n\t/home/travis/gopath/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:99"}
Environment
Operator type:
/language ansible
Kubernetes cluster type:
k3s 1.19.4
$ operator-sdk version
operator-sdk version: "v1.4.0", commit: "67f9c8b888887d18cd38bb6fd85cf3cf5b94fd99", kubernetes version: "1.19.4", go version: "go1.15.5", GOOS: "linux", GOARCH: "amd64"
$ go version
(if language is Go)$ kubectl version
glcgadmin@gl1-seednode:~/foo-operator> kubectl version
Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.4+k3s1", GitCommit:"2532c10faad43e2b6e728fdcc01662dc13d37764", GitTreeState:"clean", BuildDate:"2020-11-18T22:11:18Z", GoVersion:"go1.15.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.4+k3s1", GitCommit:"2532c10faad43e2b6e728fdcc01662dc13d37764", GitTreeState:"clean", BuildDate:"2020-11-18T22:11:18Z", GoVersion:"go1.15.2", Compiler:"gc", Platform:"linux/amd64"}
Possible Solution
Based on documentation, it should work ideally. Since, I am new to operators, i am hoping to get this issue fixed here,
Additional context
I have installed ansible-runner v1.4.7 and ansible-runner-http v1.0.0 and installed requirements.txt via ansible-galaxy
The text was updated successfully, but these errors were encountered: