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

Uninstalling template-operator on DEV fails with "no matches for kind "Managed" " #2177

Open
c-pius opened this issue Jan 14, 2025 · 1 comment
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@c-pius
Copy link
Contributor

c-pius commented Jan 14, 2025

Description

We hat several occurrences of uninstalling template-operator on DEV failing with 'failed rest mapping [Managed.operator.kyma-project.io, v1alpha1]: no matches for kind "Managed" in version "operator.kyma-project.io/v1alpha1"'.

Checking the SKR, the module resources are fully removed, e.g., namespace, module manager, sample CRD and CR, managed CRD, ...

YAMLs
apiVersion: operator.kyma-project.io/v1beta2
kind: Manifest
metadata:
  annotations:
    operator.kyma-project.io/fqdn: kyma-project.io/module/template-operator
    sync-oci-ref: sha256:251e9efb21a9502eccfef501a9b07aa13fa50189013cb314cb8ef07e0a2d6195
  creationTimestamp: "2025-01-03T14:05:00Z"
  deletionGracePeriodSeconds: 0
  deletionTimestamp: "2025-01-13T13:33:18Z"
  finalizers:
  - declarative.kyma-project.io/finalizer
  - label-removal-finalizer
  generation: 2
  labels:
    operator.kyma-project.io/channel: ""
    operator.kyma-project.io/controller-name: ""
    operator.kyma-project.io/kyma-name: dcb61543-4b85-4286-b672-0ef67880e672
    operator.kyma-project.io/managed-by: lifecycle-manager
    operator.kyma-project.io/module-name: template-operator
  name: dcb61543-4b85-4286-b672-0ef67880e672-template-operator-2235966
  namespace: kcp-system
  ownerReferences:
  - apiVersion: operator.kyma-project.io/v1beta2
    blockOwnerDeletion: true
    controller: true
    kind: Kyma
    name: dcb61543-4b85-4286-b672-0ef67880e672
    uid: 92bbb0cd-76d5-4fd5-b244-e1e34429a5dd
  resourceVersion: "4412256112"
  uid: 1fe819b7-1670-4860-8e57-507aca33e6ef
spec:
  install:
    name: raw-manifest
    source:
      name: kyma-project.io/module/template-operator
      ref: sha256:251e9efb21a9502eccfef501a9b07aa13fa50189013cb314cb8ef07e0a2d6195
      repo: europe-west3-docker.pkg.dev/sap-kyma-jellyfish-dev/template-operator/component-descriptors
      type: oci-dir
  remote: true
  version: 0.0.2-catalog-meta
status:
  conditions:
  - lastTransitionTime: "2025-01-03T14:05:01Z"
    message: resources are parsed and ready for use
    observedGeneration: 1
    reason: ResourcesAvailable
    status: "True"
    type: Resources
  - lastTransitionTime: "2025-01-03T14:05:16Z"
    message: installation is ready and resources can be used
    observedGeneration: 1
    reason: Ready
    status: "True"
    type: Installation
  - lastTransitionTime: "2025-01-03T14:05:00Z"
    message: Module CR is in Warning state
    observedGeneration: 1
    reason: Warning
    status: "False"
    type: ModuleCR
  lastOperation:
    lastUpdateTime: "2025-01-13T13:40:54Z"
    operation: 'failed rest mapping [Managed.operator.kyma-project.io, v1alpha1]:
      no matches for kind "Managed" in version "operator.kyma-project.io/v1alpha1"'
  state: Error
  synced:
  - group: ""
    kind: Namespace
    name: template-operator-system
    namespace: ""
    version: v1
  - group: apiextensions.k8s.io
    kind: CustomResourceDefinition
    name: manageds.operator.kyma-project.io
    namespace: ""
    version: v1
  - group: apiextensions.k8s.io
    kind: CustomResourceDefinition
    name: samples.operator.kyma-project.io
    namespace: ""
    version: v1
  - group: ""
    kind: ServiceAccount
    name: template-operator-controller-manager
    namespace: template-operator-system
    version: v1
  - group: rbac.authorization.k8s.io
    kind: Role
    name: template-operator-leader-election-role
    namespace: template-operator-system
    version: v1
  - group: rbac.authorization.k8s.io
    kind: ClusterRole
    name: template-operator-manager-role
    namespace: ""
    version: v1
  - group: rbac.authorization.k8s.io
    kind: ClusterRole
    name: template-operator-metrics-reader
    namespace: ""
    version: v1
  - group: rbac.authorization.k8s.io
    kind: ClusterRole
    name: template-operator-proxy-role
    namespace: ""
    version: v1
  - group: rbac.authorization.k8s.io
    kind: RoleBinding
    name: template-operator-leader-election-rolebinding
    namespace: template-operator-system
    version: v1
  - group: rbac.authorization.k8s.io
    kind: ClusterRoleBinding
    name: template-operator-manager-rolebinding
    namespace: ""
    version: v1
  - group: rbac.authorization.k8s.io
    kind: ClusterRoleBinding
    name: template-operator-proxy-rolebinding
    namespace: ""
    version: v1
  - group: ""
    kind: Service
    name: template-operator-metrics-service
    namespace: template-operator-system
    version: v1
  - group: apps
    kind: StatefulSet
    name: template-operator-controller-manager
    namespace: template-operator-system
    version: v1
  - group: operator.kyma-project.io
    kind: Managed
    name: template-operator-managed-resource
    namespace: template-operator-system
    version: v1alpha1
