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

kubevirt / kubevirt / 1f279da4-80f1-4827-a9a3-06d287529bae

21 Dec 2025 01:07PM UTC coverage: 70.643% (-0.006%) from 70.649%
1f279da4-80f1-4827-a9a3-06d287529bae

push

prow

web-flow
Merge pull request #16285 from ShellyKa13/vmbackup-incremental

VMBackup: support incremental backup

257 of 353 new or added lines in 15 files covered. (72.8%)

8 existing lines in 5 files now uncovered.

71790 of 101623 relevant lines covered (70.64%)

412.81 hits per line

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

0.0
/pkg/virt-api/webhooks/validating-webhook/validating-webhook.go
1
/*
2
 * This file is part of the KubeVirt project
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
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 *
16
 * Copyright The KubeVirt Authors.
17
 *
18
 */
19

20
package validating_webhook
21

22
import (
23
        "net/http"
24

25
        "kubevirt.io/client-go/kubecli"
26

27
        preferencewebhooks "kubevirt.io/kubevirt/pkg/instancetype/preference/webhooks"
28
        instancetypewebhooks "kubevirt.io/kubevirt/pkg/instancetype/webhooks"
29
        storageadmitters "kubevirt.io/kubevirt/pkg/storage/admitters"
30
        validating_webhooks "kubevirt.io/kubevirt/pkg/util/webhooks/validating-webhooks"
31
        "kubevirt.io/kubevirt/pkg/virt-api/webhooks"
32
        "kubevirt.io/kubevirt/pkg/virt-api/webhooks/validating-webhook/admitters"
33
        virtconfig "kubevirt.io/kubevirt/pkg/virt-config"
34
)
35

36
func ServeVMICreate(
37
        resp http.ResponseWriter,
38
        req *http.Request,
39
        clusterConfig *virtconfig.ClusterConfig,
40
        kubeVirtServiceAccounts map[string]struct{},
41
        specValidators ...admitters.SpecValidator,
42
) {
×
43
        validating_webhooks.Serve(resp, req, &admitters.VMICreateAdmitter{
×
44
                ClusterConfig:           clusterConfig,
×
45
                KubeVirtServiceAccounts: kubeVirtServiceAccounts,
×
46
                SpecValidators:          specValidators,
×
47
        })
×
48
}
×
49

50
func ServeVMIUpdate(resp http.ResponseWriter, req *http.Request, clusterConfig *virtconfig.ClusterConfig, kubeVirtServiceAccounts map[string]struct{}) {
×
51
        validating_webhooks.Serve(resp, req, admitters.NewVMIUpdateAdmitter(clusterConfig, kubeVirtServiceAccounts))
×
52
}
×
53

54
func ServeVMs(
55
        resp http.ResponseWriter,
56
        req *http.Request,
57
        clusterConfig *virtconfig.ClusterConfig,
58
        virtCli kubecli.KubevirtClient,
59
        informers *webhooks.Informers,
60
        kubeVirtServiceAccounts map[string]struct{},
61
) {
×
62
        validating_webhooks.Serve(resp, req, admitters.NewVMsAdmitter(clusterConfig, virtCli, informers, kubeVirtServiceAccounts))
×
63
}
×
64

65
func ServeVMIRS(resp http.ResponseWriter, req *http.Request, clusterConfig *virtconfig.ClusterConfig) {
×
66
        validating_webhooks.Serve(resp, req, &admitters.VMIRSAdmitter{ClusterConfig: clusterConfig})
×
67
}
×
68

69
func ServeVMPool(resp http.ResponseWriter, req *http.Request, clusterConfig *virtconfig.ClusterConfig, kubeVirtServiceAccounts map[string]struct{}) {
×
70
        validating_webhooks.Serve(resp, req, &admitters.VMPoolAdmitter{ClusterConfig: clusterConfig, KubeVirtServiceAccounts: kubeVirtServiceAccounts})
×
71
}
×
72

73
func ServeVMIPreset(resp http.ResponseWriter, req *http.Request) {
×
74
        validating_webhooks.Serve(resp, req, &admitters.VMIPresetAdmitter{})
×
75
}
×
76

77
func ServeMigrationCreate(resp http.ResponseWriter, req *http.Request, clusterConfig *virtconfig.ClusterConfig, virtCli kubecli.KubevirtClient, kubeVirtServiceAccounts map[string]struct{}) {
×
78
        validating_webhooks.Serve(resp, req, admitters.NewMigrationCreateAdmitter(virtCli.GeneratedKubeVirtClient(), clusterConfig, kubeVirtServiceAccounts))
×
79
}
×
80

