in pilot/pkg/config/kube/crdclient/types.gen.go [176:291]
func update(ic versionedclient.Interface, sc gatewayapiclient.Interface, cfg config.Config, objMeta metav1.ObjectMeta) (metav1.Object, error) {
switch cfg.GroupVersionKind {
case collections.IstioExtensionsV1Alpha1Servicemetadatas.Resource().GroupVersionKind():
return ic.ExtensionsV1alpha1().ServiceMetadatas(cfg.Namespace).Update(context.TODO(), &clientextensionsv1alpha1.ServiceMetadata{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*extensionsv1alpha1.ServiceMetadata)),
}, metav1.UpdateOptions{})
case collections.IstioExtensionsV1Alpha1Servicenamemappings.Resource().GroupVersionKind():
return ic.ExtensionsV1alpha1().ServiceNameMappings(cfg.Namespace).Update(context.TODO(), &clientextensionsv1alpha1.ServiceNameMapping{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*extensionsv1alpha1.ServiceNameMapping)),
}, metav1.UpdateOptions{})
case collections.IstioExtensionsV1Alpha1Wasmplugins.Resource().GroupVersionKind():
return ic.ExtensionsV1alpha1().WasmPlugins(cfg.Namespace).Update(context.TODO(), &clientextensionsv1alpha1.WasmPlugin{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*extensionsv1alpha1.WasmPlugin)),
}, metav1.UpdateOptions{})
case collections.IstioNetworkingV1Alpha3Destinationrules.Resource().GroupVersionKind():
return ic.NetworkingV1alpha3().DestinationRules(cfg.Namespace).Update(context.TODO(), &clientnetworkingv1alpha3.DestinationRule{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*networkingv1alpha3.DestinationRule)),
}, metav1.UpdateOptions{})
case collections.IstioNetworkingV1Alpha3Envoyfilters.Resource().GroupVersionKind():
return ic.NetworkingV1alpha3().EnvoyFilters(cfg.Namespace).Update(context.TODO(), &clientnetworkingv1alpha3.EnvoyFilter{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*networkingv1alpha3.EnvoyFilter)),
}, metav1.UpdateOptions{})
case collections.IstioNetworkingV1Alpha3Gateways.Resource().GroupVersionKind():
return ic.NetworkingV1alpha3().Gateways(cfg.Namespace).Update(context.TODO(), &clientnetworkingv1alpha3.Gateway{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*networkingv1alpha3.Gateway)),
}, metav1.UpdateOptions{})
case collections.IstioNetworkingV1Alpha3Serviceentries.Resource().GroupVersionKind():
return ic.NetworkingV1alpha3().ServiceEntries(cfg.Namespace).Update(context.TODO(), &clientnetworkingv1alpha3.ServiceEntry{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*networkingv1alpha3.ServiceEntry)),
}, metav1.UpdateOptions{})
case collections.IstioNetworkingV1Alpha3Sidecars.Resource().GroupVersionKind():
return ic.NetworkingV1alpha3().Sidecars(cfg.Namespace).Update(context.TODO(), &clientnetworkingv1alpha3.Sidecar{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*networkingv1alpha3.Sidecar)),
}, metav1.UpdateOptions{})
case collections.IstioNetworkingV1Alpha3Virtualservices.Resource().GroupVersionKind():
return ic.NetworkingV1alpha3().VirtualServices(cfg.Namespace).Update(context.TODO(), &clientnetworkingv1alpha3.VirtualService{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*networkingv1alpha3.VirtualService)),
}, metav1.UpdateOptions{})
case collections.IstioNetworkingV1Alpha3Workloadentries.Resource().GroupVersionKind():
return ic.NetworkingV1alpha3().WorkloadEntries(cfg.Namespace).Update(context.TODO(), &clientnetworkingv1alpha3.WorkloadEntry{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*networkingv1alpha3.WorkloadEntry)),
}, metav1.UpdateOptions{})
case collections.IstioNetworkingV1Alpha3Workloadgroups.Resource().GroupVersionKind():
return ic.NetworkingV1alpha3().WorkloadGroups(cfg.Namespace).Update(context.TODO(), &clientnetworkingv1alpha3.WorkloadGroup{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*networkingv1alpha3.WorkloadGroup)),
}, metav1.UpdateOptions{})
case collections.IstioNetworkingV1Beta1Proxyconfigs.Resource().GroupVersionKind():
return ic.NetworkingV1beta1().ProxyConfigs(cfg.Namespace).Update(context.TODO(), &clientnetworkingv1beta1.ProxyConfig{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*networkingv1beta1.ProxyConfig)),
}, metav1.UpdateOptions{})
case collections.IstioSecurityV1Beta1Authorizationpolicies.Resource().GroupVersionKind():
return ic.SecurityV1beta1().AuthorizationPolicies(cfg.Namespace).Update(context.TODO(), &clientsecurityv1beta1.AuthorizationPolicy{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*securityv1beta1.AuthorizationPolicy)),
}, metav1.UpdateOptions{})
case collections.IstioSecurityV1Beta1Peerauthentications.Resource().GroupVersionKind():
return ic.SecurityV1beta1().PeerAuthentications(cfg.Namespace).Update(context.TODO(), &clientsecurityv1beta1.PeerAuthentication{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*securityv1beta1.PeerAuthentication)),
}, metav1.UpdateOptions{})
case collections.IstioSecurityV1Beta1Requestauthentications.Resource().GroupVersionKind():
return ic.SecurityV1beta1().RequestAuthentications(cfg.Namespace).Update(context.TODO(), &clientsecurityv1beta1.RequestAuthentication{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*securityv1beta1.RequestAuthentication)),
}, metav1.UpdateOptions{})
case collections.IstioTelemetryV1Alpha1Telemetries.Resource().GroupVersionKind():
return ic.TelemetryV1alpha1().Telemetries(cfg.Namespace).Update(context.TODO(), &clienttelemetryv1alpha1.Telemetry{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*telemetryv1alpha1.Telemetry)),
}, metav1.UpdateOptions{})
case collections.K8SGatewayApiV1Alpha2Gatewayclasses.Resource().GroupVersionKind():
return sc.GatewayV1alpha2().GatewayClasses().Update(context.TODO(), &gatewayv1alpha2.GatewayClass{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*gatewayv1alpha2.GatewayClassSpec)),
}, metav1.UpdateOptions{})
case collections.K8SGatewayApiV1Alpha2Gateways.Resource().GroupVersionKind():
return sc.GatewayV1alpha2().Gateways(cfg.Namespace).Update(context.TODO(), &gatewayv1alpha2.Gateway{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*gatewayv1alpha2.GatewaySpec)),
}, metav1.UpdateOptions{})
case collections.K8SGatewayApiV1Alpha2Httproutes.Resource().GroupVersionKind():
return sc.GatewayV1alpha2().HTTPRoutes(cfg.Namespace).Update(context.TODO(), &gatewayv1alpha2.HTTPRoute{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*gatewayv1alpha2.HTTPRouteSpec)),
}, metav1.UpdateOptions{})
case collections.K8SGatewayApiV1Alpha2Referencepolicies.Resource().GroupVersionKind():
return sc.GatewayV1alpha2().ReferencePolicies(cfg.Namespace).Update(context.TODO(), &gatewayv1alpha2.ReferencePolicy{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*gatewayv1alpha2.ReferencePolicySpec)),
}, metav1.UpdateOptions{})
case collections.K8SGatewayApiV1Alpha2Tcproutes.Resource().GroupVersionKind():
return sc.GatewayV1alpha2().TCPRoutes(cfg.Namespace).Update(context.TODO(), &gatewayv1alpha2.TCPRoute{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*gatewayv1alpha2.TCPRouteSpec)),
}, metav1.UpdateOptions{})
case collections.K8SGatewayApiV1Alpha2Tlsroutes.Resource().GroupVersionKind():
return sc.GatewayV1alpha2().TLSRoutes(cfg.Namespace).Update(context.TODO(), &gatewayv1alpha2.TLSRoute{
ObjectMeta: objMeta,
Spec: *(cfg.Spec.(*gatewayv1alpha2.TLSRouteSpec)),
}, metav1.UpdateOptions{})
default:
return nil, fmt.Errorf("unsupported type: %v", cfg.GroupVersionKind)
}
}