apiVersion: operator.kyma-project.io/v1beta2
kind: Kyma
metadata:
  annotations:
    compass-runtime-id-for-migration: dcb61543-4b85-4286-b672-0ef67880e672
    kyma-kcp-crd-generation: "12"
    kyma-skr-crd-generation: "2"
    modulereleasemeta-kcp-crd-generation: "2"
    modulereleasemeta-skr-crd-generation: "2"
    moduletemplate-kcp-crd-generation: "478"
    moduletemplate-skr-crd-generation: "2"
    skr-domain: c-32911b2.dev.kyma.ondemand.com
  creationTimestamp: "2024-11-21T08:39:07Z"
  finalizers:
  - operator.kyma-project.io/purge-finalizer
  - operator.kyma-project.io/runtime-monitoring-finalizer
  - operator.kyma-project.io/Kyma
  generation: 1
  labels:
    kyma-project.io/broker-plan-id: 361c511f-f939-4621-b228-d0fb79a1fe15
    kyma-project.io/broker-plan-name: aws
    kyma-project.io/global-account-id: 2358e708-68f0-4af0-94b6-cf4e8407aff8
    kyma-project.io/instance-id: 2792B5D9-FA67-45A6-8F2D-318ABF1630F0
    kyma-project.io/platform-region: cf-us10-staging
    kyma-project.io/provider: AWS
    kyma-project.io/region: eu-central-1
    kyma-project.io/runtime-id: dcb61543-4b85-4286-b672-0ef67880e672
    kyma-project.io/shoot-name: c-32911b2
    kyma-project.io/subaccount-id: 65bb11c3-71ff-4fa1-8312-f2b71dfd8c66
    operator.kyma-project.io/beta: "false"
    operator.kyma-project.io/internal: "true"
    operator.kyma-project.io/kyma-name: dcb61543-4b85-4286-b672-0ef67880e672
    operator.kyma-project.io/managed-by: lifecycle-manager
  name: dcb61543-4b85-4286-b672-0ef67880e672
  namespace: kcp-system
  resourceVersion: "4413648224"
  uid: 92bbb0cd-76d5-4fd5-b244-e1e34429a5dd
spec:
  channel: fast
  modules:
  - customResourcePolicy: CreateAndDelete
    managed: true
    name: api-gateway
  - customResourcePolicy: CreateAndDelete
    managed: true
    name: istio
  - customResourcePolicy: CreateAndDelete
    managed: true
    name: btp-operator