81
func ServeMigrationUpdate(resp http.ResponseWriter, req *http.Request) {
×
82
        validating_webhooks.Serve(resp, req, &admitters.MigrationUpdateAdmitter{})
×
83
}
×
84

85
func ServeVMSnapshots(resp http.ResponseWriter, req *http.Request, clusterConfig *virtconfig.ClusterConfig, virtCli kubecli.KubevirtClient) {
×
86
        validating_webhooks.Serve(resp, req, storageadmitters.NewVMSnapshotAdmitter(clusterConfig, virtCli))
×
87
}
×
88

89
func ServeVMRestores(resp http.ResponseWriter, req *http.Request, clusterConfig *virtconfig.ClusterConfig, virtCli kubecli.KubevirtClient, informers *webhooks.Informers) {
×
90
        validating_webhooks.Serve(resp, req, storageadmitters.NewVMRestoreAdmitter(clusterConfig, virtCli, informers.VMRestoreInformer))
×
91
}
×
92

93
func ServeVMBackups(resp http.ResponseWriter, req *http.Request, clusterConfig *virtconfig.ClusterConfig, virtCli kubecli.KubevirtClient, informers *webhooks.Informers) {
×
94
        validating_webhooks.Serve(resp, req, storageadmitters.NewVMBackupAdmitter(clusterConfig, virtCli, informers.VMBackupInformer))
×
95
}
×
96

NEW
97
func ServeVMBackupTrackers(resp http.ResponseWriter, req *http.Request, clusterConfig *virtconfig.ClusterConfig) {
×
NEW
98
        validating_webhooks.Serve(resp, req, storageadmitters.NewVMBackupTrackerAdmitter(clusterConfig))
×
NEW
99
}
×
100

101
func ServeVMExports(resp http.ResponseWriter, req *http.Request, clusterConfig *virtconfig.ClusterConfig) {
×
102
        validating_webhooks.Serve(resp, req, storageadmitters.NewVMExportAdmitter(clusterConfig))
×
103
}
×
104

105
func ServeVmInstancetypes(resp http.ResponseWriter, req *http.Request) {
×
106
        validating_webhooks.Serve(resp, req, &instancetypewebhooks.InstancetypeAdmitter{})
×
107
}
×
108

109
func ServeVmClusterInstancetypes(resp http.ResponseWriter, req *http.Request) {
×
110
        validating_webhooks.Serve(resp, req, &instancetypewebhooks.ClusterInstancetypeAdmitter{})
×
111
}
×
112

113
func ServeVmPreferences(resp http.ResponseWriter, req *http.Request) {
×
114
        validating_webhooks.Serve(resp, req, &preferencewebhooks.PreferenceAdmitter{})
×
115
}
×
116

117
func ServeVmClusterPreferences(resp http.ResponseWriter, req *http.Request) {
×
118
        validating_webhooks.Serve(resp, req, &preferencewebhooks.ClusterPreferenceAdmitter{})
×
119
}
×
120

121
func ServeStatusValidation(resp http.ResponseWriter,
122
        req *http.Request,
123
        clusterConfig *virtconfig.ClusterConfig,
124
        virtCli kubecli.KubevirtClient,
125
        informers *webhooks.Informers,
126
        kubeVirtServiceAccounts map[string]struct{},
127
) {
×
128
        validating_webhooks.Serve(resp, req, &admitters.StatusAdmitter{
×
129
                VmsAdmitter: admitters.NewVMsAdmitter(clusterConfig, virtCli, informers, kubeVirtServiceAccounts),
×
130
        })
×
131
}
×
132

133
func ServePodEvictionInterceptor(resp http.ResponseWriter, req *http.Request, clusterConfig *virtconfig.ClusterConfig, virtCli kubecli.KubevirtClient) {
×
134
        validating_webhooks.Serve(resp, req, admitters.NewPodEvictionAdmitter(clusterConfig, virtCli, virtCli.GeneratedKubeVirtClient()))
×
135
}
×
136

137
func ServeMigrationPolicies(resp http.ResponseWriter, req *http.Request) {
×
138
        validating_webhooks.Serve(resp, req, admitters.NewMigrationPolicyAdmitter())
×
139
}
×
140

141
func ServeVirtualMachineClones(resp http.ResponseWriter, req *http.Request, clusterConfig *virtconfig.ClusterConfig, virtCli kubecli.KubevirtClient) {
×
142
        validating_webhooks.Serve(resp, req, admitters.NewVMCloneAdmitter(clusterConfig, virtCli))
×
143
}
×
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