Skip to content

Commit

Permalink
remove LVS from the redis deployment stage
Browse files Browse the repository at this point in the history
  • Loading branch information
elenagerman committed Aug 20, 2024
1 parent 15e2abe commit 3b48bb3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ persistentVolume:

tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
key: node-role.kubernetes.io/infra
operator: Exists

additionalAffinities:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
- key: node-role.kubernetes.io/infra
operator: Exists

securityContext:
Expand Down
48 changes: 0 additions & 48 deletions tests/system-tests/vcore/internal/vcorecommon/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import (

"k8s.io/apimachinery/pkg/util/wait"

"github.com/openshift-kni/eco-goinfra/pkg/lso"
lsov1 "github.com/openshift/local-storage-operator/api/v1"
lsov1alpha1 "github.com/openshift/local-storage-operator/api/v1alpha1"

"github.com/openshift-kni/eco-gotests/tests/system-tests/internal/remote"

"github.com/openshift-kni/eco-goinfra/pkg/reportxml"
Expand Down Expand Up @@ -41,55 +37,11 @@ func VerifyRedisSuite() {
Describe(
"Redis validation",
Label(vcoreparams.LabelVCoreOperators), func() {
It("Verify redis localvolumeset instance exists",
Label("redis"), VerifyRedisLocalVolumeSet)

It("Verify Redis deployment procedure",
Label("redis"), reportxml.ID("59503"), VerifyRedisDeploymentProcedure)
})
}

// VerifyRedisLocalVolumeSet asserts redis localvolumeset instance exists.
func VerifyRedisLocalVolumeSet(ctx SpecContext) {
glog.V(vcoreparams.VCoreLogLevel).Infof("Create redis localvolumeset instance %s in namespace %s if not found",
vcoreparams.RedisLocalVolumeSetName, vcoreparams.LSONamespace)

var err error

localVolumeSetObj := lso.NewLocalVolumeSetBuilder(APIClient,
vcoreparams.RedisLocalVolumeSetName,
vcoreparams.LSONamespace)

if localVolumeSetObj.Exists() {
err = localVolumeSetObj.Delete()
Expect(err).ToNot(HaveOccurred(),
fmt.Sprintf("failed to delete localvolumeset %s from namespace %s; %v",
vcoreparams.RedisLocalVolumeSetName, vcoreparams.LSONamespace, err))
}

nodeSelector := corev1.NodeSelector{NodeSelectorTerms: []corev1.NodeSelectorTerm{{
MatchExpressions: []corev1.NodeSelectorRequirement{{
Key: "kubernetes.io/hostname",
Operator: "In",
Values: []string{"master-0", "master-1", "master-2"},
}}},
}}

deviceInclusionSpec := lsov1alpha1.DeviceInclusionSpec{
DeviceTypes: []lsov1alpha1.DeviceType{lsov1alpha1.RawDisk},
DeviceMechanicalProperties: []lsov1alpha1.DeviceMechanicalProperty{lsov1alpha1.NonRotational},
}

_, err = localVolumeSetObj.WithNodeSelector(nodeSelector).
WithStorageClassName(vcoreparams.StorageClassName).
WithVolumeMode(lsov1.PersistentVolumeBlock).
WithFSType("ext4").
WithMaxDeviceCount(int32(10)).
WithDeviceInclusionSpec(deviceInclusionSpec).Create()
Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("failed to create localvolumeset %s in namespace %s "+
"due to %v", vcoreparams.RedisLocalVolumeSetName, vcoreparams.LSONamespace, err))
} // func VerifyLocalVolumeSet (ctx SpecContext)

// VerifyRedisDeploymentProcedure asserts Redis deployment procedure.
//
//nolint:funlen
Expand Down

0 comments on commit 3b48bb3

Please sign in to comment.