Skip to content

Commit 169db92

Browse files
Release candidate v1.4.44.4 (#2094)
* fix: assume invalid semver CNI has the required dump state command (#2078) * fix: Updating the vmsize for e2e cilium to avoid resource scarcity (#2014) CI: Testing the e2e test for cilium --------- Co-authored-by: Vipul Singh <[email protected]>
1 parent 1f25704 commit 169db92

File tree

6 files changed

+43
-8
lines changed

6 files changed

+43
-8
lines changed

.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ steps:
3232
mkdir -p ~/.kube/
3333
echo "Create AKS cluster"
3434
make -C ./hack/swift azcfg AZCLI=az REGION=$(REGION_AKS_CLUSTER_TEST)
35-
make -C ./hack/swift byocni-up AZCLI=az REGION=$(REGION_AKS_CLUSTER_TEST) SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) CLUSTER=${{ parameters.clusterName }}-$(make revision)
35+
make -C ./hack/swift byocni-up AZCLI=az REGION=$(REGION_AKS_CLUSTER_TEST) SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) CLUSTER=${{ parameters.clusterName }}-$(make revision) VM_SIZE=Standard_B2ms
3636
echo "Cluster successfully created"
3737
displayName: Create test cluster
3838
condition: succeeded()
@@ -92,6 +92,9 @@ steps:
9292
displayName: "Run Azilium E2E"
9393
9494
- script: |
95+
echo "Status of the nodes and pods after the test"
96+
kubectl get nodes -o wide
97+
kubectl get pods -A -o wide
9598
echo "Logs will be available as a build artifact"
9699
ARTIFACT_DIR=$(Build.ArtifactStagingDirectory)/test-output/
97100
echo $ARTIFACT_DIR

.pipelines/singletenancy/overlay/overlay-e2e-step-template.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ steps:
3232
mkdir -p ~/.kube/
3333
echo "Create AKS Overlay cluster"
3434
make -C ./hack/swift azcfg AZCLI=az REGION=$(REGION_OVERLAY_CLUSTER_TEST)
35-
make -C ./hack/swift overlay-byocni-up AZCLI=az REGION=$(REGION_OVERLAY_CLUSTER_TEST) SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) CLUSTER=${{ parameters.clusterName }}-$(make revision)
35+
make -C ./hack/swift overlay-byocni-up AZCLI=az REGION=$(REGION_OVERLAY_CLUSTER_TEST) SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) CLUSTER=${{ parameters.clusterName }}-$(make revision) VM_SIZE=Standard_B2ms
3636
echo "Cluster successfully created"
3737
displayName: Create Overlay cluster
3838
condition: succeeded()
@@ -98,6 +98,9 @@ steps:
9898
displayName: "Run Azilium E2E on AKS Overlay"
9999
100100
- script: |
101+
echo "Status of the nodes and pods after the test"
102+
kubectl get nodes -o wide
103+
kubectl get pods -A -o wide
101104
echo "Logs will be available as a build artifact"
102105
ARTIFACT_DIR=$(Build.ArtifactStagingDirectory)/test-output/
103106
echo $ARTIFACT_DIR

cni/client/client.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@ import (
1111
"github.com/Azure/azure-container-networking/log"
1212
"github.com/Azure/azure-container-networking/platform"
1313
semver "github.com/hashicorp/go-version"
14+
"github.com/pkg/errors"
1415
utilexec "k8s.io/utils/exec"
1516
)
1617

1718
type client struct {
1819
exec utilexec.Interface
1920
}
2021

22+
var ErrSemVerParse = errors.New("error parsing version")
23+
2124
func New(exec utilexec.Interface) *client {
2225
return &client{exec: exec}
2326
}
@@ -58,5 +61,10 @@ func (c *client) GetVersion() (*semver.Version, error) {
5861
return nil, fmt.Errorf("Unexpected Azure CNI Version formatting: %v", output)
5962
}
6063

61-
return semver.NewVersion(res[3])
64+
version, versionErr := semver.NewVersion(res[3])
65+
if versionErr != nil {
66+
return nil, errors.Wrap(ErrSemVerParse, versionErr.Error())
67+
}
68+
69+
return version, nil
6270
}

cns/cnireconciler/version.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55

66
"github.com/Azure/azure-container-networking/cni/client"
77
semver "github.com/hashicorp/go-version"
8+
"github.com/pkg/errors"
89
"k8s.io/utils/exec"
910
)
1011

@@ -15,7 +16,9 @@ const lastCNIWithoutDumpStateVer = "1.4.6"
1516
// IsDumpStateVer checks if the CNI executable is a version that
1617
// has the dump state command required to initialize CNS from CNI
1718
// state and returns the result of that test or an error. Will always
18-
// return false when there is an error.
19+
// return false when there is an error unless the error was caused
20+
// by the CNI not being a semver, in which case we'll assume we can
21+
// use the command.
1922
func IsDumpStateVer() (bool, error) {
2023
return isDumpStateVer(exec.New())
2124
}
@@ -28,6 +31,11 @@ func isDumpStateVer(exec exec.Interface) (bool, error) {
2831
cnicli := client.New(exec)
2932
ver, err := cnicli.GetVersion()
3033
if err != nil {
34+
// If the error was that the CNI isn't a valid semver, assume we have the
35+
// the dump state command
36+
if errors.Is(err, client.ErrSemVerParse) {
37+
return true, nil
38+
}
3139
return false, fmt.Errorf("failed to invoke CNI client.GetVersion(): %w", err)
3240
}
3341
return ver.GreaterThan(needVer), nil

cns/cnireconciler/version_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,18 @@ func TestIsDumpStateVer(t *testing.T) {
4848
want: true,
4949
wantErr: false,
5050
},
51+
{
52+
name: "non-semver",
53+
exec: newCNIVersionFakeExec(`Azure CNI Version v1.4.35_Win2019OverlayFix`),
54+
want: true,
55+
wantErr: false,
56+
},
57+
{
58+
name: "non-semver hotfix ver",
59+
exec: newCNIVersionFakeExec(`Azure CNI Version v1.4.44.4`),
60+
want: true,
61+
wantErr: false,
62+
},
5163
}
5264
for _, tt := range tests {
5365
t.Run(tt.name, func(t *testing.T) {

test/integration/utils_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@ package k8s
55
import (
66
"bytes"
77
"context"
8-
"errors"
98
"io"
109
"log"
10+
"os"
1111
"strings"
12+
"testing"
1213
"time"
1314

15+
"github.com/pkg/errors"
16+
1417
// crd "dnc/requestcontroller/kubernetes"
15-
"os"
16-
"testing"
1718

1819
"github.com/Azure/azure-container-networking/test/integration/retry"
1920
apiv1 "k8s.io/api/core/v1"
@@ -215,7 +216,7 @@ func waitForPodsRunning(ctx context.Context, clientset *kubernetes.Clientset, na
215216

216217
for _, pod := range podList.Items {
217218
if pod.Status.PodIP == "" {
218-
return errors.New("a pod has not been allocated an IP")
219+
return errors.Wrapf(err, "Pod %s/%s has not been allocated an IP yet with reason %s", pod.Namespace, pod.Name, pod.Status.Message)
219220
}
220221
}
221222

0 commit comments

Comments
 (0)