• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kubevirt / containerized-data-importer / #4812
49%

Build:
DEFAULT BRANCH: main
Ran 26 Jul 2024 04:35AM UTC
Jobs 1
Files 155
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

26 Jul 2024 04:25AM UTC coverage: 59.174% (+0.1%) from 59.028%
#4812

push

travis-ci

web-flow
Remove datavolume clone source validation (#3331)

* Remove sourceref validation

The source can be changed and updated, we want the error to be
presented by an event and have the datavolume pending instead
of preventing the creation of the datavolume.
We are already handling the option of the source not existing yet
so lets also handle all the validation in the controller.

Signed-off-by: Shelly Kagan <skagan@redhat.com>

* Move pvc clone specific functions to pvc-clone-controller

Now that the validation is no longer done in the webhook
no need for that code to be in the controller common util
file. Moved the UT accordingly.

Signed-off-by: Shelly Kagan <skagan@redhat.com>

* Move function to new Describe node

Will add in future commits other tests to that section

Signed-off-by: Shelly Kagan <skagan@redhat.com>

* pvc-clone-controller: make better event and update dv if validation fails

In order to make it more clear that the validation failed
we should add the reason of validation failure to the event
Added an update watch to the clone controller so if something changes
in the source the clone will reconcile. Hence no need to return an
error, the reconcile will be triggered if someting will change in the
source.

Signed-off-by: Shelly Kagan <skagan@redhat.com>

* snap-clone: always validate snapshot source

This commit adds missing validation due to the remove validation
from the dv webhook, but also fixes an existing missing validation
in cases where the clone was created before the source. In such case
the webhook would not validate the source since it didnt exist yet,
and then if the clone happened with populators then we would not
validate the source size at all.
We should validate the snapshot source before continuing with the clone
whether it is populator/legacy clones.
Moved all the validation to one function.
Updated the event to include the reason for the validation failure and
updated dv status accordingly.

Signed-off-by: Shelly Kagan... (continued)

94 of 118 new or added lines in 4 files covered. (79.66%)

21 existing lines in 4 files now uncovered.

16464 of 27823 relevant lines covered (59.17%)

0.65 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
62.09
2.55% pkg/controller/datavolume/pvc-clone-controller.go
4
58.07
-0.5% pkg/controller/datavolume/clone-controller-base.go
6
61.44
6.56% pkg/controller/datavolume/snapshot-clone-controller.go
12
13.45
-0.66% pkg/controller/common/util.go

Uncovered Existing Lines

Lines Coverage ∆ File
1
75.12
0.65% pkg/apiserver/webhooks/datavolume-validate.go
2
61.44
6.56% pkg/controller/datavolume/snapshot-clone-controller.go
7
52.63
-9.21% pkg/util/prometheus/prometheus.go
11
13.45
-0.66% pkg/controller/common/util.go
Jobs
ID Job ID Ran Files Coverage
1 #4812.1 26 Jul 2024 04:35AM UTC 155
59.17
Source Files on build #4812
  • Tree
  • List 155
  • Changed 8
  • Source Changed 0
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 8dab1078 on github
  • Prev Build on main
  • Next Build on main
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc