operator-framework / operator-sdk

SDK for building Kubernetes applications. Provides high level APIs, useful abstractions, and project scaffolding.
https://sdk.operatorframework.io
Apache License 2.0
7.21k stars 1.74k forks source link

Operator SDK Version `1.34.1` Fails to Scaffold Ansible Projects #6750

Closed acornett21 closed 3 months ago

acornett21 commented 7 months ago

Bug Report

What did you do?

Run The below

mkdir memcached-operator
cd memcached-operator
operator-sdk init --domain example.com --plugins ansible

What did you expect to see?

A fully scaffold project

What did you see instead? Under which circumstances?

The SDK errors

INFO[0000] Writing kustomize manifests for you to edit... 
Error: failed to initialize project: unable to scaffold with "base.ansible.sdk.operatorframework.io/v1": error updating init manifests: error updating kustomization.yaml files: remove config/default/kustomization.yaml patch and vars blocks: unable to find the content to be replaced

Environment

Operator type:

/language ansible

Kubernetes cluster type:

$ operator-sdk version operator-sdk version: "v1.34.1", commit: "edaed1e5057db0349568e0b02df3743051b54e68", kubernetes version: "1.28.0", go version: "go1.21.7", GOOS: "linux", GOARCH: "amd64"

$ go version (if language is Go) Any

$ kubectl version NA

Possible Solution

Additional context

openshift-ci[bot] commented 7 months ago

@acornett21: The label(s) language/ansible cannot be applied, because the repository doesn't have them.

In response to [this](https://github.com/operator-framework/operator-sdk/issues/6750): >## Bug Report > > > >#### What did you do? > >Run The below >``` >mkdir memcached-operator >cd memcached-operator >operator-sdk init --domain example.com --plugins ansible >``` > > >#### What did you expect to see? > >A fully scaffold project > >#### What did you see instead? Under which circumstances? > >The SDK errors >``` >INFO[0000] Writing kustomize manifests for you to edit... >Error: failed to initialize project: unable to scaffold with "base.ansible.sdk.operatorframework.io/v1": error updating init manifests: error updating kustomization.yaml files: remove config/default/kustomization.yaml patch and vars blocks: unable to find the content to be replaced >``` > >#### Environment > >**Operator type:** > > > > >/language ansible > > >**Kubernetes cluster type:** > > > >`$ operator-sdk version` >`operator-sdk version: "v1.34.1", commit: "edaed1e5057db0349568e0b02df3743051b54e68", kubernetes version: "1.28.0", go version: "go1.21.7", GOOS: "linux", GOARCH: "amd64"` > > >`$ go version` (if language is Go) >Any > >`$ kubectl version` >NA > >#### Possible Solution > > > >#### Additional context > > > Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
PYLochou commented 7 months ago

Same problem here, on macOS (arm64):

% operator-sdk version
operator-sdk version: "v1.34.1", commit: "edaed1e5057db0349568e0b02df3743051b54e68", kubernetes version: "v1.28.0", go version: "go1.21.7", GOOS: "darwin", GOARCH: "arm64"

% kustomize version
v5.3.0
lerminou commented 6 months ago

same problem here, works with the 1.33

kuwv commented 6 months ago

I just ran into this. I was able to create the scaffold about a 1-2 months ago. Unfortunately, the brew installation does not support multiple version installs.

acornett21 commented 4 months ago

Updating the ansible version and releasing operator-sdk did not fix this issue, since the root cause analysis seems to be incorrect. The issue is that operator-sdk pulls in a newer dependency of kubebuilder then the ansible plugin is expecting, see dep here.

If one updates this to the version that operator-sdk is running v3.13.1-0.20240119130530-7fba82c768f8, all of the tests fail with the same reason as operator-sdk does.

gusmb commented 4 months ago

Same issue here:

FATA[0000] failed to initialize project: unable to scaffold with "base.ansible.sdk.operatorframework.io/v1": error updating init manifests: error updating kustomization.yaml files: remove config/default/kustomization.yaml patch and vars blocks: unable to find the content to be replaced
$ operator-sdk version
operator-sdk version: "v1.34.2", commit: "81dd3cb24b8744de03d312c1ba23bfc617044005", kubernetes version: "1.28.0", go version: "go1.21.10", GOOS: "linux", GOARCH: "amd64"
kuwv commented 4 months ago

I was able to install an earlier release locally and continue. Hope this gets resolved soon though.

acornett21 commented 3 months ago

The root cause is fixed in 1.34.3 of the ansible-plugin https://github.com/operator-framework/ansible-operator-plugins/releases/tag/v1.34.3

PYLochou commented 3 months ago

I confirm it works now on macOS with operator-sdk 1.35 and kustomize 5.4.2. Thank you very much!