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

Cannot create CR with custom name by OperandRequest #711

Open
morningspace opened this issue Jul 17, 2021 · 3 comments
Open

Cannot create CR with custom name by OperandRequest #711

morningspace opened this issue Jul 17, 2021 · 3 comments
Labels
kind/bug Something isn't working

Comments

@morningspace
Copy link

/kind bug

What steps did you take and what happened:

I was looking for a way to have OperandRequest to create the Operand CR with a custom name rather than using the default CR name defined in alm-examples in CSV. By looking at the code, it looks the way to achieve this is using instanceName when define OperandRequest, e.g:

apiVersion: operator.ibm.com/v1alpha1
kind: OperandRequest
metadata:
  name: foo
spec:
  requests:
  - registry: bar
    registryNamespace: default
    operands:
    - name: elastic-cloud-eck
      kind: Elasticsearch
      apiVersion: elasticsearch.k8s.elastic.co/v1
      instanceName: baz
      spec:
        version: 7.13.3
        nodeSets:
        - name: default
          count: 1
          config:
            node.store.allow_mmap: false

However, after I apply the above change, I see ODLM leaves the Operand spec empty:

apiVersion: operator.ibm.com/v1alpha1
kind: OperandRequest
metadata:
  name: foo
spec:
  requests:
  - registry: bar
    registryNamespace: default
    operands:
    - name: elastic-cloud-eck
      kind: Elasticsearch
      apiVersion: elasticsearch.k8s.elastic.co/v1
      instanceName: baz
      spec: {}

This causes the CR failed to recreate, see logs in ODLM:

E0717 10:37:56.184088       1 operandrequest_controller.go:145] failed to reconcile Operands for OperandRequest default/foo: the following errors occurred:
  - the following errors occurred:
  - failed to create custom resource: Elasticsearch.elasticsearch.k8s.elastic.co "baz" is invalid: [spec.nodeSets: Required value, spec.version: Required value]

What did you expect to happen:

ODLM should allow me to create OperandRequest w/ non-empty Operand spec.

Anything else you would like to add:

Environment:

  • ODLM version: latest
  • Minikube/KIND/OCP version: kind v0.12.0-alpha+718ede73045ce3
  • Kubernetes version: (use kubectl version): v1.21.2
  • OS (e.g. from /etc/os-release): RHEL
@ibm-ci-bot ibm-ci-bot added the kind/bug Something isn't working label Jul 17, 2021
@Daniel-Fan
Copy link
Contributor

Hi @morningspace

It is because we did not preserve the unknown filed for CR's spec section. PR is created #702

@morningspace
Copy link
Author

Thanks, I see it's been opened for a while, wonder when will this be merged :-)

@Daniel-Fan
Copy link
Contributor

It will be merged on next Monday, but it will take a while to include this fix in public build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants