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

Nil reference exception for logging mount when DAC not enabled

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.6.1
    • None
    • operator
    • Christmas and Beyond
    • 1

    Description

      When dac is not enabled, it is possible to create a cluster with logging enabled, and add a server group that does not have a default or logging mount defined.  This leads to a nil reference exception in ./pkg/util/k8sutil/pod_util.go Specifically L#1292
       

      mount:=getLoggingMount(container) 
      sidecarConfig:= fbs.Sidecar 
      // Set up the volume containing the Secret contents to configure the sidecar configVolumeMount:= v1.VolumeMount{ Name: fbs.ConfigurationName, MountPath: sidecarConfig.ConfigurationMountPath, ReadOnly: true, } 
      // Ensure we specify the configuration file to use - fixed currently. configFile:= filepath.Join(sidecarConfig.ConfigurationMountPath, LoggingConfigurationFile) 
      // Set up a duplicate volume mount but make sure to set it read-only readonlyLogsMount:= mount.DeepCopy()

       
      This is because mount is nil, as there are no mounts defined.

      Attachments

        Issue Links

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

          Activity

            People

              yusuf.ramzan Yusuf Ramzan
              justin.ashworth Justin Ashworth
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty