cleanup: move pkg/ to internal/

The internal/ directory in Go has a special meaning, and indicates that
those packages are not meant for external consumption. Ceph-CSI does
provide public APIs for other projects to consume. There is no plan to
keep the API of the internally used packages stable.

Closes: #903
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2020-04-17 11:23:49 +02:00 committed by mergify[bot]
parent d0abc3f5e6
commit 32839948ef
64 changed files with 37 additions and 37 deletions

View File

@ -29,9 +29,9 @@ GO_PROJECT=github.com/ceph/ceph-csi
# go build flags
LDFLAGS ?=
LDFLAGS += -X $(GO_PROJECT)/pkg/util.GitCommit=$(GIT_COMMIT)
LDFLAGS += -X $(GO_PROJECT)/internal/util.GitCommit=$(GIT_COMMIT)
# CSI_IMAGE_VERSION will be considered as the driver version
LDFLAGS += -X $(GO_PROJECT)/pkg/util.DriverVersion=$(CSI_IMAGE_VERSION)
LDFLAGS += -X $(GO_PROJECT)/internal/util.DriverVersion=$(CSI_IMAGE_VERSION)
# set GOARCH explicitly for cross building, default to native architecture
ifndef GOARCH

View File

@ -24,10 +24,10 @@ import (
"runtime"
"time"
"github.com/ceph/ceph-csi/pkg/cephfs"
"github.com/ceph/ceph-csi/pkg/liveness"
"github.com/ceph/ceph-csi/pkg/rbd"
"github.com/ceph/ceph-csi/pkg/util"
"github.com/ceph/ceph-csi/internal/cephfs"
"github.com/ceph/ceph-csi/internal/liveness"
"github.com/ceph/ceph-csi/internal/rbd"
"github.com/ceph/ceph-csi/internal/util"
"k8s.io/klog"
)

View File

@ -40,7 +40,7 @@ import (
"github.com/pborman/uuid"
"github.com/pkg/errors"
"github.com/ceph/ceph-csi/pkg/util"
"github.com/ceph/ceph-csi/internal/util"
)
```

View File

@ -20,7 +20,7 @@ import (
"context"
"fmt"
"github.com/ceph/ceph-csi/pkg/util"
"github.com/ceph/ceph-csi/internal/util"
)
// MDSMap is a representation of the mds map sub-structure returned by 'ceph fs get'

View File

@ -19,7 +19,7 @@ package cephfs
import (
"context"
"github.com/ceph/ceph-csi/pkg/util"
"github.com/ceph/ceph-csi/internal/util"
)
const (

View File

@ -19,8 +19,8 @@ package cephfs
import (
"context"
csicommon "github.com/ceph/ceph-csi/pkg/csi-common"
"github.com/ceph/ceph-csi/pkg/util"
csicommon "github.com/ceph/ceph-csi/internal/csi-common"
"github.com/ceph/ceph-csi/internal/util"
"github.com/container-storage-interface/spec/lib/go/csi"
"google.golang.org/grpc/codes"

View File

@ -19,8 +19,8 @@ package cephfs
import (
"k8s.io/klog"
csicommon "github.com/ceph/ceph-csi/pkg/csi-common"
"github.com/ceph/ceph-csi/pkg/util"
csicommon "github.com/ceph/ceph-csi/internal/csi-common"
"github.com/ceph/ceph-csi/internal/util"
"github.com/container-storage-interface/spec/lib/go/csi"
)

View File

@ -19,7 +19,7 @@ package cephfs
import (
"context"
"github.com/ceph/ceph-csi/pkg/util"
"github.com/ceph/ceph-csi/internal/util"
"k8s.io/klog"
)

View File

@ -19,7 +19,7 @@ package cephfs
import (
"context"
csicommon "github.com/ceph/ceph-csi/pkg/csi-common"
csicommon "github.com/ceph/ceph-csi/internal/csi-common"
"github.com/container-storage-interface/spec/lib/go/csi"
)

View File

@ -21,8 +21,8 @@ import (
"fmt"
"os"
csicommon "github.com/ceph/ceph-csi/pkg/csi-common"
"github.com/ceph/ceph-csi/pkg/util"
csicommon "github.com/ceph/ceph-csi/internal/csi-common"
"github.com/ceph/ceph-csi/internal/util"
"github.com/container-storage-interface/spec/lib/go/csi"
"google.golang.org/grpc/codes"

View File

@ -24,7 +24,7 @@ import (
"os"
"os/exec"
"github.com/ceph/ceph-csi/pkg/util"
"github.com/ceph/ceph-csi/internal/util"
"github.com/container-storage-interface/spec/lib/go/csi"
"google.golang.org/grpc/codes"

View File

@ -24,7 +24,7 @@ import (
"strconv"
"strings"
"github.com/ceph/ceph-csi/pkg/util"
"github.com/ceph/ceph-csi/internal/util"
"k8s.io/klog"
)

View File

@ -27,7 +27,7 @@ import (
"strings"
"sync"
"github.com/ceph/ceph-csi/pkg/util"
"github.com/ceph/ceph-csi/internal/util"
"golang.org/x/sys/unix"
"k8s.io/klog"

View File

@ -24,7 +24,7 @@ import (
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/pkg/errors"
"github.com/ceph/ceph-csi/pkg/util"
"github.com/ceph/ceph-csi/internal/util"
)
type volumeOptions struct {

View File

@ -19,7 +19,7 @@ package csicommon
import (
"context"
"github.com/ceph/ceph-csi/pkg/util"
"github.com/ceph/ceph-csi/internal/util"
"github.com/container-storage-interface/spec/lib/go/csi"
"google.golang.org/grpc/codes"

View File

@ -19,7 +19,7 @@ package csicommon
import (
"context"
"github.com/ceph/ceph-csi/pkg/util"
"github.com/ceph/ceph-csi/internal/util"
"github.com/container-storage-interface/spec/lib/go/csi"
"google.golang.org/grpc/codes"

View File

@ -20,7 +20,7 @@ import (
"fmt"
"os"
"github.com/ceph/ceph-csi/pkg/util"
"github.com/ceph/ceph-csi/internal/util"
"context"

View File

@ -23,7 +23,7 @@ import (
"strings"
"sync/atomic"
"github.com/ceph/ceph-csi/pkg/util"
"github.com/ceph/ceph-csi/internal/util"
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/kubernetes-csi/csi-lib-utils/protosanitizer"

View File

@ -20,7 +20,7 @@ import (
"context"
"time"
"github.com/ceph/ceph-csi/pkg/util"
"github.com/ceph/ceph-csi/internal/util"
connlib "github.com/kubernetes-csi/csi-lib-utils/connection"
"github.com/kubernetes-csi/csi-lib-utils/metrics"

View File

@ -20,8 +20,8 @@ import (
"context"
"fmt"
csicommon "github.com/ceph/ceph-csi/pkg/csi-common"
"github.com/ceph/ceph-csi/pkg/util"
csicommon "github.com/ceph/ceph-csi/internal/csi-common"
"github.com/ceph/ceph-csi/internal/util"
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/kubernetes-csi/csi-lib-utils/protosanitizer"

View File

@ -17,8 +17,8 @@ limitations under the License.
package rbd
import (
csicommon "github.com/ceph/ceph-csi/pkg/csi-common"
"github.com/ceph/ceph-csi/pkg/util"
csicommon "github.com/ceph/ceph-csi/internal/csi-common"
"github.com/ceph/ceph-csi/internal/util"
"github.com/container-storage-interface/spec/lib/go/csi"
"k8s.io/klog"

View File

@ -19,7 +19,7 @@ package rbd
import (
"context"
csicommon "github.com/ceph/ceph-csi/pkg/csi-common"
csicommon "github.com/ceph/ceph-csi/internal/csi-common"
"github.com/container-storage-interface/spec/lib/go/csi"
)

View File

@ -23,8 +23,8 @@ import (
"strconv"
"strings"
csicommon "github.com/ceph/ceph-csi/pkg/csi-common"
"github.com/ceph/ceph-csi/pkg/util"
csicommon "github.com/ceph/ceph-csi/internal/csi-common"
"github.com/ceph/ceph-csi/internal/util"
"github.com/container-storage-interface/spec/lib/go/csi"
"google.golang.org/grpc/codes"

View File

@ -25,7 +25,7 @@ import (
"strings"
"time"
"github.com/ceph/ceph-csi/pkg/util"
"github.com/ceph/ceph-csi/internal/util"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/klog"

View File

@ -20,7 +20,7 @@ import (
"context"
"fmt"
"github.com/ceph/ceph-csi/pkg/util"
"github.com/ceph/ceph-csi/internal/util"
"github.com/pkg/errors"
"k8s.io/klog"

View File

@ -28,7 +28,7 @@ import (
"strings"
"time"
"github.com/ceph/ceph-csi/pkg/util"
"github.com/ceph/ceph-csi/internal/util"
"github.com/ceph/go-ceph/rados"
librbd "github.com/ceph/go-ceph/rbd"

View File

@ -6,7 +6,7 @@ if [[ -x "$(command -v gosec)" ]]; then
# gosec does not support -mod=vendor, so fallback to non-module support and
# assume all dependencies are available in ./vendor already
export GO111MODULE=off
find cmd pkg -type d -print0 | xargs --null gosec
find cmd internal -type d -print0 | xargs --null gosec
else
echo "WARNING: gosec not found, skipping security tests" >&2
fi