diff --git a/cmd/hostpathplugin/main.go b/cmd/hostpathplugin/main.go index c5a2e33ac..aeae01693 100644 --- a/cmd/hostpathplugin/main.go +++ b/cmd/hostpathplugin/main.go @@ -52,7 +52,6 @@ func main() { flag.Int64Var(&cfg.MaxVolumesPerNode, "maxvolumespernode", 0, "limit of volumes per node") flag.Var(&cfg.Capacity, "capacity", "Simulate storage capacity. The parameter is = where is the value of a 'kind' storage class parameter and is the total amount of bytes for that kind. The flag may be used multiple times to configure different kinds.") flag.BoolVar(&cfg.EnableAttach, "enable-attach", false, "Enables RPC_PUBLISH_UNPUBLISH_VOLUME capability.") - flag.BoolVar(&cfg.CheckVolumeLifecycle, "check-volume-lifecycle", false, "Can be used to turn some violations of the volume lifecycle into warnings instead of failing the incorrect gRPC call. Disabled by default because of https://github.com/kubernetes/kubernetes/issues/101911.") flag.Int64Var(&cfg.MaxVolumeSize, "max-volume-size", 1024*1024*1024*1024, "maximum size of volumes in bytes (inclusive)") flag.BoolVar(&cfg.EnableTopology, "enable-topology", true, "Enables PluginCapability_Service_VOLUME_ACCESSIBILITY_CONSTRAINTS capability.") flag.BoolVar(&cfg.EnableVolumeExpansion, "node-expand-required", true, "Enables NodeServiceCapability_RPC_EXPAND_VOLUME capacity.") diff --git a/go.mod b/go.mod index 90a05e73b..460c6b443 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,6 @@ require ( google.golang.org/genproto v0.0.0-20201209185603-f92720507ed4 // indirect google.golang.org/grpc v1.34.0 k8s.io/apimachinery v0.21.0-alpha.0 - k8s.io/klog/v2 v2.4.0 k8s.io/kubernetes v1.20.0 k8s.io/mount-utils v0.20.0 // indirect k8s.io/utils v0.0.0-20201110183641-67b214c5f920 diff --git a/pkg/hostpath/controllerserver.go b/pkg/hostpath/controllerserver.go index 7d87bbd96..a70ef1f32 100644 --- a/pkg/hostpath/controllerserver.go +++ b/pkg/hostpath/controllerserver.go @@ -33,7 +33,6 @@ import ( "google.golang.org/grpc/status" "github.com/container-storage-interface/spec/lib/go/csi" - "k8s.io/klog/v2" utilexec "k8s.io/utils/exec" "github.com/kubernetes-csi/csi-driver-host-path/pkg/state" @@ -205,12 +204,8 @@ func (hp *hostPath) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeReque } if vol.Attached || !vol.Published.Empty() || !vol.Staged.Empty() { - msg := fmt.Sprintf("Volume '%s' is still used (attached: %v, staged: %v, published: %v) by '%s' node", + return nil, status.Errorf(codes.Internal, "Volume '%s' is still used (attached: %v, staged: %v, published: %v) by '%s' node", vol.VolID, vol.Attached, vol.Staged, vol.Published, vol.NodeID) - if hp.config.CheckVolumeLifecycle { - return nil, status.Error(codes.Internal, msg) - } - klog.Warning(msg) } if err := hp.deleteVolume(volId); err != nil { @@ -345,12 +340,8 @@ func (hp *hostPath) ControllerUnpublishVolume(ctx context.Context, req *csi.Cont // Check to see if the volume is staged/published on a node if !vol.Published.Empty() || !vol.Staged.Empty() { - msg := fmt.Sprintf("Volume '%s' is still used (staged: %v, published: %v) by '%s' node", + return nil, status.Errorf(codes.Internal, "Volume '%s' is still used (staged: %v, published: %v) by '%s' node", vol.VolID, vol.Staged, vol.Published, vol.NodeID) - if hp.config.CheckVolumeLifecycle { - return nil, status.Error(codes.Internal, msg) - } - klog.Warning(msg) } vol.Attached = false diff --git a/pkg/hostpath/hostpath.go b/pkg/hostpath/hostpath.go index c02dd188d..6eeeb6543 100644 --- a/pkg/hostpath/hostpath.go +++ b/pkg/hostpath/hostpath.go @@ -74,7 +74,6 @@ type Config struct { EnableAttach bool EnableTopology bool EnableVolumeExpansion bool - CheckVolumeLifecycle bool } var ( diff --git a/release-tools/prow.sh b/release-tools/prow.sh index 27341f737..cba2c371f 100755 --- a/release-tools/prow.sh +++ b/release-tools/prow.sh @@ -609,7 +609,21 @@ apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane - role: worker + kubeadmConfigPatches: + - | + kind: JoinConfiguration + nodeRegistration: + kubeletExtraArgs: + v: "5" + vmodule: "*csi*=5" - role: worker + kubeadmConfigPatches: + - | + kind: JoinConfiguration + nodeRegistration: + kubeletExtraArgs: + v: "5" + vmodule: "*csi*=5" featureGates: $(list_gates "$gates") runtimeConfig: @@ -632,11 +646,16 @@ EOF # Deletes kind cluster inside a prow job delete_cluster_inside_prow_job() { + local name="$1" + # Inside a real Prow job it is better to clean up at runtime # instead of leaving that to the Prow job cleanup code # because the later sometimes times out (https://github.com/kubernetes-csi/csi-release-tools/issues/24#issuecomment-554765872). + # + # This is also a good time to collect logs. if [ "$JOB_NAME" ]; then if kind get clusters | grep -q csi-prow; then + run kind export logs --name=csi-prow ${ARTIFACTS}/cluster-logs/$name run kind delete cluster --name=csi-prow || die "kind delete failed" fi unset KUBECONFIG @@ -1252,7 +1271,7 @@ main () { fi fi fi - delete_cluster_inside_prow_job + delete_cluster_inside_prow_job non-alpha fi if tests_need_alpha_cluster && [ "${CSI_PROW_E2E_ALPHA_GATES}" ]; then @@ -1287,7 +1306,7 @@ main () { fi fi fi - delete_cluster_inside_prow_job + delete_cluster_inside_prow_job alpha fi fi diff --git a/vendor/modules.txt b/vendor/modules.txt index ef75d4be4..0f3e2899b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -154,7 +154,6 @@ k8s.io/apiserver/pkg/util/feature # k8s.io/component-base v0.20.0 => k8s.io/component-base v0.20.0 k8s.io/component-base/featuregate # k8s.io/klog/v2 v2.4.0 -## explicit k8s.io/klog/v2 # k8s.io/kubernetes v1.20.0 ## explicit