github.com/openebs/api@v1.12.0/pkg/apis/types/types.go (about)

     1  /*
     2  Copyright 2020 The OpenEBS Authors
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package types
    18  
    19  import "sync"
    20  
    21  const (
    22  	// OpenEBSDisableReconcileLabelKey is the label key decides to reconcile or not
    23  	OpenEBSDisableReconcileLabelKey = "reconcile.openebs.io/disable"
    24  	// CStorAPIVersion is group version for cstor apis
    25  	CStorAPIVersion = "cstor.openebs.io/v1"
    26  
    27  	// HostNameLabelKey is label key present on kubernetes node object.
    28  	HostNameLabelKey = "kubernetes.io/hostname"
    29  
    30  	// CStorPoolClusterLabelKey is the CStorPoolcluster label key.
    31  	CStorPoolClusterLabelKey = "openebs.io/cstor-pool-cluster"
    32  
    33  	// CStorPoolInstanceLabelKey is the CStorPoolInstance label
    34  	CStorPoolInstanceLabelKey = "openebs.io/cstor-pool-instance"
    35  
    36  	// OpenEBSVersionLabelKey is the openebs version key.
    37  	OpenEBSVersionLabelKey = "openebs.io/version"
    38  
    39  	// CASTypeLabelKey is the label key to fetch storage engine for the volume
    40  	CASTypeLabelKey = "openebs.io/cas-type"
    41  
    42  	// PredecessorBDKey is the key to fetch the predecessor BD in case of
    43  	// block device replacement.
    44  	PredecessorBDLabelKey = "openebs.io/bd-predecessor"
    45  
    46  	//PodDisruptionBudgetKey is the key used to identify the PDB
    47  	PodDisruptionBudgetKey = "openebs.io/pod-disruption-budget"
    48  
    49  	// VolumePolicyKey is the key to fetch name of CStorVolume Policies
    50  	VolumePolicyKey = "openebs.io/volume-policy"
    51  
    52  	// CStorPoolInstanceNameLabelKey is the key used on pool dependent resources
    53  	CStorPoolInstanceNameLabelKey = "cstorpoolinstance.openebs.io/name"
    54  
    55  	// CStorPoolInstanceUIDLabelKey is the key used on pool dependent resources
    56  	CStorPoolInstanceUIDLabelKey = "cstorpoolinstance.openebs.io/uid"
    57  
    58  	// PersistentVolumeLabelKey label key set in all cstorvolume replicas of a
    59  	// given volume
    60  	PersistentVolumeLabelKey = "openebs.io/persistent-volume"
    61  )
    62  
    63  const (
    64  	// CSPCFinalizer represents finalizer value used by cspc
    65  	CSPCFinalizer = "cstorpoolcluster.openebs.io/finalizer"
    66  
    67  	// PoolProtectionFinalizer is used to make sure cspi and it's bdcs
    68  	// are not deleted before destroying the zpool
    69  	PoolProtectionFinalizer = "openebs.io/pool-protection"
    70  
    71  	// CstorVolumeKind is a K8s CR of kind CStorVolume
    72  	CStorVolumeKind = "CStorVolume"
    73  
    74  	// CstorVolumeReplicaKind is a K8s CR of kind CStorVolumeReplica
    75  	CStorVolumeReplicaKind = "CStorVolumeReplica"
    76  )
    77  
    78  const (
    79  	// CasTypeCStor is the key for cas type cStor
    80  	CasTypeCStor = "cstor"
    81  
    82  	// CasTypeJiva is the key for cas type jiva
    83  	CasTypeJiva = "jiva"
    84  )
    85  
    86  const (
    87  	CStorPoolBasePath = "/var/openebs/cstor-pool/"
    88  	CacheFileName     = "pool.cache"
    89  )
    90  
    91  var (
    92  	// ConfFileMutex is to hold the lock while updating istgt.conf file
    93  	ConfFileMutex = &sync.Mutex{}
    94  	// IstgtConfPath will locate path for istgt configurations
    95  	IstgtConfPath = "/usr/local/etc/istgt/istgt.conf"
    96  	//DesiredReplicationFactorKey is plain text in istgt configuration file informs
    97  	//about desired replication factor used by target
    98  	DesiredReplicationFactorKey = "  DesiredReplicationFactor"
    99  	//TargetNamespace is namespace where target pod and cstorvolume is present
   100  	//and this is updated by addEventHandler function
   101  	TargetNamespace = ""
   102  )
   103  
   104  const (
   105  	//IoWaitTime is the time interval for which the IO has to be stopped before doing snapshot operation
   106  	IoWaitTime = 10
   107  	//TotalWaitTime is the max time duration to wait for doing snapshot operation on all the replicas
   108  	TotalWaitTime = 60
   109  )
   110  
   111  const (
   112  	// OpenEBSDisableDependantsReconcileKey is the annotation key that decides to create
   113  	// children objects with OpenEBSDisableReconcileKey as true or false
   114  	OpenEBSDisableDependantsReconcileKey = "reconcile.openebs.io/disable-dependants"
   115  
   116  	// OpenEBSCStorExistingPoolName is the name of the cstor pool already present on
   117  	// the disk that needs to be imported and renamed
   118  	OpenEBSCStorExistingPoolName = "import.cspi.cstor.openebs.io/existing-pool-name"
   119  )