Open caixiangibm opened 1 month ago
@caixiangibm: The label(s) language/ansible
cannot be applied, because the repository doesn't have them.
Note that the command: kubectl cp
could be rewritten with k8s_cp module (https://docs.ansible.com/ansible/latest/collections/kubernetes/core/k8s_cp_module.html) regardless of kubectl version.
Bug Report
kubectl v1.30.0 command failed in ansible-operator:v1.34.1 with error malformed ws or wss URL
What did you do?
We built our ansible operator image based on quay.io/operator-framework/ansible-operator:v1.34.1, and also put kubectl v1.30.0 into the operator image. In one of ansible operator task, we need to use kubectl to copy some folder to temporary Operator pod, but this task failed with following error messages (some words are masked) FAILED! => {"changed": true, "cmd": ["kubectl", "cp", "/some_path/some_folder", "{{tmp_operator_pod_name}}:/some_path", "-n", "name_space"], ..., "msg": "non-zero return code", "rc": 1, ..., "stderr": "Defaulted container \"operator\" out of: operator, * (init)\nerror: malformed ws or wss URL", "stderr_lines": ["Defaulted container \"operator\" out of: operator, (init)", "error: malformed ws or wss URL"], "stdout": "", "stdout_lines": []}
But the same task works with kubectl v1.29.3 or kubectl v1.28.0
What did you expect to see?
We expect the latest kubectl 1.30.* should work with ansible-operator:v1.34.1 or higher version to run "kubectl cp" or other kubectl commands.
What did you see instead? Under which circumstances?
"kubectl cp" command (kubectl v1.30.0) failed with error: malformed ws or wss URL
Environment
Operator type:
language ansible
Kubernetes cluster type:
OpenShift
$ operator-sdk version
ansible-operator version ansible-operator version: "v1.34.1", commit: "a954ad17369509a87bc108f316276cb1cb4157ee", kubernetes version: "v1.28.0", go version: "go1.20.14", GOOS: "linux", GOARCH: "amd64"
$ go version
(if language is Go)ansible-operator v1.34.1 - go version: "go1.20.14" kubectl v1.30.0 - goVersion: go1.22.2
$ kubectl version
Possible Solution
Not sure whether it is compatible problem for ansible-operator to invoke other go application (e.g. kubectl)? kubectl v1.30.0 - goVersion: go1.22.2 kubectl v1.29.3 - goVersion: go1.21.8 kubectl v1.28.0 - goVersion: go1.20.7
Additional context