Skip to content

Commit 1a5768c

Browse files
authored
*: backport pin controller-runtime to v0.1.4 #828 to v0.2.x (#831)
* pkg/scaffold: Adjust gopkgtoml test to reflect change * pkg/scaffold: Pin controller-runtime to exactly v0.1.4 When you specify a version without an operator, dep automatically uses the ^ operator by default. That means it will take the major range. That broke building of generated operators due to missing dependencies in controller-runtime latest release. * pkg/ansible/runner: logs the stdout and stderr from ansible-runner if the command exits non-zero This is helpful in a case where ansible-runner itself is broken, such as when a python library it depends on gets installed at an incompatible version (a problem we've encountered multile times). * test/ansible-operator/Dockerfile: lock idna to 2.7 (#813)
2 parents f2b73ea + 49933fa commit 1a5768c

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

pkg/ansible/runner/runner.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ func (r *runner) Run(ident string, u *unstructured.Unstructured, kubeconfig stri
245245
dc = r.cmdFunc(ident, inputDir.Path)
246246
}
247247

248-
err := dc.Run()
248+
output, err := dc.CombinedOutput()
249249
if err != nil {
250-
logger.Error(err, "error from ansible-runner")
250+
logger.Error(err, string(output))
251251
} else {
252252
logger.Info("ansible-runner exited successfully")
253253
}

pkg/scaffold/gopkgtoml.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ required = [
8080
8181
[[override]]
8282
name = "sigs.k8s.io/controller-runtime"
83-
version = "v0.1.4"
83+
version = "=v0.1.4"
8484
8585
[[constraint]]
8686
name = "github.com/operator-framework/operator-sdk"

pkg/scaffold/gopkgtoml_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ required = [
7272
7373
[[override]]
7474
name = "sigs.k8s.io/controller-runtime"
75-
version = "v0.1.4"
75+
version = "=v0.1.4"
7676
7777
[[constraint]]
7878
name = "github.com/operator-framework/operator-sdk"

test/ansible-operator/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ RUN yum remove -y ansible python-idna
44
RUN pip uninstall ansible-runner -y
55

66
RUN pip install --upgrade setuptools
7-
RUN pip install ansible ansible-runner openshift kubernetes ansible-runner-http
7+
RUN pip install ansible ansible-runner openshift kubernetes ansible-runner-http idna==2.7
88

99
RUN mkdir -p /etc/ansible \
1010
&& echo "localhost ansible_connection=local" > /etc/ansible/hosts \

0 commit comments

Comments
 (0)