status:
  activeChannel: fast
  conditions:
  - lastTransitionTime: "2025-01-14T09:35:06Z"
    message: not all modules are in ready state
    observedGeneration: 1
    reason: Ready
    status: "False"
    type: Modules
  - lastTransitionTime: "2025-01-14T09:35:06Z"
    message: module templates are synchronized
    observedGeneration: 1
    reason: Ready
    status: "True"
    type: ModuleCatalog
  - lastTransitionTime: "2025-01-14T09:35:06Z"
    message: skrwebhook is synchronized
    observedGeneration: 1
    reason: Ready
    status: "True"
    type: SKRWebhook
  lastOperation:
    lastUpdateTime: "2025-01-14T09:35:06Z"
    operation: waiting for all modules to become ready
  modules:
  - channel: fast
    fqdn: kyma-project.io/module/eventing
    manifest:
      apiVersion: operator.kyma-project.io/v1beta2
      kind: Manifest
      metadata:
        name: dcb61543-4b85-4286-b672-0ef67880e672-eventing-3765891325
        namespace: kcp-system
    name: eventing
    resource:
      apiVersion: operator.kyma-project.io/v1alpha1
      kind: Eventing
      metadata:
        name: eventing
        namespace: kyma-system
    state: Ready
    template:
      apiVersion: operator.kyma-project.io/v1beta2
      kind: ModuleTemplate
      metadata:
        generation: 4
        name: eventing-fast
        namespace: kcp-system
    version: 1.2.2
  - channel: fast
    fqdn: kyma-project.io/module/api-gateway
    manifest:
      apiVersion: operator.kyma-project.io/v1beta2
      kind: Manifest
      metadata:
        name: dcb61543-4b85-4286-b672-0ef67880e672-api-gateway-1209152227
        namespace: kcp-system
    name: api-gateway
    resource:
      apiVersion: operator.kyma-project.io/v1alpha1
      kind: APIGateway
      metadata:
        name: default
        namespace: ""
    state: Ready
    template:
      apiVersion: operator.kyma-project.io/v1beta2
      kind: ModuleTemplate
      metadata:
        generation: 14
        name: api-gateway-fast
        namespace: kcp-system
    version: 2.10.2
  - channel: fast
    fqdn: kyma-project.io/module/istio
    manifest:
      apiVersion: operator.kyma-project.io/v1beta2
      kind: Manifest
      metadata:
        name: dcb61543-4b85-4286-b672-0ef67880e672-istio-4034478325
        namespace: kcp-system
    name: istio
    resource:
      apiVersion: operator.kyma-project.io/v1alpha2
      kind: Istio
      metadata:
        name: default
        namespace: kyma-system
    state: Deleting
    template:
      apiVersion: operator.kyma-project.io/v1beta2
      kind: ModuleTemplate
      metadata:
        generation: 23
        name: istio-fast
        namespace: kcp-system
    version: 1.12.0
  - channel: fast
    fqdn: kyma-project.io/module/btp-operator
    manifest:
      apiVersion: operator.kyma-project.io/v1beta2
      kind: Manifest
      metadata:
        name: dcb61543-4b85-4286-b672-0ef67880e672-btp-operator-732144065
        namespace: kcp-system
    name: btp-operator
    resource:
      apiVersion: operator.kyma-project.io/v1alpha1
      kind: BtpOperator
      metadata:
        name: btpoperator
        namespace: kyma-system
    state: Deleting
    template:
      apiVersion: operator.kyma-project.io/v1beta2
      kind: ModuleTemplate
      metadata:
        generation: 16
        name: btp-operator-fast
        namespace: kcp-system
    version: 1.1.19
  - channel: fast
    fqdn: kyma-project.io/module/serverless
    manifest:
      apiVersion: operator.kyma-project.io/v1beta2
      kind: Manifest
      metadata:
        name: dcb61543-4b85-4286-b672-0ef67880e672-serverless-2752323641
        namespace: kcp-system
    name: serverless
    resource:
      apiVersion: operator.kyma-project.io/v1alpha1
      kind: Serverless
      metadata:
        name: default
        namespace: kyma-system
    state: Ready
    template:
      apiVersion: operator.kyma-project.io/v1beta2
      kind: ModuleTemplate
      metadata:
        generation: 10
        name: serverless-fast
        namespace: kcp-system
    version: 1.6.6
  - channel: fast
    fqdn: kyma-project.io/module/template-operator
    manifest:
      apiVersion: operator.kyma-project.io/v1beta2
      kind: Manifest
      metadata:
        name: dcb61543-4b85-4286-b672-0ef67880e672-template-operator-2235966
        namespace: kcp-system
    name: template-operator
    state: Error
    template:
      apiVersion: operator.kyma-project.io/v1beta2
      kind: ModuleTemplate
      metadata:
        generation: 5
        name: template-operator-0.0.2-catalog-meta
        namespace: kcp-system
    version: 0.0.2-catalog-meta
  state: Error

image

Steps to reproduce

The affected clusters where from Mateusz and KK. For Mateusz it even occurred twice. Simply trying to install and uninstall in an own DEV cluster didn't re-produce the same problem.

Environment Type

Managed

Environment Info

Kubernetes Version: x.y.z
Docker Version: x.y.z
modulectl Version: x.y.z
If used - k3d/k3s/minikube versions

Attachments

No response

@c-pius c-pius added the kind/bug Categorizes issue or PR as related to a bug. label Jan 14, 2025
@c-pius
Copy link
Contributor Author

c-pius commented Jan 14, 2025

@nesmabadr nesmabadr self-assigned this Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants