in pilot/pkg/config/kube/crdclient/types.gen.go [767:820]
func delete(ic versionedclient.Interface, sc gatewayapiclient.Interface, typ config.GroupVersionKind, name, namespace string, resourceVersion *string) error {
var deleteOptions metav1.DeleteOptions
if resourceVersion != nil {
deleteOptions.Preconditions = &metav1.Preconditions{ResourceVersion: resourceVersion}
}
switch typ {
case collections.IstioExtensionsV1Alpha1Servicemetadatas.Resource().GroupVersionKind():
return ic.ExtensionsV1alpha1().ServiceMetadatas(namespace).Delete(context.TODO(), name, deleteOptions)
case collections.IstioExtensionsV1Alpha1Servicenamemappings.Resource().GroupVersionKind():
return ic.ExtensionsV1alpha1().ServiceNameMappings(namespace).Delete(context.TODO(), name, deleteOptions)
case collections.IstioExtensionsV1Alpha1Wasmplugins.Resource().GroupVersionKind():
return ic.ExtensionsV1alpha1().WasmPlugins(namespace).Delete(context.TODO(), name, deleteOptions)
case collections.IstioNetworkingV1Alpha3Destinationrules.Resource().GroupVersionKind():
return ic.NetworkingV1alpha3().DestinationRules(namespace).Delete(context.TODO(), name, deleteOptions)
case collections.IstioNetworkingV1Alpha3Envoyfilters.Resource().GroupVersionKind():
return ic.NetworkingV1alpha3().EnvoyFilters(namespace).Delete(context.TODO(), name, deleteOptions)
case collections.IstioNetworkingV1Alpha3Gateways.Resource().GroupVersionKind():
return ic.NetworkingV1alpha3().Gateways(namespace).Delete(context.TODO(), name, deleteOptions)
case collections.IstioNetworkingV1Alpha3Serviceentries.Resource().GroupVersionKind():
return ic.NetworkingV1alpha3().ServiceEntries(namespace).Delete(context.TODO(), name, deleteOptions)
case collections.IstioNetworkingV1Alpha3Sidecars.Resource().GroupVersionKind():
return ic.NetworkingV1alpha3().Sidecars(namespace).Delete(context.TODO(), name, deleteOptions)
case collections.IstioNetworkingV1Alpha3Virtualservices.Resource().GroupVersionKind():
return ic.NetworkingV1alpha3().VirtualServices(namespace).Delete(context.TODO(), name, deleteOptions)
case collections.IstioNetworkingV1Alpha3Workloadentries.Resource().GroupVersionKind():
return ic.NetworkingV1alpha3().WorkloadEntries(namespace).Delete(context.TODO(), name, deleteOptions)
case collections.IstioNetworkingV1Alpha3Workloadgroups.Resource().GroupVersionKind():
return ic.NetworkingV1alpha3().WorkloadGroups(namespace).Delete(context.TODO(), name, deleteOptions)
case collections.IstioNetworkingV1Beta1Proxyconfigs.Resource().GroupVersionKind():
return ic.NetworkingV1beta1().ProxyConfigs(namespace).Delete(context.TODO(), name, deleteOptions)
case collections.IstioSecurityV1Beta1Authorizationpolicies.Resource().GroupVersionKind():
return ic.SecurityV1beta1().AuthorizationPolicies(namespace).Delete(context.TODO(), name, deleteOptions)
case collections.IstioSecurityV1Beta1Peerauthentications.Resource().GroupVersionKind():
return ic.SecurityV1beta1().PeerAuthentications(namespace).Delete(context.TODO(), name, deleteOptions)
case collections.IstioSecurityV1Beta1Requestauthentications.Resource().GroupVersionKind():
return ic.SecurityV1beta1().RequestAuthentications(namespace).Delete(context.TODO(), name, deleteOptions)
case collections.IstioTelemetryV1Alpha1Telemetries.Resource().GroupVersionKind():
return ic.TelemetryV1alpha1().Telemetries(namespace).Delete(context.TODO(), name, deleteOptions)
case collections.K8SGatewayApiV1Alpha2Gatewayclasses.Resource().GroupVersionKind():
return sc.GatewayV1alpha2().GatewayClasses().Delete(context.TODO(), name, deleteOptions)
case collections.K8SGatewayApiV1Alpha2Gateways.Resource().GroupVersionKind():
return sc.GatewayV1alpha2().Gateways(namespace).Delete(context.TODO(), name, deleteOptions)
case collections.K8SGatewayApiV1Alpha2Httproutes.Resource().GroupVersionKind():
return sc.GatewayV1alpha2().HTTPRoutes(namespace).Delete(context.TODO(), name, deleteOptions)
case collections.K8SGatewayApiV1Alpha2Referencepolicies.Resource().GroupVersionKind():
return sc.GatewayV1alpha2().ReferencePolicies(namespace).Delete(context.TODO(), name, deleteOptions)
case collections.K8SGatewayApiV1Alpha2Tcproutes.Resource().GroupVersionKind():
return sc.GatewayV1alpha2().TCPRoutes(namespace).Delete(context.TODO(), name, deleteOptions)
case collections.K8SGatewayApiV1Alpha2Tlsroutes.Resource().GroupVersionKind():
return sc.GatewayV1alpha2().TLSRoutes(namespace).Delete(context.TODO(), name, deleteOptions)
default:
return fmt.Errorf("unsupported type: %v", typ)
}
}