Skip to content

Commit

Permalink
chore: fix cvi vm-route-forge
Browse files Browse the repository at this point in the history
Signed-off-by: Nikita Korolev <[email protected]>
  • Loading branch information
universal-itengineer committed Nov 5, 2024
1 parent 63dafa2 commit a5e4f41
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 533 deletions.
3 changes: 2 additions & 1 deletion images/dvcr-artifact/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ replace (
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.30.2
k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.30.2
k8s.io/sample-controller => k8s.io/sample-controller v0.30.2
kubevirt.io/containerized-data-importer => github.com/deckhouse/3p-containerized-data-importer v1.60.4-0.20241102174230-052ff563fa89 //branch: virtualization-controller-reb-rel-1-60
kubevirt.io/containerized-data-importer => github.com/deckhouse/3p-containerized-data-importer v1.60.4-0.20241105203712-6d09bb531bdf //branch: virtualization-controller-v1.60.3
// kubevirt.io/containerized-data-importer => github.com/deckhouse/3p-containerized-data-importer v1.60.4-0.20241102174230-052ff563fa89 //branch: virtualization-controller-reb-rel-1-60 3835d4ea7e992952be74345cbf91b2f6509435ab
// kubevirt.io/containerized-data-importer => github.com/deckhouse/3p-containerized-data-importer v1.60.4-0.20241031143641-f6fb17bfa7bf //branch: virtualization-controller-new-main-cdi

kubevirt.io/controller-lifecycle-operator-sdk/api => kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90
Expand Down
4 changes: 2 additions & 2 deletions images/dvcr-artifact/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-xdr v0.0.0-20161123171359-e6a2ba005892/go.mod h1:CTDl0pzVzE5DEzZhPfvhY/9sPFMQIxaJ9VAMs9AagrE=
github.com/deckhouse/3p-containerized-data-importer v1.60.4-0.20241102174230-052ff563fa89 h1:8uzIspfaAbFuZoBVxH5lzDi7ra9tqlt1DK130t522vA=
github.com/deckhouse/3p-containerized-data-importer v1.60.4-0.20241102174230-052ff563fa89/go.mod h1:DPCIifnmTNK8C1dC/HKe4sfZX+V7ocfwLHPC0yiOJ/A=
github.com/deckhouse/3p-containerized-data-importer v1.60.4-0.20241105203712-6d09bb531bdf h1:nV52GKvdl2J5GwVMziMKq8JS9V4EJ938AXGCSwNyIh0=
github.com/deckhouse/3p-containerized-data-importer v1.60.4-0.20241105203712-6d09bb531bdf/go.mod h1:DPCIifnmTNK8C1dC/HKe4sfZX+V7ocfwLHPC0yiOJ/A=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/cli v27.1.1+incompatible h1:goaZxOqs4QKxznZjjBWKONQci/MywhtRv2oNn0GkeZE=
Expand Down
10 changes: 6 additions & 4 deletions images/dvcr-artifact/pkg/importer/importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,22 +177,24 @@ func (i *Importer) runForDataSource(ctx context.Context) error {
return monitoring.WriteImportFailureMessage(err)
}

return monitoring.WriteImportCompleteMessage(res.SourceImageSize, res.VirtualSize, res.AvgSpeed, res.Format, durCollector.Collect())
return monitoring.WriteImportCompleteMessage(res.SourceImageSize, res.VirtualSize, res.AvgSpeed, res.Format,
durCollector.Collect())
}

