fix(operator): StatefulSet 显式保留世界卷,同名旧世界卷仍在时建服回 409 world_volume_exists,文档写明孤儿卷查找与单节点约束
This commit is contained in:
11 files changed
+112
-22
No files matched your search
@@ -320,6 +320,16 @@ func buildStatefulSet(server *v1alpha1.MinecraftServer, replicas int32, felisIma
|
||||
},
|
||||
},
|
||||
VolumeClaimTemplates: []corev1.PersistentVolumeClaim{pvc},
|
||||
// The world outlives its StatefulSet: deleting the CR (and with it,
|
||||
// by owner reference, the StatefulSet) keeps the claim, so a CR that
|
||||
// comes back under the same name mounts the same world. The reaper is
|
||||
// the one path that deletes a world, after its final backup. Stated
|
||||
// here although it is the API default, so the semantics never ride on
|
||||
// a default.
|
||||
PersistentVolumeClaimRetentionPolicy: &appsv1.StatefulSetPersistentVolumeClaimRetentionPolicy{
|
||||
WhenDeleted: appsv1.RetainPersistentVolumeClaimRetentionPolicyType,
|
||||
WhenScaled: appsv1.RetainPersistentVolumeClaimRetentionPolicyType,
|
||||
},
|
||||
},
|
||||
}
|
||||
return sts, nil
|
||||
|
||||
Reference in new issue
Block a user