Skip to content

Wrong validation of KUBERNETES_SERVICE_HOST in logical backup dump.sh? #2047

@thedatabaseme

Description

@thedatabaseme

Hello,

I've recognized, that you introduced the following lines in the logical-backup images dump.sh in version 1.8.0 by commit a081173 .

if [ "$KUBERNETES_SERVICE_HOST" != "${KUBERNETES_SERVICE_HOST#*[0-9].[0-9]}" ]; then
  echo "IPv4"
  K8S_API_URL=https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT/api/v1
elif [ "$KUBERNETES_SERVICE_HOST" != "${KUBERNETES_SERVICE_HOST#*:[0-9a-fA-F]}" ]; then
  echo "IPv6"
  K8S_API_URL=https://[$KUBERNETES_SERVICE_HOST]:$KUBERNETES_SERVICE_PORT/api/v1
else
  echo "Unrecognized IP format '$KUBERNETES_SERVICE_HOST'"
fi

This check leads to a problem in our environment cause KUBERNETES_SERVICE_HOST is not an IP. It's a DNS name (like api.myk8s.customer.cloud). I was wondering if this was done by intent cause normally one has an IP for his Service Host or not?
Would it be an idea to rethink this decision?

Kind regards
Philip

Please, answer some short questions which should help us to understand your problem / question better?

  • Which image of the operator are you using? e.g. registry.opensource.zalan.do/acid/postgres-operator:v1.8.2
    registry.opensource.zalan.do/acid/logical-backup:v1.8.2
  • Where do you run it - cloud or metal? Kubernetes or OpenShift? [AWS K8s | GCP ... | Bare Metal K8s]
    K8s
  • Are you running Postgres Operator in production? [yes | no]
    yes
  • Type of issue? [Bug report, question, feature request, etc.]
    Question

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions