Skip to content

Commit

Permalink
Minor fixes in import populator
Browse files Browse the repository at this point in the history
* Fixes WFFC handling in import populator
* Adds license information in populator-related files

Signed-off-by: Alvaro Romero <alromero@redhat.com>
  • Loading branch information
alromeros committed Apr 15, 2023
1 parent a991290 commit 644d6a4
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
16 changes: 16 additions & 0 deletions pkg/controller/populators/import-populator.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
Copyright 2023 The CDI Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package populators

import (
Expand Down
20 changes: 18 additions & 2 deletions pkg/controller/populators/populator-base.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
Copyright 2023 The CDI Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package populators

import (
Expand Down Expand Up @@ -148,7 +164,7 @@ func (r *ReconcilerBase) handleStorageClass(pvc *corev1.PersistentVolumeClaim) (

if storageClass.VolumeBindingMode != nil && *storageClass.VolumeBindingMode == storagev1.VolumeBindingWaitForFirstConsumer {
waitForFirstConsumer = true
nodeName := pvc.Annotations[cc.AnnSelectedNodeName]
nodeName := pvc.Annotations[AnnSelectedNode]
if nodeName == "" {
// Wait for the PVC to get a node name before continuing
return false, waitForFirstConsumer, nil
Expand All @@ -165,7 +181,7 @@ func (r *ReconcilerBase) createPVCPrime(pvc *corev1.PersistentVolumeClaim, sourc
annotations := make(map[string]string)
annotations[cc.AnnImmediateBinding] = ""
if waitForFirstConsumer {
annotations[cc.AnnSelectedNodeName] = pvc.Annotations[cc.AnnSelectedNodeName]
annotations[cc.AnnSelectedNodeName] = pvc.Annotations[AnnSelectedNode]
}
pvcPrimeName := PVCPrimeName(pvc)
pvcPrime := &corev1.PersistentVolumeClaim{
Expand Down
16 changes: 16 additions & 0 deletions pkg/controller/populators/util.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
Copyright 2023 The CDI Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package populators

import (
Expand Down

0 comments on commit 644d6a4

Please sign in to comment.