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

kubevirt / kubevirt / 293cba9f-36b6-49f8-8578-ff58991ffdf5

15 Mar 2025 12:51AM UTC coverage: 71.457% (+0.05%) from 71.412%
293cba9f-36b6-49f8-8578-ff58991ffdf5

push

prow

web-flow
Merge pull request #14220 from kubevirt-bot/bump-kubevirtci

Bump kubevirtci

62112 of 86922 relevant lines covered (71.46%)

0.8 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 2018 Red Hat, Inc.
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, virtCli kubecli.KubevirtClient) {
×
78
        validating_webhooks.Serve(resp, req, admitters.NewMigrationCreateAdmitter(virtCli.GeneratedKubeVirtClient()))
×
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 ServeVMExports(resp http.ResponseWriter, req *http.Request, clusterConfig *virtconfig.ClusterConfig) {
×
94
        validating_webhooks.Serve(resp, req, storageAdmitters.NewVMExportAdmitter(clusterConfig))
×
95
}
×
96

97
func ServeVmInstancetypes(resp http.ResponseWriter, req *http.Request) {
×
98
        validating_webhooks.Serve(resp, req, &instancetypewebhooks.InstancetypeAdmitter{})
×
99
}
×
100

101
func ServeVmClusterInstancetypes(resp http.ResponseWriter, req *http.Request) {
×
102
        validating_webhooks.Serve(resp, req, &instancetypewebhooks.ClusterInstancetypeAdmitter{})
×
103
}
×
104

105
func ServeVmPreferences(resp http.ResponseWriter, req *http.Request) {
×
106
        validating_webhooks.Serve(resp, req, &preferencewebhooks.PreferenceAdmitter{})
×
107
}
×
108

109
func ServeVmClusterPreferences(resp http.ResponseWriter, req *http.Request) {
×
110
        validating_webhooks.Serve(resp, req, &preferencewebhooks.ClusterPreferenceAdmitter{})
×
111
}
×
112

113
func ServeStatusValidation(resp http.ResponseWriter,
114
        req *http.Request,
115
        clusterConfig *virtconfig.ClusterConfig,
116
        virtCli kubecli.KubevirtClient,
117
        informers *webhooks.Informers,
118
        kubeVirtServiceAccounts map[string]struct{},
119
) {
×
120
        validating_webhooks.Serve(resp, req, &admitters.StatusAdmitter{
×
121
                VmsAdmitter: admitters.NewVMsAdmitter(clusterConfig, virtCli, informers, kubeVirtServiceAccounts),
×
122
        })
×
123
}
×
124

125
func ServePodEvictionInterceptor(resp http.ResponseWriter, req *http.Request, clusterConfig *virtconfig.ClusterConfig, virtCli kubecli.KubevirtClient) {
×
126
        validating_webhooks.Serve(resp, req, admitters.NewPodEvictionAdmitter(clusterConfig, virtCli, virtCli.GeneratedKubeVirtClient()))
×
127
}
×
128

129
func ServeMigrationPolicies(resp http.ResponseWriter, req *http.Request) {
×
130
        validating_webhooks.Serve(resp, req, admitters.NewMigrationPolicyAdmitter())
×
131
}
×
132

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