Skip to content

Commit

Permalink
Adjust PV
Browse files Browse the repository at this point in the history
  • Loading branch information
jbartosik committed Dec 27, 2024
1 parent 5b4f745 commit 3a297d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ func addAdditionalPersistentVolumeTags(pvModel *model.PersistentVolume) {
pvModel.Tags = append(pvModel.Tags, additionalTags...)
}

func extractPVSelector(ls []corev1.NodeSelectorRequirement) []*model.LabelSelectorRequirement {
func extractPVSelector(ls []corev1.NodeSelectorRequirement) []*model.NodeSelectorRequirement {
if len(ls) == 0 {
return nil
}

labelSelectors := make([]*model.LabelSelectorRequirement, len(ls))
labelSelectors := make([]*model.NodeSelectorRequirement, len(ls))
for i, v := range ls {
labelSelectors[i] = &model.LabelSelectorRequirement{
labelSelectors[i] = &model.NodeSelectorRequirement{
Key: v.Key,
Operator: string(v.Operator),
Values: v.Values,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,14 @@ func newExpectedPV() model.PersistentVolume {
VolumeMode: string(filesystem),
NodeAffinity: []*model.NodeSelectorTerm{
{
MatchExpressions: []*model.LabelSelectorRequirement{
MatchExpressions: []*model.NodeSelectorRequirement{
{
Key: "test-key3",
Operator: string(corev1.NodeSelectorOpIn),
Values: []string{"test-value1", "test-value3"},
},
},
MatchFields: []*model.LabelSelectorRequirement{
MatchFields: []*model.NodeSelectorRequirement{
{
Key: "test-key2",
Operator: string(corev1.NodeSelectorOpIn),
Expand All @@ -292,7 +292,7 @@ func newExpectedPV() model.PersistentVolume {
},
},
{
MatchExpressions: []*model.LabelSelectorRequirement{
MatchExpressions: []*model.NodeSelectorRequirement{
{
Key: "test-key3",
Operator: string(corev1.NodeSelectorOpIn),
Expand Down

0 comments on commit 3a297d8

Please sign in to comment.