Skip to content

Commit

Permalink
WaitForCiliumEndpoint function removed as unneeded.
Browse files Browse the repository at this point in the history
Signed-off-by: viktor-kurchenko <viktor.kurchenko@isovalent.com>
  • Loading branch information
viktor-kurchenko committed Jan 8, 2024
1 parent 16344bf commit f5e7c58
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 54 deletions.
25 changes: 1 addition & 24 deletions connectivity/check/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -1099,13 +1099,8 @@ func (ct *ConnectivityTest) DeleteConnDisruptTestDeployment(ctx context.Context,

// validateDeployment checks if the Deployments we created have the expected Pods in them.
func (ct *ConnectivityTest) validateDeployment(ctx context.Context) error {
ct.Debug("Validating Deployments...")

disableEndpointCRD := false
if status, ok := ct.Feature(features.DisableEndpointCRD); ok && status.Enabled {
disableEndpointCRD = true
ct.Info("CiliumEndpoint CRD check disabled")
}
ct.Debug("Validating Deployments...")

srcDeployments, dstDeployments := ct.deploymentList()
for _, name := range srcDeployments {
Expand All @@ -1126,12 +1121,6 @@ func (ct *ConnectivityTest) validateDeployment(ctx context.Context) error {
return fmt.Errorf("unable to list perf pods: %w", err)
}
for _, perfPod := range perfPods.Items {
// Individual endpoints will not be created for pods using node's network stack
if !perfPod.Spec.HostNetwork && !disableEndpointCRD {
if err := WaitForCiliumEndpoint(ctx, ct, ct.clients.src, ct.Params().TestNamespace, perfPod.Name); err != nil {
return err
}
}
_, hasLabel := perfPod.GetLabels()["server"]
if hasLabel {
ct.perfServerPod = append(ct.perfServerPod, Pod{
Expand Down Expand Up @@ -1162,12 +1151,6 @@ func (ct *ConnectivityTest) validateDeployment(ctx context.Context) error {
}

for _, pod := range clientPods.Items {
if !disableEndpointCRD {
if err := WaitForCiliumEndpoint(ctx, ct, ct.clients.src, ct.Params().TestNamespace, pod.Name); err != nil {
return err
}
}

if strings.Contains(pod.Name, clientCPDeployment) {
ct.clientCPPods[pod.Name] = Pod{
K8sClient: ct.client,
Expand Down Expand Up @@ -1251,12 +1234,6 @@ func (ct *ConnectivityTest) validateDeployment(ctx context.Context) error {
return fmt.Errorf("unable to list echo pods: %w", err)
}
for _, echoPod := range echoPods.Items {
if !disableEndpointCRD {
if err := WaitForCiliumEndpoint(ctx, ct, client, echoPod.GetNamespace(), echoPod.GetName()); err != nil {
return err
}
}

ct.echoPods[echoPod.Name] = Pod{
K8sClient: client,
Pod: echoPod.DeepCopy(),
Expand Down
24 changes: 0 additions & 24 deletions connectivity/check/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (

"github.com/cilium/cilium/api/v1/models"
"golang.org/x/exp/slices"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/cilium/cilium-cli/defaults"
"github.com/cilium/cilium-cli/k8s"
Expand Down Expand Up @@ -52,29 +51,6 @@ func WaitForDeployment(ctx context.Context, log Logger, client *k8s.Client, name
}
}

// WaitForCiliumEndpoint waits until the specified cilium endpoint gets created.
func WaitForCiliumEndpoint(ctx context.Context, log Logger, client *k8s.Client, namespace, name string) error {
log.Logf("⌛ [%s] Waiting for CiliumEndpoint for pod %s/%s to appear...", client.ClusterName(), namespace, name)

ctx, cancel := context.WithTimeout(ctx, ShortTimeout)
defer cancel()
for {
_, err := client.GetCiliumEndpoint(ctx, namespace, name, metav1.GetOptions{})
if err == nil {
return nil
}

log.Debugf("[%s] Error retrieving CiliumEndpoint for pod %s/%s: %s", client.ClusterName(), namespace, name, err)

select {
case <-time.After(PollInterval):
case <-ctx.Done():
return fmt.Errorf("timeout reached waiting for CiliumEndpoint %s/%s to appear (last error: %w)",
namespace, name, err)
}
}
}

// WaitForPodDNS waits until src can query the DNS server on dst successfully.
func WaitForPodDNS(ctx context.Context, log Logger, src, dst Pod) error {
log.Logf("⌛ [%s] Waiting for pod %s to reach DNS server on %s pod...",
Expand Down
6 changes: 0 additions & 6 deletions utils/features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ const (
EnableEnvoyConfig Feature = "enable-envoy-config"

WireguardEncapsulate Feature = "wireguard-encapsulate"

DisableEndpointCRD Feature = "disable-endpoint-crd"
)

// Feature is the name of a Cilium Feature (e.g. l7-proxy, cni chaining mode etc)
Expand Down Expand Up @@ -269,10 +267,6 @@ func (fs Set) ExtractFromConfigMap(cm *v1.ConfigMap) {
fs[WireguardEncapsulate] = Status{
Enabled: cm.Data[string(WireguardEncapsulate)] == "true",
}

fs[DisableEndpointCRD] = Status{
Enabled: cm.Data[string(DisableEndpointCRD)] == "true",
}
}

func (fs Set) ExtractFromNodes(nodesWithoutCilium map[string]struct{}) {
Expand Down

0 comments on commit f5e7c58

Please sign in to comment.