Skip to content

Commit

Permalink
Revert "feat: use Flannel CNI to replace default CNI for testing Gate…
Browse files Browse the repository at this point in the history
…wayAPI"

This reverts commit 050b76d.

Signed-off-by: Lin Yang <[email protected]>
  • Loading branch information
reaver-flomesh committed Jan 3, 2025
1 parent 91c892b commit 98520ed
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 57 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ jobs:
env:
CTR_TAG: ${{ github.sha }}
CTR_REGISTRY: "localhost:5000" # unused for kind, but currently required in framework
INSTALL_FLANNEL_CNI: "true"
steps:
- name: Free space
run: |
Expand All @@ -264,17 +263,10 @@ jobs:
sudo apt-get autoremove -y
sudo apt-get clean
rm -rf /usr/share/dotnet/
- name: Get CNI plugins
- name: Remove netscript
run: |
ARCH=$(uname -m)
case $ARCH in
armv7*) ARCH="arm";;
aarch64) ARCH="arm64";;
x86_64) ARCH="amd64";;
esac
mkdir -p /opt/cni/bin
curl -O -L https://github.com/containernetworking/plugins/releases/download/v1.6.0/cni-plugins-linux-$ARCH-v1.6.0.tgz
tar -C /opt/cni/bin -xzf cni-plugins-linux-$ARCH-v1.6.0.tgz
sudo apt-get remove -y netscript
sudo systemctl restart docker
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
Expand Down
10 changes: 0 additions & 10 deletions pkg/utils/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,3 @@ func GetEnv(envVar string, defaultValue string) string {
}
return val
}

// GetEnvBool is a convenience wrapper for os.Getenv() with additional default value return
func GetEnvBool(envVar string, defaultValue bool) bool {
val := os.Getenv(envVar)
if val == "" {
return defaultValue
}

return val == "true"
}
34 changes: 0 additions & 34 deletions tests/framework/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ func registerFlags(td *FsmTestData) {
flag.BoolVar(&td.EnableNsMetricTag, "EnableMetricsTag", true, "Enable tagging Namespaces for metrics collection")
flag.BoolVar(&td.DeployOnOpenShift, "deployOnOpenShift", false, "Configure tests to run on OpenShift")
flag.BoolVar(&td.RetryAppPodCreation, "retryAppPodCreation", true, "Retry app pod creation on error")

flag.BoolVar(&td.InstallFlannelCNI, "installFlannelCNI", utils.GetEnvBool("INSTALL_FLANNEL_CNI", false), "Install Flannel CNI plugin")
}

// ValidateStringParams validates input string parameters are valid
Expand Down Expand Up @@ -298,16 +296,6 @@ nodeRegistration:
},
},
}

if Td.InstallFlannelCNI {
clusterConfig.Networking = v1alpha4.Networking{DisableDefaultCNI: true}
for i := 0; i < len(clusterConfig.Nodes); i++ {
clusterConfig.Nodes[i].ExtraMounts = append(clusterConfig.Nodes[i].ExtraMounts, v1alpha4.Mount{
ContainerPath: "/opt/cni/bin",
HostPath: "/opt/cni/bin",
})
}
}
if Td.ClusterVersion != "" {
for i := 0; i < len(clusterConfig.Nodes); i++ {
clusterConfig.Nodes[i].Image = fmt.Sprintf("kindest/node:%s", td.ClusterVersion)
Expand All @@ -316,28 +304,6 @@ nodeRegistration:
if err := td.ClusterProvider.Create(td.ClusterName, cluster.CreateWithV1Alpha4Config(clusterConfig)); err != nil {
return fmt.Errorf("failed to create kind cluster: %w", err)
}

if Td.InstallFlannelCNI {
// Install Flannel CNI
stdout, stderr, err := td.RunLocal("kubectl", "apply", "-f", "https://github.com/flannel-io/flannel/releases/latest/download/kube-flannel.yml")
if err != nil {
td.T.Logf("error installing Flannel CNI: %s", err)
}
td.T.Logf("stdout:\n%s", stdout)
td.T.Logf("stderr:\n%s", stderr)

if err := td.WaitForPodsRunningReady("kube-flannel", 2, nil); err != nil {
return fmt.Errorf("failed to wait for kube-flannel pods")
}

if err := td.WaitForPodsRunningReady("kube-system", 2, &metav1.LabelSelector{
MatchLabels: map[string]string{
"k8s-app": "kube-dns",
},
}); err != nil {
return fmt.Errorf("failed to wait for kube-flannel pods")
}
}
}

clientConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(
Expand Down
2 changes: 0 additions & 2 deletions tests/framework/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ type FsmTestData struct {
DeployOnOpenShift bool // Determines whether to configure tests for OpenShift

RetryAppPodCreation bool // Whether to retry app pod creation due to issue #3973

InstallFlannelCNI bool // Whether to install Flannel CNI plugin
}

// InstallFSMOpts describes install options for FSM
Expand Down

0 comments on commit 98520ed

Please sign in to comment.