Skip to content

Commit

Permalink
action: migrate from go/v3 to go/v4
Browse files Browse the repository at this point in the history
Signed-off-by: Rewant Soni <[email protected]>
  • Loading branch information
rewantsoni committed Jul 25, 2024
1 parent f644c2c commit 0298add
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,7 @@ tags

# Support for Project snippet scope

# Created by Mac
*.DS_Store

# End of https://www.toptal.com/developers/gitignore/api/go,vim,visualstudiocode,git
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ COPY go.mod go.sum ./
COPY vendor/ vendor/

# Copy the project source
COPY main.go Makefile ./
COPY Makefile ./
COPY cmd/main.go cmd/main.go
COPY hack/ hack/
COPY api/ api/
COPY controllers/ controllers/
COPY internal/controller/ internal/controller/
COPY config/ config/
COPY pkg/ pkg/
COPY service/ service/
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ go-build: ## Run go build against code.
@GOBIN=${GOBIN} ./hack/go-build.sh

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

container-build: test ## Build container image with the manager.
$(IMAGE_BUILD_CMD) build --platform="linux/amd64" -t ${IMG} .
Expand Down
2 changes: 1 addition & 1 deletion PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: openshift.io
layout:
- go.kubebuilder.io/v3
- go.kubebuilder.io/v4
plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
Expand Down
8 changes: 4 additions & 4 deletions main.go → cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"os"

apiv1alpha1 "github.com/red-hat-storage/ocs-client-operator/api/v1alpha1"
"github.com/red-hat-storage/ocs-client-operator/controllers"
"github.com/red-hat-storage/ocs-client-operator/internal/controller"
"github.com/red-hat-storage/ocs-client-operator/pkg/templates"
"github.com/red-hat-storage/ocs-client-operator/pkg/utils"
admwebhook "github.com/red-hat-storage/ocs-client-operator/pkg/webhook"
Expand Down Expand Up @@ -155,7 +155,7 @@ func main() {
}},
)

if err = (&controllers.StorageClientReconciler{
if err = (&controller.StorageClientReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
OperatorNamespace: utils.GetOperatorNamespace(),
Expand All @@ -164,7 +164,7 @@ func main() {
os.Exit(1)
}

if err = (&controllers.StorageClaimReconciler{
if err = (&controller.StorageClaimReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
OperatorNamespace: utils.GetOperatorNamespace(),
Expand All @@ -182,7 +182,7 @@ func main() {
os.Exit(1)
}

if err = (&controllers.OperatorConfigMapReconciler{
if err = (&controller.OperatorConfigMapReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
OperatorNamespace: utils.GetOperatorNamespace(),
Expand Down
2 changes: 1 addition & 1 deletion hack/go-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export GO111MODULE=${GO111MODULE:-on}

set -x

go build -a -o ${GOBIN:-bin}/manager main.go
go build -a -o ${GOBIN:-bin}/manager cmd/main.go
go build -a -o ${GOBIN:-bin}/status-reporter ./service/status-report/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package controller
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package controller

import (
"bytes"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package controller

//nolint:deadcode,unused
func contains(slice []string, s string) bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package controller

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package controller

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package controller

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package controller

import (
"path/filepath"
Expand Down Expand Up @@ -49,7 +49,7 @@ var _ = BeforeSuite(func() {

By("bootstrapping test environment")
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: false,
}

Expand Down

0 comments on commit 0298add

Please sign in to comment.