Skip to content

Commit

Permalink
Update the project for kubebuilder go/v4 layout
Browse files Browse the repository at this point in the history
Change the layout to follow the Standard Go Project Layout, as described
in https://book.kubebuilder.io/migration/v3vsv4.  This allows newer releases
of kubebuilder to be used with this repo.

Signed-off-by: Dean Roehrich <[email protected]>
  • Loading branch information
roehrich-hpe committed Oct 20, 2023
1 parent 8928a1d commit 1fe1942
Show file tree
Hide file tree
Showing 30 changed files with 47 additions and 47 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ COPY vendor/ vendor/
# and so that source changes don't invalidate our downloaded layer

# Copy the go source
COPY main.go main.go
COPY cmd/ cmd/
COPY api/ api/
COPY controllers/ controllers/
COPY internal/ internal/

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager cmd/main.go

###############################################################################
FROM builder as testing
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ build-daemon: manifests generate fmt vet ## Build standalone nnf-datamovement da
GOOS=linux GOARCH=amd64 go build -ldflags="-X '$(PACKAGE).version=$(RPM_VERSION)'" -o bin/nnf-dm daemons/compute/server/main.go

build: generate fmt vet ## Build manager binary.
go build -o bin/manager main.go
go build -o bin/manager cmd/main.go

run: manifests generate fmt vet ## Run a controller from your host.
go run ./main.go
go run cmd/main.go

docker-build: VERSION ?= $(shell cat .version)
docker-build: .version ## Build docker image with the manager.
Expand Down
2 changes: 1 addition & 1 deletion PROJECT
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
domain: cray.hpe.com
layout:
- go.kubebuilder.io/v3
- go.kubebuilder.io/v4
plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
Expand Down
2 changes: 1 addition & 1 deletion main.go → cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import (
nnfv1alpha1 "github.com/NearNodeFlash/nnf-sos/api/v1alpha1"

dmv1alpha1 "github.com/NearNodeFlash/nnf-dm/api/v1alpha1"
"github.com/NearNodeFlash/nnf-dm/controllers"
controllers "github.com/NearNodeFlash/nnf-dm/internal/controller"
//+kubebuilder:scaffold:imports
)

Expand Down
2 changes: 1 addition & 1 deletion daemons/compute/server/servers/server_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import (
dmv1alpha1 "github.com/NearNodeFlash/nnf-dm/api/v1alpha1"
nnfv1alpha1 "github.com/NearNodeFlash/nnf-sos/api/v1alpha1"

dmctrl "github.com/NearNodeFlash/nnf-dm/controllers"
dmctrl "github.com/NearNodeFlash/nnf-dm/internal/controller"

pb "github.com/NearNodeFlash/nnf-dm/daemons/compute/client-go/api"

Expand Down
6 changes: 6 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ module github.com/NearNodeFlash/nnf-dm

go 1.19

replace github.com/NearNodeFlash/lustre-fs-operator => ../lustre-fs-oper-2.git

replace github.com/DataWorkflowServices/dws => ../dws-a.git

replace github.com/NearNodeFlash/nnf-sos => ../nnf-sos-1.git

require (
github.com/NearNodeFlash/lustre-fs-operator v0.0.1-0.20231010163846-1ecbc574e6af
github.com/NearNodeFlash/nnf-sos v0.0.1-0.20231010164913-dbe940193534
Expand Down
6 changes: 0 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
github.com/DataWorkflowServices/dws v0.0.1-0.20231010162938-b6d65b00cad6 h1:+j1ex3+PaJApQzCR7reMIJULPL+a7uOHYRJdSQVRWhA=
github.com/DataWorkflowServices/dws v0.0.1-0.20231010162938-b6d65b00cad6/go.mod h1:grHFCu0CoUK8exzS57r6cdf4qHpG1Pv5nl0n7evpaUM=
github.com/NearNodeFlash/lustre-fs-operator v0.0.1-0.20231010163846-1ecbc574e6af h1:ZBNdD/ax/v7QWHCDazyYpYCVxz8E1hKmqU7nezmYGs0=
github.com/NearNodeFlash/lustre-fs-operator v0.0.1-0.20231010163846-1ecbc574e6af/go.mod h1:stbNYHHfXr9Ep6wp6fJL4gAW1TKGuouFo682nhU8Eec=
github.com/NearNodeFlash/nnf-ec v0.0.0-20231010162453-a8168bb6a52f h1:aWtSSQLLk9mUZj94mowirQeVw9saf80gVe10X0rZe8o=
github.com/NearNodeFlash/nnf-ec v0.0.0-20231010162453-a8168bb6a52f/go.mod h1:oxdwMqfttOF9dabJhqrWlirCnMk8/8eyLMwl+hducjk=
github.com/NearNodeFlash/nnf-sos v0.0.1-0.20231010164913-dbe940193534 h1:JeSH4KIRyW5hoYgHoQU0G1I5VvKsRyeIF3MTaHVWEiA=
github.com/NearNodeFlash/nnf-sos v0.0.1-0.20231010164913-dbe940193534/go.mod h1:Zf0JMC0pe98w8xvqm+ugkHsHuUT860IorvXLGyNRoDM=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* limitations under the License.
*/

package controllers
package controller

import (
"bufio"
Expand Down Expand Up @@ -53,7 +53,7 @@ import (

dwsv1alpha2 "github.com/DataWorkflowServices/dws/api/v1alpha2"
dmv1alpha1 "github.com/NearNodeFlash/nnf-dm/api/v1alpha1"
"github.com/NearNodeFlash/nnf-dm/controllers/metrics"
"github.com/NearNodeFlash/nnf-dm/internal/controller/metrics"
nnfv1alpha1 "github.com/NearNodeFlash/nnf-sos/api/v1alpha1"
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Hewlett Packard Enterprise Development LP
* Copyright 2022-2023 Hewlett Packard Enterprise Development LP
* Other additional copyright holders may be indicated within.
*
* The entirety of this work is licensed under the Apache License,
Expand All @@ -17,7 +17,7 @@
* limitations under the License.
*/

package controllers
package controller

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* limitations under the License.
*/

package controllers
package controller

import (
"context"
Expand Down Expand Up @@ -47,7 +47,7 @@ import (

lusv1beta1 "github.com/NearNodeFlash/lustre-fs-operator/api/v1beta1"
dmv1alpha1 "github.com/NearNodeFlash/nnf-dm/api/v1alpha1"
"github.com/NearNodeFlash/nnf-dm/controllers/metrics"
"github.com/NearNodeFlash/nnf-dm/internal/controller/metrics"
)

const (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Hewlett Packard Enterprise Development LP
* Copyright 2022-2023 Hewlett Packard Enterprise Development LP
* Other additional copyright holders may be indicated within.
*
* The entirety of this work is licensed under the Apache License,
Expand All @@ -17,7 +17,7 @@
* limitations under the License.
*/

package controllers
package controller

import (
"context"
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions controllers/suite_test.go → internal/controller/suite_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021, 2022 Hewlett Packard Enterprise Development LP
* Copyright 2021-2023 Hewlett Packard Enterprise Development LP
* Other additional copyright holders may be indicated within.
*
* The entirety of this work is licensed under the Apache License,
Expand All @@ -17,7 +17,7 @@
* limitations under the License.
*/

package controllers
package controller

import (
"context"
Expand Down Expand Up @@ -91,9 +91,9 @@ var _ = BeforeSuite(func() {
By("bootstrapping test environment")
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{
filepath.Join("..", "vendor", "github.com", "NearNodeFlash", "lustre-fs-operator", "config", "crd", "bases"),
filepath.Join("..", "vendor", "github.com", "NearNodeFlash", "nnf-sos", "config", "crd", "bases"),
filepath.Join("..", "config", "crd", "bases"),
filepath.Join("..", "..", "vendor", "github.com", "NearNodeFlash", "lustre-fs-operator", "config", "crd", "bases"),
filepath.Join("..", "..", "vendor", "github.com", "NearNodeFlash", "nnf-sos", "config", "crd", "bases"),
filepath.Join("..", "..", "config", "crd", "bases"),
},
ErrorIfCRDPathMissing: true,
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# github.com/DataWorkflowServices/dws v0.0.1-0.20231010162938-b6d65b00cad6
# github.com/DataWorkflowServices/dws v0.0.1-0.20231010162938-b6d65b00cad6 => ../dws-a.git
## explicit; go 1.19
github.com/DataWorkflowServices/dws/api/v1alpha2
github.com/DataWorkflowServices/dws/utils/dwdparse
github.com/DataWorkflowServices/dws/utils/updater
# github.com/NearNodeFlash/lustre-fs-operator v0.0.1-0.20231010163846-1ecbc574e6af
# github.com/NearNodeFlash/lustre-fs-operator v0.0.1-0.20231010163846-1ecbc574e6af => ../lustre-fs-oper-2.git
## explicit; go 1.19
github.com/NearNodeFlash/lustre-fs-operator/api/v1beta1
github.com/NearNodeFlash/lustre-fs-operator/config/crd/bases
# github.com/NearNodeFlash/nnf-ec v0.0.0-20231010162453-a8168bb6a52f
## explicit; go 1.19
github.com/NearNodeFlash/nnf-ec/pkg/rfsf/pkg/models
# github.com/NearNodeFlash/nnf-sos v0.0.1-0.20231010164913-dbe940193534
# github.com/NearNodeFlash/nnf-sos v0.0.1-0.20231010164913-dbe940193534 => ../nnf-sos-1.git
## explicit; go 1.19
github.com/NearNodeFlash/nnf-sos/api/v1alpha1
github.com/NearNodeFlash/nnf-sos/config/crd/bases
Expand Down Expand Up @@ -747,3 +747,6 @@ sigs.k8s.io/structured-merge-diff/v4/value
# sigs.k8s.io/yaml v1.3.0
## explicit; go 1.12
sigs.k8s.io/yaml
# github.com/NearNodeFlash/lustre-fs-operator => ../lustre-fs-oper-2.git
# github.com/DataWorkflowServices/dws => ../dws-a.git
# github.com/NearNodeFlash/nnf-sos => ../nnf-sos-1.git

0 comments on commit 1fe1942

Please sign in to comment.