Uploaded image for project: 'Couchbase Kubernetes'
  1. Couchbase Kubernetes
  2. K8S-3572

Operator-backup always passes --s3-force-path-style flag to cbbackupmgr

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • 2.8.0
    • None
    • operator-backup
    • None
    • 20 - The Last Stand
    • 1

    Description

      The effect of this is that setting useVirtualPath: true still has no actual effect (despite K8S-3264).

      If we set useVirtualPath to true, CAO passes the following as command-line arguments to the operator-backup script:

      spec:
        containers:
        - args:
          ...
          - --s3-force-path-style
          - "false" 

      Unfortunately, in the operator-backup script, this --s3-force-path-style option gets parsed as the string "false" rather than as a boolean.

      This means that later on when we do this check:

               if self.context.args.s3_force_path_style:
                  args.append("--s3-force-path-style")

      The string "false" when treated as a boolean evaluates as True (as it's a non-empty string), so we always end up sending the --s3-force-path-style flag to cbbackupmgr.

      The --s3-force-path-style flag is visible in the backup logs stored in the backup archive:

      2024-07-12T10:38:29.999+00:00 (Cmd) cbbackupmgr version 7.6.0-2176 Hostname: bk-virtual-path-true-full-mlglx OS: linux Version: 5.10.104-linuxkit Arch: arm64 vCPU: 6 Memory: 16763322368 (15.61GiB)2024-07-12T10:38:29.999+00:00 (Cmd) config --archive s3://backups/archive --repo cb-example-2024-07-12T10_38_29 --obj-staging-dir /data/staging --s3-force-path-style --obj-endpoint http://minio-s3-srv.minio-dev:9000 

      The underlying issue is demonstrable with the attached python script.

      % ./python_arg_false.py --s3-force-path-style false
       
      Argument Type: <class 'str'> Value: false
      args.s3_force_path_style evaluates to True 

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              justin.ashworth Justin Ashworth
              jack.bakes Jack Bakes
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty