-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add pod name in metadata device spec for dmthin on ocp facd
Signed-off-by: shsun_pure <[email protected]>
- Loading branch information
shsun_pure
committed
Jul 1, 2024
1 parent
782af0b
commit 7623e9c
Showing
2 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package portworx | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
corev1 "github.com/libopenstorage/operator/pkg/apis/core/v1" | ||
"github.com/stretchr/testify/require" | ||
v1 "k8s.io/api/core/v1" | ||
"k8s.io/client-go/tools/record" | ||
) | ||
|
||
func TestDmthinFacdDefCmeta(t *testing.T) { | ||
fakeRecorder := record.NewFakeRecorder(10) | ||
|
||
u := &preFlightPortworx{ | ||
cluster: &corev1.StorageCluster{ | ||
Spec: corev1.StorageClusterSpec{ | ||
CommonConfig: corev1.CommonConfig{ | ||
Env: []v1.EnvVar{ | ||
{ | ||
Name: "PURE_FLASHARRAY_SAN_TYPE", | ||
Value: "PURE_FLASHARRAY_SAN_TYPE", | ||
}, | ||
}, | ||
}, | ||
CloudStorage: &corev1.CloudStorageSpec{ | ||
CloudStorageCommon: corev1.CloudStorageCommon{ | ||
DeviceSpecs: &[]string{"size=49,pod=testpod"}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
hardFail: true, | ||
} | ||
storageNodes := []*corev1.StorageNode{ | ||
{ | ||
Status: corev1.NodeStatus{ | ||
Checks: []corev1.CheckResult{ | ||
{ | ||
Type: "status", | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
err := u.ProcessPreFlightResults(fakeRecorder, storageNodes) | ||
require.Nil(t, err) | ||
require.Equal(t, fmt.Sprintf("%s,%s", DefCmetaFACD, "pod=testpod"), *u.cluster.Spec.CloudStorage.SystemMdDeviceSpec) | ||
} |