From bcd86ddc76274b0c5a7f5a2280ac7eb82d14a219 Mon Sep 17 00:00:00 2001 From: zhouenhua Date: Sat, 9 Oct 2021 11:06:04 +0800 Subject: [PATCH] Update boilerplate text Signed-off-by: zhouenhua --- LICENSE | 15 --------------- cmd/nvmfplugin/main.go | 23 +++++++++++++++++++---- pkg/nvmf/const.go | 13 +++++++++++++ pkg/nvmf/controllerserver.go | 13 +++++++++++++ pkg/nvmf/disk.go | 14 ++++++++++++++ pkg/nvmf/driver.go | 14 ++++++++++++++ pkg/nvmf/fabrics.go | 19 +++++++++++++++++-- pkg/nvmf/identityserver.go | 13 +++++++++++++ pkg/nvmf/mounter.go | 13 +++++++++++++ pkg/nvmf/nodeserver.go | 19 +++++++++++++++++-- pkg/nvmf/nvmf.go | 16 +++++++++++++++- pkg/nvmf/nvmf_utils.go | 25 ++++++++++++++++++++----- pkg/nvmf/server.go | 23 +++++++++++++++++++---- pkg/utils/utils.go | 13 +++++++++++++ 14 files changed, 200 insertions(+), 33 deletions(-) diff --git a/LICENSE b/LICENSE index 54fbd46..a7e77cb 100644 --- a/LICENSE +++ b/LICENSE @@ -1,18 +1,3 @@ -Copyright 2020 Bytedance Inc. - -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. - - Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ diff --git a/cmd/nvmfplugin/main.go b/cmd/nvmfplugin/main.go index 83ed9f1..1d9d8a3 100644 --- a/cmd/nvmfplugin/main.go +++ b/cmd/nvmfplugin/main.go @@ -1,15 +1,30 @@ -package main +/* +Copyright 2021 The Kubernetes 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 nvmf import ( - "csi-driver-nvmf/pkg/nvmf" "flag" "fmt" - "github.com/golang/glog" - "github.com/spf13/cobra" "net/http" "os" "sync" "time" + + "github.com/golang/glog" + "github.com/spf13/cobra" + + "csi-driver-nvmf/pkg/nvmf" ) var ( diff --git a/pkg/nvmf/const.go b/pkg/nvmf/const.go index c7b6f4b..2bdf7de 100644 --- a/pkg/nvmf/const.go +++ b/pkg/nvmf/const.go @@ -1,3 +1,16 @@ +/* +Copyright 2021 The Kubernetes 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 nvmf const ( diff --git a/pkg/nvmf/controllerserver.go b/pkg/nvmf/controllerserver.go index 7c8c3b7..dd89f41 100644 --- a/pkg/nvmf/controllerserver.go +++ b/pkg/nvmf/controllerserver.go @@ -1,3 +1,16 @@ +/* +Copyright 2021 The Kubernetes 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 nvmf import ( diff --git a/pkg/nvmf/disk.go b/pkg/nvmf/disk.go index 7e248f9..4abfd4f 100644 --- a/pkg/nvmf/disk.go +++ b/pkg/nvmf/disk.go @@ -1,7 +1,21 @@ +/* +Copyright 2021 The Kubernetes 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 nvmf import ( "fmt" + "github.com/container-storage-interface/spec/lib/go/csi" ) diff --git a/pkg/nvmf/driver.go b/pkg/nvmf/driver.go index 156474e..1972bdf 100644 --- a/pkg/nvmf/driver.go +++ b/pkg/nvmf/driver.go @@ -1,7 +1,21 @@ +/* +Copyright 2021 The Kubernetes 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 nvmf import ( "fmt" + "github.com/container-storage-interface/spec/lib/go/csi" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/pkg/nvmf/fabrics.go b/pkg/nvmf/fabrics.go index 3f36d0f..9655a30 100644 --- a/pkg/nvmf/fabrics.go +++ b/pkg/nvmf/fabrics.go @@ -1,13 +1,28 @@ +/* +Copyright 2021 The Kubernetes 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 nvmf import ( - "csi-driver-nvmf/pkg/utils" "encoding/json" "fmt" "io/ioutil" - "k8s.io/klog" "os" "strings" + + "k8s.io/klog" + + "csi-driver-nvmf/pkg/utils" ) func getConnector(nvmfInfo *nvmfDiskInfo) *Connector { diff --git a/pkg/nvmf/identityserver.go b/pkg/nvmf/identityserver.go index af124c7..04e688a 100644 --- a/pkg/nvmf/identityserver.go +++ b/pkg/nvmf/identityserver.go @@ -1,3 +1,16 @@ +/* +Copyright 2021 The Kubernetes 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 nvmf import ( diff --git a/pkg/nvmf/mounter.go b/pkg/nvmf/mounter.go index 8180b6d..383b70a 100644 --- a/pkg/nvmf/mounter.go +++ b/pkg/nvmf/mounter.go @@ -1,3 +1,16 @@ +/* +Copyright 2021 The Kubernetes 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 nvmf import ( diff --git a/pkg/nvmf/nodeserver.go b/pkg/nvmf/nodeserver.go index 2da1f9e..1dad05e 100644 --- a/pkg/nvmf/nodeserver.go +++ b/pkg/nvmf/nodeserver.go @@ -1,13 +1,28 @@ +/* +Copyright 2021 The Kubernetes 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 nvmf import ( - "csi-driver-nvmf/pkg/utils" + "os" + "github.com/container-storage-interface/spec/lib/go/csi" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "k8s.io/klog" - "os" + + "csi-driver-nvmf/pkg/utils" ) type NodeServer struct { diff --git a/pkg/nvmf/nvmf.go b/pkg/nvmf/nvmf.go index d099533..1d1b462 100644 --- a/pkg/nvmf/nvmf.go +++ b/pkg/nvmf/nvmf.go @@ -1,11 +1,25 @@ +/* +Copyright 2021 The Kubernetes 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 nvmf import ( "fmt" + "os" + "github.com/container-storage-interface/spec/lib/go/csi" "k8s.io/klog" "k8s.io/utils/mount" - "os" ) func AttachDisk(req *csi.NodePublishVolumeRequest, nm nvmfDiskMounter) (string, error) { diff --git a/pkg/nvmf/nvmf_utils.go b/pkg/nvmf/nvmf_utils.go index 58683e1..412df9b 100644 --- a/pkg/nvmf/nvmf_utils.go +++ b/pkg/nvmf/nvmf_utils.go @@ -1,17 +1,32 @@ +/* +Copyright 2021 The Kubernetes 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 nvmf import ( - "csi-driver-nvmf/pkg/utils" "context" "fmt" - "github.com/kubernetes-csi/csi-lib-utils/protosanitizer" - log "github.com/sirupsen/logrus" - "google.golang.org/grpc" - "k8s.io/klog" "os" "path/filepath" "strings" "time" + + "github.com/kubernetes-csi/csi-lib-utils/protosanitizer" + log "github.com/sirupsen/logrus" + "google.golang.org/grpc" + "k8s.io/klog" + + "csi-driver-nvmf/pkg/utils" ) func waitForPathToExist(devicePath string, maxRetries, intervalSeconds int, deviceTransport string) (bool, error) { diff --git a/pkg/nvmf/server.go b/pkg/nvmf/server.go index 5972340..12b3313 100644 --- a/pkg/nvmf/server.go +++ b/pkg/nvmf/server.go @@ -1,13 +1,28 @@ +/* +Copyright 2021 The Kubernetes 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 nvmf import ( - "csi-driver-nvmf/pkg/utils" - "github.com/container-storage-interface/spec/lib/go/csi" - "google.golang.org/grpc" - "k8s.io/klog" "net" "os" "sync" + + "github.com/container-storage-interface/spec/lib/go/csi" + "google.golang.org/grpc" + "k8s.io/klog" + + "csi-driver-nvmf/pkg/utils" ) // Defines Non blocking GRPC server interfaces diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 265a27c..c11a4d8 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -1,3 +1,16 @@ +/* +Copyright 2021 The Kubernetes 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 utils import (