Documentation ¶
Overview ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func CompareNetworkingV1LBEqual(lb1 []networkingv1.IngressLoadBalancerIngress, ...) bool
- func CompareNetworkingV1beta1LBEqual(lb1 []networkingv1beta1.IngressLoadBalancerIngress, ...) bool
- func CoreV1ToGatewayV1beta1Addr(lbips []corev1.LoadBalancerIngress) []gatewayv1beta1.GatewayStatusAddress
- func CoreV1ToNetworkV1LB(lbips []corev1.LoadBalancerIngress) []networkingv1.IngressLoadBalancerIngress
- func CoreV1ToNetworkV1beta1LB(lbips []corev1.LoadBalancerIngress) []networkingv1beta1.IngressLoadBalancerIngress
- func DiffGlobalRules(olds, news []*apisixv1.GlobalRule) (added, updated, deleted []*apisixv1.GlobalRule)
- func DiffPluginConfigs(olds, news []*apisixv1.PluginConfig) (added, updated, deleted []*apisixv1.PluginConfig)
- func DiffPluginMetadatas(olds, news []*apisixv1.PluginMetadata) (added, updated, deleted []*apisixv1.PluginMetadata)
- func DiffRoutes(olds, news []*apisixv1.Route) (added, updated, deleted []*apisixv1.Route)
- func DiffSSL(olds, news []*apisixv1.Ssl) (added, updated, deleted []*apisixv1.Ssl)
- func DiffStreamRoutes(olds, news []*apisixv1.StreamRoute) (added, updated, deleted []*apisixv1.StreamRoute)
- func DiffUpstreams(olds, news []*apisixv1.Upstream) (added, updated, deleted []*apisixv1.Upstream)
- func Difference(a, b []string) []string
- func Equal(a, b []string) bool
- func IngressLBStatusIPs(ingressPublishService string, ingressStatusAddress []string, ...) ([]corev1.LoadBalancerIngress, error)
- func IngressPublishAddresses(ingressPublishService string, ingressStatusAddress []string, ...) ([]string, error)
- func InsertKeyInMap(key string, value interface{}, dest map[string]interface{})
- func IsHostnameMatch(listener, route string) bool
- func MatchCRDsIngressClass(resourceIngressClassName string, configIngressClass string) bool
- func MatchHostDef(host string) bool
- func PtrOf[T any](v T) *T
- func RecorderEvent(recorder record.EventRecorder, object runtime.Object, eventtype, reason string, ...)
- func RecorderEventS(recorder record.EventRecorder, object runtime.Object, eventtype, reason string, ...)
- func ReverseString(s string) string
- func SchemeToPort(schema string) int
- func SyncManifests(ctx context.Context, apisix apisix.APISIX, clusterName string, ...) error
- func TruncateString(s string, max int) string
- func VerifyConditions(conditions *[]metav1.Condition, newCondition metav1.Condition) bool
- func VerifyGeneration(conditions *[]metav1.Condition, newCondition metav1.Condition) bool
- type Manifest
- type ParallelExecutor
Constants ¶
const ( ConditionType = "ResourcesAvailable" CommonSuccessMessage = "Sync Successfully" // Component is used for event component Component = "ApisixIngress" // ResourceSynced is used when a resource is synced successfully ResourceSynced = "ResourcesSynced" // MessageResourceSynced is used to specify controller MessageResourceSynced = "%s synced successfully" // ResourceSyncAborted is used when a resource synced failed ResourceSyncAborted = "ResourceSyncAborted" // MessageResourceFailed is used to report error MessageResourceFailed = "%s synced failed, with error: %s" )
Variables ¶
This section is empty.
Functions ¶
func CompareNetworkingV1LBEqual ¶
func CompareNetworkingV1LBEqual(lb1 []networkingv1.IngressLoadBalancerIngress, lb2 []networkingv1.IngressLoadBalancerIngress) bool
func CompareNetworkingV1beta1LBEqual ¶
func CompareNetworkingV1beta1LBEqual(lb1 []networkingv1beta1.IngressLoadBalancerIngress, lb2 []networkingv1beta1.IngressLoadBalancerIngress) bool
func CoreV1ToGatewayV1beta1Addr ¶
func CoreV1ToGatewayV1beta1Addr(lbips []corev1.LoadBalancerIngress) []gatewayv1beta1.GatewayStatusAddress
func CoreV1ToNetworkV1LB ¶
func CoreV1ToNetworkV1LB(lbips []corev1.LoadBalancerIngress) []networkingv1.IngressLoadBalancerIngress
CoreV1ToNetworkV1LB convert []corev1.LoadBalancerIngress to []networkingv1.IngressLoadBalancerIngress
func CoreV1ToNetworkV1beta1LB ¶
func CoreV1ToNetworkV1beta1LB(lbips []corev1.LoadBalancerIngress) []networkingv1beta1.IngressLoadBalancerIngress
CoreV1ToNetworkV1beta1LB convert []corev1.LoadBalancerIngress to []networkingv1beta1.IngressLoadBalancerIngress
func DiffGlobalRules ¶
func DiffGlobalRules(olds, news []*apisixv1.GlobalRule) (added, updated, deleted []*apisixv1.GlobalRule)
func DiffPluginConfigs ¶
func DiffPluginConfigs(olds, news []*apisixv1.PluginConfig) (added, updated, deleted []*apisixv1.PluginConfig)
func DiffPluginMetadatas ¶
func DiffPluginMetadatas(olds, news []*apisixv1.PluginMetadata) (added, updated, deleted []*apisixv1.PluginMetadata)
func DiffRoutes ¶
func DiffStreamRoutes ¶
func DiffStreamRoutes(olds, news []*apisixv1.StreamRoute) (added, updated, deleted []*apisixv1.StreamRoute)
func DiffUpstreams ¶
func Difference ¶
Difference returns elements only in a Duplicated elements are considered as same element
func IngressLBStatusIPs ¶
func IngressLBStatusIPs(ingressPublishService string, ingressStatusAddress []string, svcLister listerscorev1.ServiceLister) ([]corev1.LoadBalancerIngress, error)
IngressLBStatusIPs organizes the available addresses
func IngressPublishAddresses ¶
func IngressPublishAddresses(ingressPublishService string, ingressStatusAddress []string, svcLister listerscorev1.ServiceLister) ([]string, error)
IngressPublishAddresses get addressed used to expose Ingress
func InsertKeyInMap ¶
InsertKeyInMap takes a dot separated string and recursively goes inside the destination to fill the value
func IsHostnameMatch ¶
IsHostnameMatch follow GatewayAPI specification to match listenr and route hostname. FYI: https://github.com/kubernetes-sigs/gateway-api/blob/a596211672a5aed54881862dc87c8c1cad9c7bd8/apis/v1beta1/gateway_types.go#L154
func MatchCRDsIngressClass ¶
func MatchHostDef ¶
MatchHostDef checks that host matches host's shcema ref to : https://github.com/apache/apisix/blob/c5fc10d9355a0c177a7532f01c77745ff0639a7f/apisix/schema_def.lua#L40 ref to : https://github.com/kubernetes/kubernetes/blob/976a940f4a4e84fe814583848f97b9aafcdb083f/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L205 They define regex differently, but k8s's dns is more accurate
func RecorderEvent ¶
func RecorderEvent(recorder record.EventRecorder, object runtime.Object, eventtype, reason string, err error)
RecorderEvent recorder events for resources
func RecorderEventS ¶
func RecorderEventS(recorder record.EventRecorder, object runtime.Object, eventtype, reason string, msg string)
RecorderEventS recorder events for resources
func ReverseString ¶
func SchemeToPort ¶
SchemeToPort scheme converts to the default port ref https://github.com/apache/apisix/blob/c5fc10d9355a0c177a7532f01c77745ff0639a7f/apisix/upstream.lua#L167-L172
func SyncManifests ¶
func SyncManifests(ctx context.Context, apisix apisix.APISIX, clusterName string, added, updated, deleted *Manifest, shouldCompare bool) error
Due to dependency, delete priority should be last shouldCompare only affects Create event since periodic synchronization is considered as Add event
func TruncateString ¶
func VerifyConditions ¶
VerifyConditions verify conditions to decide whether to update status
Types ¶
type Manifest ¶
type Manifest struct { Routes []*apisixv1.Route Upstreams []*apisixv1.Upstream StreamRoutes []*apisixv1.StreamRoute SSLs []*apisixv1.Ssl PluginConfigs []*apisixv1.PluginConfig PluginMetadatas []*apisixv1.PluginMetadata GlobalRules []*apisixv1.GlobalRule }
type ParallelExecutor ¶
type ParallelExecutor struct {
// contains filtered or unexported fields
}
func (*ParallelExecutor) Add ¶
func (exec *ParallelExecutor) Add(handler func())
func (*ParallelExecutor) AddE ¶
func (exec *ParallelExecutor) AddE(handler func() error)
func (*ParallelExecutor) Errors ¶
func (exec *ParallelExecutor) Errors() []error
func (*ParallelExecutor) Wait ¶
func (exec *ParallelExecutor) Wait()