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

kubevirt / containerized-data-importer / #5192

14 Mar 2025 07:22PM UTC coverage: 59.45%. First build
#5192

Pull #3559

travis-ci

mrnold
Un-break filesystem imports.

The initial transfer creates data.img, only subsequent delta copies need
to fail if it isn't there.

Signed-off-by: Matthew Arnold <marnold@redhat.com>
Pull Request #3559: MTV-1699 Avoid potentially exceeding memory limit in multi-stage VDDK imports.

68 of 101 new or added lines in 1 file covered. (67.33%)

16834 of 28316 relevant lines covered (59.45%)

0.66 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/pkg/controller/common/runtime-util.go
1
/*
2
Copyright 2022 The CDI Authors.
3

4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7

8
    http://www.apache.org/licenses/LICENSE-2.0
9

10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
limitations under the License.
14
See the License for the specific language governing permissions and
15
*/
16

17
package common
18

19
import (
20
        "k8s.io/apimachinery/pkg/api/errors"
21
        "k8s.io/apimachinery/pkg/api/meta"
22
        metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
23

24
        cdiv1 "kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1"
25
        "kubevirt.io/containerized-data-importer/pkg/common"
26
)
27

28
// MakeEmptyCDIConfigSpec creates cdi config manifest
29
func MakeEmptyCDIConfigSpec(name string) *cdiv1.CDIConfig {
×
30
        return &cdiv1.CDIConfig{
×
31
                TypeMeta: metav1.TypeMeta{
×
32
                        Kind:       "CDIConfig",
×
33
                        APIVersion: "cdi.kubevirt.io/v1beta1",
×
34
                },
×
35
                ObjectMeta: metav1.ObjectMeta{
×
36
                        Name: name,
×
37
                        Labels: map[string]string{
×
38
                                common.CDILabelKey:       common.CDILabelValue,
×
39
                                common.CDIComponentLabel: "",
×
40
                        },
×
41
                },
×
42
        }
×
43
}
×
44

45
// MakeEmptyCDICR creates CDI CustomResouce manifest
46
func MakeEmptyCDICR() *cdiv1.CDI {
×
47
        return &cdiv1.CDI{
×
48
                TypeMeta: metav1.TypeMeta{
×
49
                        Kind:       "CDI",
×
50
                        APIVersion: "cdis.cdi.kubevirt.io",
×
51
                },
×
52
                ObjectMeta: metav1.ObjectMeta{
×
53
                        Name: "cdi",
×
54
                },
×
55
        }
×
56
}
×
57

58
// IgnoreNotFound returns nil if the error is a NotFound error.
59
// We generally want to ignore (not requeue) NotFound errors, since we'll get a reconciliation request once the
60
// object exists, and requeuing in the meantime won't help.
61
func IgnoreNotFound(err error) error {
×
62
        if errors.IsNotFound(err) {
×
63
                return nil
×
64
        }
×
65
        return err
×
66
}
67

68
// IgnoreIsNoMatchError returns nil if the error is a IsNoMatchError.
69
// We will want to ignore this error for optional CRDs, if it is not found, just ignore it.
70
func IgnoreIsNoMatchError(err error) error {
×
71
        if meta.IsNoMatchError(err) {
×
72
                return nil
×
73
        }
×
74
        return err
×
75
}
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

© 2026 Coveralls, Inc