Skip to content

Fix initiliazation of new projects #60

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

Closed

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 !

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 23, 2025
@openshift-merge-robot
Copy link

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@acornett21 acornett21 closed this May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants