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

useVirtualPath=true in CouchbaseBackup resource not being respected

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.6.1
    • 2.5.0
    • operator
    • Pre-Christmas Completions
    • 2

    Description

      Expected behaviour:

      When couchbasebackups.spec.objectStore.endpoint.useVirtualPath is set to true, cbbackupmgr should be invoked with the option --s3-force-path-style false, and vice versa.

      Current behaviour (as of CAO 2.5.0)

      Whether useVirtualPath is set to true or false, cbbackupmgr is always invoked with --s3-force-path-style true:

      • useVirtualPath=false, correct behaviour:

      % kubectl get couchbasebackup test-backup -o jsonpath='{.spec.objectStore.endpoint}'
      {"url":"https://localhost","useVirtualPath":false}%
       
      % kubectl get pod test-backup-incremental-28311188-jwmjn -o jsonpath='{.spec.containers[].args}'
      ["--mode","backup","--backup-ret","720.00","--log-ret","168.00","-v","INFO","cb-example","--incremental","--threads","1","--obj-endpoint","https://localhost","--obj-store","s3://non-existant"]% 
       
      % kubectl logs test-backup-incremental-28311188-jwmjn 
      ...
      2023-10-30T13:08:18 INFO Arguments: ... s3_force_path_style=True ...
      

      • useVirtualPath=true, incorrect behaviour:

      % kubectl get couchbasebackup test-backup -o jsonpath='{.spec.objectStore.endpoint}'
      {"url":"https://localhost","useVirtualPath":true}% 
       
      % kubectl get pod test-backup-incremental-28311197-64jg7 -o jsonpath='{.spec.containers[].args}' 
      ["--mode","backup","--backup-ret","720.00","--log-ret","168.00","-v","INFO","cb-example","--incremental","--threads","1","--obj-endpoint","https://localhost","--s3-force-path-style","true","--obj-store","s3://non-existant"]%
       
       % kubectl logs test-backup-incremental-28311197-64jg7 
      ...
      2023-10-30T13:17:00 INFO Arguments:  ... s3_force_path_style=true ...
      

      I think the issue is here in the Operator code:

      		if objectEndpoint.UseVirtualPath {
      			container.Args = append(container.Args, "--s3-force-path-style", fmt.Sprintf("%t", objectEndpoint.UseVirtualPath))
      		}
      

      And the correct logic should be:

      • If useVirtualPath false or missing, either explicitly pass --s3-force-path-style=true or alternatively no-op and rely on the fact that the backup script defaults this setting to true (the code above does the latter).
      • If useVirtualPath true, explicitly pass --s3-force-path-style=false (the code above passes true instead)

      Attachments

        Issue Links

          Activity

            People

              yusuf.ramzan Yusuf Ramzan
              jack.bakes Jack Bakes
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty