Skip to content

Commit

Permalink
Release candidate v1.4.44.4 (#2094)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
thatmattlong and vipul-21 authored Jul 31, 2023
1 parent 1f25704 commit 169db92
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ steps:
mkdir -p ~/.kube/
echo "Create AKS cluster"
make -C ./hack/swift azcfg AZCLI=az REGION=$(REGION_AKS_CLUSTER_TEST)
make -C ./hack/swift byocni-up AZCLI=az REGION=$(REGION_AKS_CLUSTER_TEST) SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) CLUSTER=${{ parameters.clusterName }}-$(make revision)
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
echo "Cluster successfully created"
displayName: Create test cluster
condition: succeeded()
Expand Down Expand Up @@ -92,6 +92,9 @@ steps:
displayName: "Run Azilium E2E"
- script: |
echo "Status of the nodes and pods after the test"
kubectl get nodes -o wide
kubectl get pods -A -o wide
echo "Logs will be available as a build artifact"
ARTIFACT_DIR=$(Build.ArtifactStagingDirectory)/test-output/
echo $ARTIFACT_DIR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ steps:
mkdir -p ~/.kube/
echo "Create AKS Overlay cluster"
make -C ./hack/swift azcfg AZCLI=az REGION=$(REGION_OVERLAY_CLUSTER_TEST)
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)
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
echo "Cluster successfully created"
displayName: Create Overlay cluster
condition: succeeded()
Expand Down Expand Up @@ -98,6 +98,9 @@ steps:
displayName: "Run Azilium E2E on AKS Overlay"
- script: |
echo "Status of the nodes and pods after the test"
kubectl get nodes -o wide
kubectl get pods -A -o wide
echo "Logs will be available as a build artifact"
ARTIFACT_DIR=$(Build.ArtifactStagingDirectory)/test-output/
echo $ARTIFACT_DIR
Expand Down
10 changes: 9 additions & 1 deletion cni/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ import (
"github.com/Azure/azure-container-networking/log"
"github.com/Azure/azure-container-networking/platform"
semver "github.com/hashicorp/go-version"
"github.com/pkg/errors"
utilexec "k8s.io/utils/exec"
)

type client struct {
exec utilexec.Interface
}

var ErrSemVerParse = errors.New("error parsing version")

func New(exec utilexec.Interface) *client {
return &client{exec: exec}
}
Expand Down Expand Up @@ -58,5 +61,10 @@ func (c *client) GetVersion() (*semver.Version, error) {
return nil, fmt.Errorf("Unexpected Azure CNI Version formatting: %v", output)
}

return semver.NewVersion(res[3])
version, versionErr := semver.NewVersion(res[3])
if versionErr != nil {
return nil, errors.Wrap(ErrSemVerParse, versionErr.Error())
}

return version, nil
}
10 changes: 9 additions & 1 deletion cns/cnireconciler/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/Azure/azure-container-networking/cni/client"
semver "github.com/hashicorp/go-version"
"github.com/pkg/errors"
"k8s.io/utils/exec"
)

Expand All @@ -15,7 +16,9 @@ const lastCNIWithoutDumpStateVer = "1.4.6"
// IsDumpStateVer checks if the CNI executable is a version that
// has the dump state command required to initialize CNS from CNI
// state and returns the result of that test or an error. Will always
// return false when there is an error.
// return false when there is an error unless the error was caused
// by the CNI not being a semver, in which case we'll assume we can
// use the command.
func IsDumpStateVer() (bool, error) {
return isDumpStateVer(exec.New())
}
Expand All @@ -28,6 +31,11 @@ func isDumpStateVer(exec exec.Interface) (bool, error) {
cnicli := client.New(exec)
ver, err := cnicli.GetVersion()
if err != nil {
// If the error was that the CNI isn't a valid semver, assume we have the
// the dump state command
if errors.Is(err, client.ErrSemVerParse) {
return true, nil
}
return false, fmt.Errorf("failed to invoke CNI client.GetVersion(): %w", err)
}
return ver.GreaterThan(needVer), nil
Expand Down
12 changes: 12 additions & 0 deletions cns/cnireconciler/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ func TestIsDumpStateVer(t *testing.T) {
want: true,
wantErr: false,
},
{
name: "non-semver",
exec: newCNIVersionFakeExec(`Azure CNI Version v1.4.35_Win2019OverlayFix`),
want: true,
wantErr: false,
},
{
name: "non-semver hotfix ver",
exec: newCNIVersionFakeExec(`Azure CNI Version v1.4.44.4`),
want: true,
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
9 changes: 5 additions & 4 deletions test/integration/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ package k8s
import (
"bytes"
"context"
"errors"
"io"
"log"
"os"
"strings"
"testing"
"time"

"github.com/pkg/errors"

// crd "dnc/requestcontroller/kubernetes"
"os"
"testing"

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

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

Expand Down

0 comments on commit 169db92

Please sign in to comment.