[go: nahoru, domu]

Skip to content

Commit

Permalink
fix(redis): keep redis pvc after harbor cluster delete
Browse files Browse the repository at this point in the history
Signed-off-by: chlins <chlins.zhang@gmail.com>
  • Loading branch information
chlins committed Jan 27, 2021
1 parent 2be3d76 commit 464ed1f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/cluster/controllers/cache/resource_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ func (rm *redisResourceManager) WithCluster(cluster *goharborv1alpha2.HarborClus
func (rm *redisResourceManager) GetCacheCR(ctx context.Context, harborcluster *goharborv1alpha2.HarborCluster) (runtime.Object, error) {
resource := rm.GetResourceList()
pvc, _ := GenerateStoragePVC(rm.GetStorageClass(), rm.cluster.Name, rm.GetStorageSize(), rm.GetLabels())
// keep pvc after cr deleted.
keepPVCAfterDeletion := true

image, err := rm.GetImage(ctx, harborcluster)
if err != nil {
Expand All @@ -97,6 +99,7 @@ func (rm *redisResourceManager) GetCacheCR(ctx context.Context, harborcluster *g
},
Storage: redisOp.RedisStorage{
PersistentVolumeClaim: pvc,
KeepAfterDeletion: keepPVCAfterDeletion,
},
Image: image,
ImagePullPolicy: rm.getImagePullPolicy(ctx, harborcluster),
Expand Down

0 comments on commit 464ed1f

Please sign in to comment.