From 644d6a4ccced586bdfe601adc55aa6793c51b55e Mon Sep 17 00:00:00 2001 From: Alvaro Romero Date: Sat, 15 Apr 2023 19:22:11 +0200 Subject: [PATCH] Minor fixes in import populator * Fixes WFFC handling in import populator * Adds license information in populator-related files Signed-off-by: Alvaro Romero --- pkg/controller/populators/import-populator.go | 16 +++++++++++++++ pkg/controller/populators/populator-base.go | 20 +++++++++++++++++-- pkg/controller/populators/util.go | 16 +++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) diff --git a/pkg/controller/populators/import-populator.go b/pkg/controller/populators/import-populator.go index 08dc2a2888..f0a10fd896 100644 --- a/pkg/controller/populators/import-populator.go +++ b/pkg/controller/populators/import-populator.go @@ -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 ( diff --git a/pkg/controller/populators/populator-base.go b/pkg/controller/populators/populator-base.go index 35e29f5027..d85e27e88a 100644 --- a/pkg/controller/populators/populator-base.go +++ b/pkg/controller/populators/populator-base.go @@ -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 ( @@ -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 @@ -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{ diff --git a/pkg/controller/populators/util.go b/pkg/controller/populators/util.go index 41c02a996a..6cc97b2c0b 100644 --- a/pkg/controller/populators/util.go +++ b/pkg/controller/populators/util.go @@ -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 (