Skip to content
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

Fix initiliazation of new projects #60

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jenrik
Copy link

@jenrik jenrik commented Mar 5, 2024

Description of the change:

Fixes a bug where we try to search-and-remove some boilerplate that have changed upstream.

Motivation for the change:

Attempting to initialize new operator project is not possible as you get the below error message:

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
Usage:
  operator-sdk init [flags]

Examples:

  # Scaffold a project with no API
  $ operator-sdk init --plugins=base.ansible.sdk.operatorframework.io/v1 --domain=my.domain \

  # Invokes "create api"
  $ operator-sdk init --plugins=base.ansible.sdk.operatorframework.io/v1 \
      --domain=my.domain \
      --group=apps --version=v1alpha1 --kind=AppService

  $ operator-sdk init --plugins=base.ansible.sdk.operatorframework.io/v1 \
      --domain=my.domain \
      --group=apps --version=v1alpha1 --kind=AppService \
      --generate-role

  $ operator-sdk init --plugins=base.ansible.sdk.operatorframework.io/v1 \
      --domain=my.domain \
      --group=apps --version=v1alpha1 --kind=AppService \
      --generate-playbook

  $ operator-sdk init --plugins=base.ansible.sdk.operatorframework.io/v1 \
      --domain=my.domain \
      --group=apps --version=v1alpha1 --kind=AppService \
      --generate-playbook \
      --generate-role


Flags:
      --project-version string   project version (default "3")
      --domain string            domain for groups (default "my.domain")
      --project-name string      name of this project
      --group string             resource Group
      --version string           resource Version
      --kind string              resource Kind
      --generate-role            Generate an Ansible role skeleton.
      --generate-playbook        Generate an Ansible playbook. If passed with --generate-role, the playbook will invoke the role.
  -h, --help                     help for init

Global Flags:
      --plugins strings   plugin keys to be used for this subcommand execution
      --verbose           Enable verbose logging

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

Fixes a bug where we try to search-and-remove some boilerplate that have
changed.
@everettraven
Copy link
Collaborator

Thanks for submitting this contribution @jenrik !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants