Skip to content

Commit

Permalink
Refactor virt-v2v
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Necas <[email protected]>
  • Loading branch information
mnecas committed Jan 20, 2025
1 parent 14201d9 commit 3083ffc
Show file tree
Hide file tree
Showing 64 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Check out forklift repository
uses: actions/checkout@v4

- run: ${{ matrix.shell }} ./virt-v2v/pkg/customize/scripts/rhel/run/test-network_config_util.sh
- run: ${{ matrix.shell }} ./pkg/virt-v2v/customize/scripts/rhel/run/test-network_config_util.sh

ci_setup:
strategy:
Expand Down
3 changes: 2 additions & 1 deletion .tekton/virt-v2v-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ metadata:
== "main" && ( ".tekton/virt-v2v-pull-request.yaml".pathChanged() ||
".tekton/virt-v2v-push.yaml".pathChanged() ||
"build/virt-v2v/Containerfile".pathChanged() ||
"virt-v2v/***".pathChanged() ||
"pkg/virt-v2v/***".pathChanged() ||
"cmd/virt-v2v/***".pathChanged() ||
"cmd/virt-v2v-monitor/***".pathChanged() )
creationTimestamp: null
labels:
Expand Down
3 changes: 2 additions & 1 deletion .tekton/virt-v2v-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ metadata:
== "main" && ( ".tekton/virt-v2v-pull-request.yaml".pathChanged() ||
".tekton/virt-v2v-push.yaml".pathChanged() ||
"build/virt-v2v/Containerfile".pathChanged() ||
"virt-v2v/***".pathChanged() ||
"pkg/virt-v2v/***".pathChanged() ||
"cmd/virt-v2v/***".pathChanged() ||
"cmd/virt-v2v-monitor/***".pathChanged() )
creationTimestamp: null
labels:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ all: test forklift-controller

# Run tests
test: generate fmt vet manifests validation-test
go test -coverprofile=cover.out ./pkg/... ./cmd/... ./virt-v2v/...
go test -coverprofile=cover.out ./pkg/... ./cmd/...

# Experimental e2e target
e2e-sanity: e2e-sanity-ovirt e2e-sanity-vsphere
Expand Down
2 changes: 1 addition & 1 deletion build/virt-v2v/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ENV GOEXPERIMENT strictfipsruntime

RUN GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o virt-v2v-monitor github.com/konveyor/forklift-controller/cmd/virt-v2v-monitor
RUN GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o image-converter github.com/konveyor/forklift-controller/cmd/image-converter
RUN GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o virt-v2v-wrapper virt-v2v/cmd/entrypoint.go
RUN GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o virt-v2v-wrapper github.com/konveyor/forklift-controller/cmd/virt-v2v

FROM registry.access.redhat.com/ubi9:9.5-1731517889

Expand Down
2 changes: 1 addition & 1 deletion build/virt-v2v/Containerfile-upstream
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ENV GOEXPERIMENT strictfipsruntime

RUN GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o virt-v2v-monitor ./cmd/virt-v2v-monitor/virt-v2v-monitor.go
RUN GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o image-converter ./cmd/image-converter/image-converter.go
RUN GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o virt-v2v-wrapper ./virt-v2v/cmd/entrypoint.go
RUN GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o virt-v2v-wrapper ./cmd/virt-v2v/entrypoint.go

# Main container
FROM quay.io/centos/centos:stream9-minimal
Expand Down
8 changes: 4 additions & 4 deletions virt-v2v/cmd/entrypoint.go → cmd/virt-v2v/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"strconv"
"strings"

"github.com/konveyor/forklift-controller/virt-v2v/pkg/customize"
"github.com/konveyor/forklift-controller/virt-v2v/pkg/global"
"github.com/konveyor/forklift-controller/virt-v2v/pkg/server"
"github.com/konveyor/forklift-controller/virt-v2v/pkg/utils"
"github.com/konveyor/forklift-controller/pkg/virt-v2v/customize"
"github.com/konveyor/forklift-controller/pkg/virt-v2v/global"
"github.com/konveyor/forklift-controller/pkg/virt-v2v/server"
utils "github.com/konveyor/forklift-controller/pkg/virt-v2v/utils"
)

func main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strings"
"testing"

"github.com/konveyor/forklift-controller/virt-v2v/pkg/global"
"github.com/konveyor/forklift-controller/pkg/virt-v2v/global"
)

func TestStaticIPs(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"os/exec"
"strings"

"github.com/konveyor/forklift-controller/virt-v2v/pkg/global"
"github.com/konveyor/forklift-controller/virt-v2v/pkg/utils"
"github.com/konveyor/forklift-controller/pkg/virt-v2v/global"
"github.com/konveyor/forklift-controller/pkg/virt-v2v/utils"
)

//go:embed scripts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"regexp"
"strings"

"github.com/konveyor/forklift-controller/virt-v2v/pkg/global"
"github.com/konveyor/forklift-controller/virt-v2v/pkg/utils"
"github.com/konveyor/forklift-controller/pkg/virt-v2v/global"
"github.com/konveyor/forklift-controller/pkg/virt-v2v/utils"
)

func CustomizeLinux(execFunc DomainExecFunc, disks []string, dir string, t FileSystemTool) error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"reflect"
"testing"

"github.com/konveyor/forklift-controller/virt-v2v/pkg/global"
"github.com/konveyor/forklift-controller/pkg/virt-v2v/global"
)

type MockEmbedTool struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"regexp"
"strings"

"github.com/konveyor/forklift-controller/virt-v2v/pkg/utils"
"github.com/konveyor/forklift-controller/pkg/virt-v2v/utils"
)

// getScriptsWithSuffix retrieves all scripts with suffix from the specified directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"os"
"path/filepath"

"github.com/konveyor/forklift-controller/virt-v2v/pkg/global"
"github.com/konveyor/forklift-controller/virt-v2v/pkg/utils"
"github.com/konveyor/forklift-controller/pkg/virt-v2v/global"
"github.com/konveyor/forklift-controller/pkg/virt-v2v/utils"
)

// CustomizeWindows customizes a windows disk image by uploading scripts.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"os"
"path/filepath"

"github.com/konveyor/forklift-controller/virt-v2v/pkg/global"
"github.com/konveyor/forklift-controller/virt-v2v/pkg/utils"
"github.com/konveyor/forklift-controller/pkg/virt-v2v/global"
"github.com/konveyor/forklift-controller/pkg/virt-v2v/utils"
)

var (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"
"strings"

"github.com/konveyor/forklift-controller/virt-v2v/pkg/global"
"github.com/konveyor/forklift-controller/pkg/virt-v2v/global"
)

func CheckEnvVariablesSet(envVars ...string) bool {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3083ffc

Please sign in to comment.