Skip to content

Commit

Permalink
Merge branch 'master' into 6005
Browse files Browse the repository at this point in the history
  • Loading branch information
innobead committed Jul 10, 2023
2 parents fbe4109 + 2197626 commit fc338c6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
12 changes: 11 additions & 1 deletion controller/backup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,17 @@ func (bc *BackupController) checkMonitor(backup *longhorn.Backup, volume *longho
if kubernetesStatus.PVCName != "" && kubernetesStatus.LastPVCRefAt == "" {
pvc, _ := bc.ds.GetPersistentVolumeClaim(kubernetesStatus.Namespace, kubernetesStatus.PVCName)
if pvc != nil {
storageClassName = *pvc.Spec.StorageClassName
if pvc.Spec.StorageClassName != nil {
storageClassName = *pvc.Spec.StorageClassName
}
if storageClassName == "" {
if v, exist := pvc.Annotations[corev1.BetaStorageClassAnnotation]; exist {
storageClassName = v
}
}
if storageClassName == "" {
bc.logger.Warnf("Failed to find the StorageClassName from the pvc %v", pvc.Name)
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion controller/volume_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3647,7 +3647,8 @@ func (c *VolumeController) syncPVCRecurringJobLabels(volume *longhorn.Volume) er
}

if !hasSourceLabel {
c.logger.Warnf("Ignoring recurring job labels on Volume %v PVC %v due to missing source label", volume.Name, pvc.Name)
c.logger.Debugf("Ignoring recurring job labels on Volume %v PVC %v due to missing source label", volume.Name, pvc.Name)

return nil
}

Expand Down
2 changes: 1 addition & 1 deletion types/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ var (
Type: SettingTypeString,
Required: true,
ReadOnly: false,
Default: "Debug",
Default: "Info",
}

SettingDefinitionOfflineReplicaRebuilding = SettingDefinition{
Expand Down
7 changes: 1 addition & 6 deletions webhook/resources/orphan/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package orphan

import (
"fmt"
"reflect"

admissionregv1 "k8s.io/api/admissionregistration/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -54,17 +53,12 @@ func (o *orphanValidator) Create(request *admission.Request, newObj runtime.Obje
}

func (o *orphanValidator) Update(request *admission.Request, oldObj runtime.Object, newObj runtime.Object) error {
oldOrphan := oldObj.(*longhorn.Orphan)
newOrphan := newObj.(*longhorn.Orphan)

if err := checkOrphanParameters(newOrphan); err != nil {
return werror.NewInvalidError(err.Error(), "")
}

if !reflect.DeepEqual(oldOrphan.Spec, newOrphan.Spec) {
return werror.NewInvalidError(fmt.Sprintf("orphan %v spec fields are immutable", oldOrphan.Name), "")
}

return nil
}

Expand All @@ -83,6 +77,7 @@ func checkOrphanForReplicaDirectory(orphan *longhorn.Orphan) error {
longhorn.OrphanDiskName,
longhorn.OrphanDiskUUID,
longhorn.OrphanDiskPath,
longhorn.OrphanDiskType,
}

for _, param := range params {
Expand Down

0 comments on commit fc338c6

Please sign in to comment.