Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release candidate v1.4.44.4 #2094

Merged
merged 2 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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