Uploaded image for project: 'Red Hat OpenStack Services on OpenShift'
  1. Red Hat OpenStack Services on OpenShift
  2. OSPRH-8705

Patch of openstackcontrolplane CR for Swift enabled causes error

XMLWordPrintable

    • 2
    • False
    • Hide

      None

      Show
      None
    • False
    • ?
    • ?
    • ?
    • ?
    • None
    • Moderate

      When applying a patch to the openstackcontrolplane CR to enable Swift, the following error occurs

      oc -n ${OSP18_NAMESPACE} patch openstackcontrolplane openstack --type=merge --patch '
      spec:
        swift:
          enabled: true
          template:
            memcachedInstance: memcached
            swiftRing:
              ringReplicas: 1
            swiftStorage:
              replicas: 0
              networkAttachments:
              - storage-osp18
              storageClass: local-storage
              storageRequest: 10Gi
            swiftProxy:
              secret: osp-secret
              replicas: 1
              passwordSelectors:
                service: SwiftPassword
              serviceUser: swift
              override:
                service:
                  internal:
                    metadata:
                      annotations:
                        metallb.universe.tf/address-pool: internalapi-osp18
                        metallb.universe.tf/allow-shared-ip: internalapi-osp18
                        metallb.universe.tf/loadBalancerIPs: 172.17.0.80
                    spec:
                      type: LoadBalancer
              networkAttachments:
              - storage-osp18
      '
      

       Error from server (InternalError): Internal error occurred: failed calling webhook "vopenstackcontrolplane.kb.io": failed to call webhook: Post "https://openstack-operator-controller-manager-service.openstack-operators.svc:443/validate-core-openstack-org-v1beta1-openstackcontrolplane?timeout=10s": EOF*

       

      There is an accompanying stack track in the openstack-operator-controller:

      2024/07/16 15:14:24 http: panic serving 10.130.0.2:53466: runtime error: invalid memory address or nil pointer dereference
      goroutine 790995 [running]:
      net/http.(*conn).serve.func1()
          /usr/lib/golang/src/net/http/server.go:1854 +0xbf
      panic(\{0x1cfcd40, 0x322cc60})
          /usr/lib/golang/src/runtime/panic.go:890 +0x263
      github.com/openstack-k8s-operators/swift-operator/api/v1beta1.(*SwiftSpecCore).ValidateUpdate(_, \{{{0x0, 0x0}, \{0x0, 0x0, 0x0}, \{0x0, 0x0}}, \{0x0, 0x0, ...}, ...}, ...)
          /opt/app-root/src/go/pkg/mod/github.com/openstack-k8s-operators/swift-operator/api@v0.3.1-0.20240704182345-5399100dea21/v1beta1/swift_webhook.go:205 +0x46
      github.com/openstack-k8s-operators/openstack-operator/apis/core/v1beta1.(*OpenStackControlPlane).ValidateUpdateServices(_, \{{0x0, 0x0}, \{0xc001163488, 0x15}, 0xc003bdef30, \{{0x1, {{...}, \{...}}}, \{0x1, ...}, ...}, ...}, ...)
          /remote-source/apis/core/v1beta1/openstackcontrolplane_webhook.go:400 +0x11c7
      github.com/openstack-k8s-operators/openstack-operator/apis/core/v1beta1.(*OpenStackControlPlane).ValidateUpdate(0xc000e8f800, \{0x22c53d0?, 0xc001851800})
          /remote-source/apis/core/v1beta1/openstackcontrolplane_webhook.go:151 +0x2c5
      sigs.k8s.io/controller-runtime/pkg/webhook/admission.(*validatingHandler).Handle(_, \{_, _}, \{{{0xc00578d9e0, 0x24}, \{{0xc0072bb770, 0x12}, \{0xc006a4df20, 0x7}, \{0xc0072bb788, ...}}, ...}})
          /opt/app-root/src/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.6/pkg/webhook/admission/validator.go:103 +0x6a9
      sigs.k8s.io/controller-runtime/pkg/webhook/admission.(*Webhook).Handle(_, \{_, _}, \{{{0xc00578d9e0, 0x24}, \{{0xc0072bb770, 0x12}, \{0xc006a4df20, 0x7}, \{0xc0072bb788, ...}}, ...}})
          /opt/app-root/src/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.6/pkg/webhook/admission/webhook.go:169 +0x20a
      sigs.k8s.io/controller-runtime/pkg/webhook/admission.(*Webhook).ServeHTTP(0xc00061a320, \{0x7fca04030d18?, 0xc00722f4a0}, 0xc00141c200)
          /opt/app-root/src/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.6/pkg/webhook/admission/http.go:98 +0xc94
      github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerInFlight.func1(\{0x7fca04030d18, 0xc00722f4a0}, 0x22d8100?)
          /opt/app-root/src/go/pkg/mod/github.com/prometheus/client_golang@v1.18.0/prometheus/promhttp/instrument_server.go:60 +0xd4
      net/http.HandlerFunc.ServeHTTP(0x22d81b0?, \{0x7fca04030d18?, 0xc00722f4a0?}, 0xc001abf828?)
          /usr/lib/golang/src/net/http/server.go:2122 +0x2f
      github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerCounter.func1(\{0x22d81b0?, 0xc000752460?}, 0xc00141c200)
          /opt/app-root/src/go/pkg/mod/github.com/prometheus/client_golang@v1.18.0/prometheus/promhttp/instrument_server.go:147 +0xc5
      net/http.HandlerFunc.ServeHTTP(0x74d3e5?, \{0x22d81b0?, 0xc000752460?}, 0x8?)
          /usr/lib/golang/src/net/http/server.go:2122 +0x2f
      github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerDuration.func2(\{0x22d81b0, 0xc000752460}, 0xc00141c200)
          /opt/app-root/src/go/pkg/mod/github.com/prometheus/client_golang@v1.18.0/prometheus/promhttp/instrument_server.go:109 +0xc7
      net/http.HandlerFunc.ServeHTTP(0xc000752460?, \{0x22d81b0?, 0xc000752460?}, 0x1fc7e0c?)
          /usr/lib/golang/src/net/http/server.go:2122 +0x2f
      net/http.(*ServeMux).ServeHTTP(0xc0013cc820?, \{0x22d81b0, 0xc000752460}, 0xc00141c200)
          /usr/lib/golang/src/net/http/server.go:2500 +0x149
      net/http.serverHandler.ServeHTTP(\{0x22c9d90?}, \{0x22d81b0, 0xc000752460}, 0xc00141c200)
          /usr/lib/golang/src/net/http/server.go:2936 +0x316
      net/http.(*conn).serve(0xc00218c750, \{0x22d8fe0, 0xc000375620})
          /usr/lib/golang/src/net/http/server.go:1995 +0x612
      created by net/http.(*Server).Serve
          /usr/lib/golang/src/net/http/server.go:3089 +0x5ed
      
      

       

      Looks like this piece of code is at issue:

      https://github.com/openstack-k8s-operators/swift-operator/blob/d0117f2a5b92caa6f1eea92ba2f9fe1e5090382c/api/v1beta1/swift_webhook.go#L205

       

       

              abays@redhat.com Andrew Bays
              aasmith1@redhat.com Aaron Smith
              Andrew Bays
              rhos-dfg-ospk8s
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: