kudobuilder / kudo

Kubernetes Universal Declarative Operator (KUDO)
https://kudo.dev
Apache License 2.0
1.18k stars 103 forks source link

Error during execution: fatal error: failed to resolve package #1714

Closed helli0n closed 3 years ago

helli0n commented 3 years ago

When I try to deploy flink-demo:

2020/10/15 10:22:11 InstanceController: Error during execution: fatal error: failed to resolve package kafka-1.3.1-, dependency of package flink-demo-0.1.5-: failed to resolve operator version default/kafka-1.3.1:

I tried to add appVersion: 2.5.1 for the kafka deployment

  - name: kafka
    kind: KudoOperator
    spec:
      package: kafka
      operatorVersion: 1.3.2
      appVersion: 2.5.1
      parameterFile: kafka-params.yaml
      instanceName: kafka

It shows: 2020/10/15 10:27:49 InstanceController: Error during execution: fatal error: failed to resolve package kafka-1.3.2-2.5.1, dependency of package flink-demo-0.1.7-: failed to resolve operator version default/kafka-1.3.2:2.5.1

Looks like mistake is here

https://github.com/kudobuilder/kudo/pull/1684/files

or

https://kudo-repository.storage.googleapis.com/ as kafka package calls kafka-2.5.1_1.3.2 but kudo tries to get kafka-1.3.2-2.5.1

As I understood, need to change code or rename package name.

Environment:

nfnt commented 3 years ago

Thanks for the report, @helli0n! This should be the breaking change in KUDO 0.17 around OperatorVersion names. The flink demo wasn't adapted to this change. I'll see that it gets updated. As a workaround, is should work as expected with KUDO 0.16.

nfnt commented 3 years ago

Let me verify that this indeed an oversight in the flink demo. If it is, I'll close this ticket and create one in github.com/kudobuilder/operators where flink-demo is hosted.

helli0n commented 3 years ago

I tried with my custom operator and I've got the same issue. Looks like this is global issue.

nfnt commented 3 years ago

Yes, you're right. This isn't an oversight in the flink demo, but rather a bug introduced in https://github.com/kudobuilder/kudo/pull/1684/files, as you already pointed out. Will investigate further. Again, thanks for the detailed report!

ANeumann82 commented 3 years ago

@helli0n Could you try to update your KUDO repository configuration?

Have a look at the ~/.kudo/repository/repositories.yaml file, please. It should look like this:

context: community
repoVersion: v1
repositories:
- name: community
  url: https://kudo-repository.storage.googleapis.com/v1

From what you posted, it looks like you're using a very old repository https://kudo-repository.storage.googleapis.com/ (note the missing v1 at the end).

This might be the problem.

helli0n commented 3 years ago

Hello, Here is my file:

$ cat ~/.kudo/repository/repositories.yaml 
context: community
repoVersion: v1
repositories:
- name: community
  url: https://kudo-repository.storage.googleapis.com/v1

I tied to open https://kudo-repository.storage.googleapis.com/v1 but that url doesn't show the packages.

ANeumann82 commented 3 years ago

Ok, that looks correct. The URL of the new repo doesn't show the packages directly, but you can look at https://kudo-repository.storage.googleapis.com/v1/index.yaml to see the index.

helli0n commented 3 years ago

Looks like after upgrading kudo to new 0.17.0 version and added new properties it is started to work.

tasks:
  - name: kafka
    kind: KudoOperator
    spec:
      package: kafka
      appVersion: 2.5.1
      operatorVersion: 1.3.2
      parameterFile: kafka-params.yaml
      instanceName: kafka
  - name: zookeeper
    kind: KudoOperator
    spec:
      package: zookeeper
      operatorVersion: 0.3.1
      appVersion: 3.4.14
      parameterFile: zookeeper-params.yaml
      instanceName: zk

Thank you!

nfnt commented 3 years ago

Yes, I could reproduce this and fix it by adding appVersion to the KudoOperator dependency spec. We are still discussing in the team if this should be expected behaviour in KUDO. Anyways, the flink demo needs to be fixed.