func (i *Importer) newDataSource(_ context.Context) (datasource.DataSourceInterface, error) {
var result datasource.DataSourceInterface

switch i.srcType {
case cc.SourceHTTP:
var err error
result, err = importer.NewHTTPDataSource(i.src, i.srcUsername, i.srcPassword, i.certDir, cdiv1.DataVolumeContentType(i.srcContentType))
result, err = importer.NewHTTPDataSource(i.src, i.srcUsername, i.srcPassword, i.certDir,
cdiv1.DataVolumeContentType(i.srcContentType))
if err != nil {
return nil, fmt.Errorf("error creating HTTP data source: %w", err)
}
case cc.SourceRegistry:
var err error
result, err = datasource.NewContainerRegistryDataSource(i.src, i.srcUsername, i.srcPassword, i.certDir, i.srcInsecure)
result, err = datasource.NewContainerRegistryDataSource(i.src, i.srcUsername, i.srcPassword, i.certDir,
i.srcInsecure)
if err != nil {
return nil, fmt.Errorf("error creating container registry data source: %w", err)
}
Expand Down
15 changes: 8 additions & 7 deletions images/dvcr-artifact/pkg/monitoring/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,14 @@ func NewProgressMeter(rdr io.ReadCloser, total uint64) *ProgressMeter {
}

return &ProgressMeter{
ProgressReader: prometheusutil.NewProgressReader(rdr, total, registryProgress, ownerUID),
total: total,
ownerUID: ownerUID,
avgSpeed: registryAvgSpeed,
curSpeed: registryCurSpeed,
emitInterval: time.Second,
stop: make(chan struct{}),
ProgressReader: prometheusutil.NewProgressReader(rdr, metrics.Progress(ownerUID), total, registryProgress,
ownerUID),
total: total,
ownerUID: ownerUID,
avgSpeed: registryAvgSpeed,
curSpeed: registryCurSpeed,
emitInterval: time.Second,
stop: make(chan struct{}),
}
}

Expand Down
63 changes: 33 additions & 30 deletions images/vm-route-forge/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ module vm-route-forge
go 1.22.7

require (
github.com/cilium/cilium v1.14.14
github.com/cilium/cilium v1.15.10
github.com/cilium/ebpf v0.16.0
github.com/deckhouse/virtualization/api v0.0.0-00010101000000-000000000000
github.com/go-logr/logr v1.4.2
github.com/spf13/cobra v1.7.0
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/vishvananda/netlink v1.2.1-beta.2.0.20240411215012-578e95cc3190
github.com/vishvananda/netlink v1.2.1-beta.2.0.20240524165444-4d4ba1473f21
go.uber.org/zap v1.26.0
golang.org/x/sys v0.22.0
k8s.io/apimachinery v0.29.2
Expand Down Expand Up @@ -41,33 +41,34 @@ require (
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cilium/proxy v0.0.0-20231202123106-38b645b854f3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.11.2 // indirect
github.com/evanphx/json-patch/v5 v5.8.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-openapi/analysis v0.21.4 // indirect
github.com/go-openapi/errors v0.20.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/jsonpointer v0.20.2 // indirect
github.com/go-openapi/jsonreference v0.20.4 // indirect
github.com/go-openapi/loads v0.21.2 // indirect
github.com/go-openapi/runtime v0.26.0 // indirect
github.com/go-openapi/spec v0.20.9 // indirect
github.com/go-openapi/strfmt v0.21.7 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-openapi/validate v0.22.1 // indirect
github.com/go-openapi/runtime v0.26.2 // indirect
github.com/go-openapi/spec v0.20.11 // indirect
github.com/go-openapi/strfmt v0.21.9 // indirect
github.com/go-openapi/swag v0.22.7 // indirect
github.com/go-openapi/validate v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.4 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand All @@ -86,43 +87,45 @@ require (
github.com/openshift/custom-resource-status v1.1.2 // indirect
github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b // indirect
github.com/pborman/uuid v1.2.1 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/shirou/gopsutil/v3 v3.23.5 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/viper v1.16.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/viper v1.18.1 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.0 // indirect
github.com/vishvananda/netns v0.0.4 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.mongodb.org/mongo-driver v1.11.3 // indirect
go.mongodb.org/mongo-driver v1.13.1 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
go.uber.org/dig v1.17.0 // indirect
go.uber.org/dig v1.17.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/oauth2 v0.18.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/term v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/time v0.5.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
Expand All @@ -131,8 +134,8 @@ require (
k8s.io/api v0.29.2 // indirect
k8s.io/apiextensions-apiserver v0.29.2 // indirect
k8s.io/component-base v0.29.2 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
k8s.io/klog/v2 v2.120.0 // indirect
k8s.io/kube-openapi v0.0.0-20240105020646-a37d4de58910 // indirect
k8s.io/utils v0.0.0-20240310230437-4693a0247e57 // indirect
kubevirt.io/api v1.0.0 // indirect
kubevirt.io/containerized-data-importer-api v1.57.0-alpha1 // indirect
Expand Down
Loading

0 comments on commit a5e4f41

Please sign in to comment.