diff --git a/api/v1/helper.go b/api/v1/helper.go index 910592c749..1b0266b306 100644 --- a/api/v1/helper.go +++ b/api/v1/helper.go @@ -10,6 +10,7 @@ import ( "strconv" "strings" + "github.com/go-logr/logr" netattdefv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -41,7 +42,12 @@ const ( const invalidVfIndex = -1 var ManifestsPath = "./bindata/manifests/cni-config" -var log = logf.Log.WithName("sriovnetwork") + +var log logr.Logger + +func init() { + logf.Log.WithName("sriovnetwork") +} // NicIDMap contains supported mapping of IDs with each in the format of: // Vendor ID, Physical Function Device ID, Virtual Function Device ID diff --git a/hack/run-e2e-conformance-virtual-cluster.sh b/hack/run-e2e-conformance-virtual-cluster.sh index fe4f6ccd33..2b4fcee592 100755 --- a/hack/run-e2e-conformance-virtual-cluster.sh +++ b/hack/run-e2e-conformance-virtual-cluster.sh @@ -126,24 +126,39 @@ cat << EOF > /etc/containers/registries.conf.d/003-${cluster_name}.conf $insecure_registry EOF -kcli ssh $cluster_name-ctlplane-0 << EOF +function update_host() { + node_name=$1 + insecure_registry=$2 + kcli ssh $node_name << EOF sudo su echo '$insecure_registry' > /etc/containers/registries.conf.d/003-internal.conf systemctl restart crio -EOF -kcli ssh $cluster_name-worker-0 << EOF -sudo su -echo '$insecure_registry' > /etc/containers/registries.conf.d/003-internal.conf -systemctl restart crio -EOF +echo '[connection] +id=multi +type=ethernet +[ethernet] +[match] +driver=igbvf; +[ipv4] +method=disabled +[ipv6] +addr-gen-mode=default +method=disabled +[proxy]' > /etc/NetworkManager/system-connections/multi.nmconnection + +chmod 600 /etc/NetworkManager/system-connections/multi.nmconnection +systemctl restart NetworkManager -kcli ssh $cluster_name-worker-1 << EOF -sudo su -echo '$insecure_registry' > /etc/containers/registries.conf.d/003-internal.conf -systemctl restart crio EOF +} + +update_host $cluster_name-ctlplane-0 "$insecure_registry" +update_host $cluster_name-worker-0 "$insecure_registry" +update_host $cluster_name-worker-1 "$insecure_registry" + + kubectl create namespace container-registry echo "## deploy internal registry" @@ -349,3 +364,5 @@ if [ -z $SKIP_TEST ]; then echo "## run sriov e2e conformance tests" SUITE=./test/conformance JUNIT_OUTPUT=`pwd`/k8s-artifacts hack/run-e2e-conformance.sh fi + +} \ No newline at end of file