Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoral2 committed Jul 7, 2023
2 parents 0d9189c + 356adec commit 187f253
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 44 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ COPY charts/ /charts/
RUN echo ${CACHEBUST}>/dev/null
RUN CHART_VERSION="1.13.200" CHART_FILE=/charts/rke2-cilium.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="v3.25.1-build2023051202" CHART_FILE=/charts/rke2-canal.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="v3.25.002" CHART_FILE=/charts/rke2-calico.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="v3.25.002" CHART_FILE=/charts/rke2-calico-crd.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="v3.26.100" CHART_FILE=/charts/rke2-calico.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="v3.26.100" CHART_FILE=/charts/rke2-calico-crd.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="1.24.004" CHART_FILE=/charts/rke2-coredns.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="4.6.100" CHART_FILE=/charts/rke2-ingress-nginx.yaml CHART_BOOTSTRAP=false /charts/build-chart.sh
RUN CHART_VERSION="2.11.100-build2023051509" CHART_FILE=/charts/rke2-metrics-server.yaml CHART_BOOTSTRAP=false /charts/build-chart.sh
RUN CHART_VERSION="v3.9.3-build2023010903" CHART_FILE=/charts/rke2-multus.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="v4.0.2-build2023070701" CHART_FILE=/charts/rke2-multus.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="1.5.100" CHART_FILE=/charts/rancher-vsphere-cpi.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="3.0.1-rancher101" CHART_FILE=/charts/rancher-vsphere-csi.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="0.2.200" CHART_FILE=/charts/harvester-cloud-provider.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ FROM build as windows-runtime-collect
ARG KUBERNETES_VERSION=dev

# windows runtime image
ENV CRICTL_VERSION="v1.25.0"
ENV CALICO_VERSION="v3.25.0"
ENV CRICTL_VERSION="v1.27.0"
ENV CALICO_VERSION="v3.26.1"
ENV CNI_PLUGIN_VERSION="v1.1.1"

RUN mkdir -p rancher
Expand Down
26 changes: 19 additions & 7 deletions pkg/windows/calico.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ const (
CalicoSystemNamespace = "calico-system"
CalicoChart = "rke2-calico"
calicoNode = "calico-node"
calicoLogPath = "C:\\var\\log\\"
)

// Setup creates the basic configuration required by the CNI.
Expand Down Expand Up @@ -373,6 +374,12 @@ func (c *Calico) overrideCalicoConfigByHelm(restConfig *rest.Config) error {
}

func startFelix(ctx context.Context, config *CalicoConfig) {
outputFile, err := os.Create(calicoLogPath + "felix.log")
if err != nil {
logrus.Fatalf("error creating felix.log: %v", err)
return
}
defer outputFile.Close()
specificEnvs := []string{
fmt.Sprintf("FELIX_FELIXHOSTNAME=%s", config.Hostname),
fmt.Sprintf("FELIX_VXLANVNI=%s", config.Felix.Vxlanvni),
Expand All @@ -386,14 +393,19 @@ func startFelix(ctx context.Context, config *CalicoConfig) {
logrus.Infof("Felix Envs: %s", append(generateGeneralCalicoEnvs(config), specificEnvs...))
cmd := exec.CommandContext(ctx, "calico-node.exe", args...)
cmd.Env = append(generateGeneralCalicoEnvs(config), specificEnvs...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
logrus.Errorf("Felix exited: %v", err)
}
cmd.Stdout = outputFile
cmd.Stderr = outputFile
_ = cmd.Run()
logrus.Error("Felix exited")
}

func startCalico(ctx context.Context, config *CalicoConfig) error {
outputFile, err := os.Create(calicoLogPath + "calico-node.log")
if err != nil {
logrus.Errorf("error creating calico-node.log: %v", err)
return err
}
defer outputFile.Close()
specificEnvs := []string{
fmt.Sprintf("CALICO_NODENAME_FILE=%s", config.NodeNameFile),
}
Expand All @@ -404,8 +416,8 @@ func startCalico(ctx context.Context, config *CalicoConfig) error {
logrus.Infof("Calico Envs: %s", append(generateGeneralCalicoEnvs(config), specificEnvs...))
cmd := exec.CommandContext(ctx, "calico-node.exe", args...)
cmd.Env = append(generateGeneralCalicoEnvs(config), specificEnvs...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Stdout = outputFile
cmd.Stderr = outputFile
if err := cmd.Run(); err != nil {
logrus.Errorf("Calico exited: %v", err)
return err
Expand Down
18 changes: 9 additions & 9 deletions scripts/build-images
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ xargs -n1 -t docker image pull --quiet << EOF > build/images-cilium.txt
EOF

xargs -n1 -t docker image pull --quiet << EOF > build/images-calico.txt
${REGISTRY}/rancher/mirrored-calico-operator:v1.29.0
${REGISTRY}/rancher/mirrored-calico-ctl:v3.25.0
${REGISTRY}/rancher/mirrored-calico-kube-controllers:v3.25.0
${REGISTRY}/rancher/mirrored-calico-typha:v3.25.0
${REGISTRY}/rancher/mirrored-calico-node:v3.25.0
${REGISTRY}/rancher/mirrored-calico-pod2daemon-flexvol:v3.25.0
${REGISTRY}/rancher/mirrored-calico-cni:v3.25.0
${REGISTRY}/rancher/mirrored-calico-apiserver:v3.25.0
${REGISTRY}/rancher/mirrored-calico-operator:v1.30.4
${REGISTRY}/rancher/mirrored-calico-ctl:v3.26.1
${REGISTRY}/rancher/mirrored-calico-kube-controllers:v3.26.1
${REGISTRY}/rancher/mirrored-calico-typha:v3.26.1
${REGISTRY}/rancher/mirrored-calico-node:v3.26.1
${REGISTRY}/rancher/mirrored-calico-pod2daemon-flexvol:v3.26.1
${REGISTRY}/rancher/mirrored-calico-cni:v3.26.1
${REGISTRY}/rancher/mirrored-calico-apiserver:v3.26.1
EOF

xargs -n1 -t docker image pull --quiet << EOF > build/images-vsphere.txt
Expand All @@ -71,7 +71,7 @@ xargs -n1 -t docker image pull --quiet << EOF > build/images-vsphere.txt
EOF

xargs -n1 -t docker image pull --quiet << EOF > build/images-multus.txt
${REGISTRY}/rancher/hardened-multus-cni:v3.9.3-build20230109
${REGISTRY}/rancher/hardened-multus-cni:v4.0.2-build20230707
${REGISTRY}/rancher/hardened-cni-plugins:v1.2.0-build20230523
${REGISTRY}/rancher/hardened-sriov-network-operator:v1.2.0-build20230607
${REGISTRY}/rancher/hardened-sriov-network-config-daemon:v1.2.0-build20230607
Expand Down
8 changes: 4 additions & 4 deletions tests/acceptance/core/service/assert/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ func NodeAssertVersionTypeUpgrade(installType customflag.FlagConfig) NodeAssertF
fmt.Printf("Asserting Version: %s\n", version[1])
return func(g Gomega, node shared.Node) {
g.Expect(node.Version).Should(Equal(version[1]),
"Nodes should all be upgraded to the specified version", node.Name)
"ParseNodes should all be upgraded to the specified version", node.Name)
}
}
upgradedVersion := shared.GetRke2Version()
fmt.Printf("Asserting Commit: %s\n Version: %s", version[1], upgradedVersion)
return func(g Gomega, node shared.Node) {
g.Expect(upgradedVersion).Should(ContainSubstring(node.Version),
"Nodes should all be upgraded to the specified commit", node.Name)
"ParseNodes should all be upgraded to the specified commit", node.Name)
}
}

Expand All @@ -43,15 +43,15 @@ func NodeAssertVersionTypeUpgrade(installType customflag.FlagConfig) NodeAssertF
func NodeAssertVersionUpgraded() NodeAssertFunc {
return func(g Gomega, node shared.Node) {
g.Expect(&customflag.ServiceFlag.UpgradeVersionSUC).Should(ContainSubstring(node.Version),
"Nodes should all be upgraded to the specified version", node.Name)
"ParseNodes should all be upgraded to the specified version", node.Name)
}
}

// NodeAssertReadyStatus custom assertion func that asserts that the node is in Ready state.
func NodeAssertReadyStatus() NodeAssertFunc {
return func(g Gomega, node shared.Node) {
g.Expect(node.Status).Should(Equal("Ready"),
"Nodes should all be in Ready state")
"ParseNodes should all be in Ready state")
}
}

Expand Down
4 changes: 1 addition & 3 deletions tests/acceptance/core/service/template/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (

"github.com/rancher/rke2/tests/acceptance/core/testcase"
"github.com/rancher/rke2/tests/acceptance/shared"

. "github.com/onsi/ginkgo/v2"
)

// upgradeVersion upgrades the version of RKE2 and updates the expected values
Expand All @@ -30,7 +28,7 @@ func upgradeVersion(template VersionTestTemplate, version string) error {
func checkVersion(v VersionTestTemplate) error {
ips, err := getIPs()
if err != nil {
GinkgoT().Errorf("Failed to get IPs: %s", err)
return fmt.Errorf("failed to get IPs: %v", err)
}

var wg sync.WaitGroup
Expand Down
3 changes: 2 additions & 1 deletion tests/acceptance/core/service/template/versiontemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"fmt"
"strings"

. "github.com/onsi/ginkgo/v2"
"github.com/rancher/rke2/tests/acceptance/core/service/customflag"
"github.com/rancher/rke2/tests/acceptance/shared"

. "github.com/onsi/ginkgo/v2"
)

// VersionTemplate is a template for testing RKE2 versions + test cases and upgrading cluster if needed
Expand Down
4 changes: 2 additions & 2 deletions tests/acceptance/core/testcase/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ func TestDaemonset(deployWorkload bool) {
Expect(err).NotTo(HaveOccurred(),
"Daemonset manifest not deployed")

nodes, _ := shared.Nodes(false)
pods, _ := shared.Pods(false)
nodes, _ := shared.ParseNodes(false)
pods, _ := shared.ParsePods(false)

Eventually(func(g Gomega) {
count := shared.CountOfStringInSlice("test-daemonset", pods)
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/core/testcase/ingressdns.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestIngress(deployWorkload bool) {
GinkgoT().Errorf("Error: %v", err)
}

nodes, err := shared.Nodes(false)
nodes, err := shared.ParseNodes(false)
Expect(err).NotTo(HaveOccurred())

Eventually(func(Gomega) bool {
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/core/testcase/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestNodeStatus(

expectedNodeCount := cluster.NumServers + cluster.NumAgents
Eventually(func(g Gomega) {
nodes, err := shared.Nodes(false)
nodes, err := shared.ParseNodes(false)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(len(nodes)).To(Equal(expectedNodeCount),
"Number of nodes should match the spec")
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/core/testcase/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestPodStatus(
fmt.Printf("\nFetching pod status\n")

Eventually(func(g Gomega) {
pods, err := shared.Pods(false)
pods, err := shared.ParsePods(false)
g.Expect(err).NotTo(HaveOccurred())

for _, pod := range pods {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ var _ = Describe("Test:", func() {
testcase.TestBuildCluster(GinkgoT(), false)
})

It("Validate Nodes", func() {
It("Validate ParseNodes", func() {
testcase.TestNodeStatus(
assert.NodeAssertReadyStatus(),
nil,
)
})

It("Validate Pods", func() {
It("Validate ParsePods", func() {
testcase.TestPodStatus(
assert.PodAssertRestart(),
assert.PodAssertReady(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ var _ = Describe("Test:", func() {
testcase.TestBuildCluster(GinkgoT(), false)
})

It("Validate Nodes", func() {
It("Validate ParseNodes", func() {
testcase.TestNodeStatus(
assert.NodeAssertReadyStatus(),
nil,
)
})

It("Validate Pods", func() {
It("Validate ParsePods", func() {
testcase.TestPodStatus(
assert.PodAssertRestart(),
assert.PodAssertReady(),
Expand Down
4 changes: 2 additions & 2 deletions tests/acceptance/entrypoint/upgradecluster/upgradesuc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ var _ = Describe("SUC Upgrade Tests:", func() {
testcase.TestBuildCluster(GinkgoT(), false)
})

It("Validate Nodes", func() {
It("Validate ParseNodes", func() {
testcase.TestNodeStatus(
assert.NodeAssertReadyStatus(),
nil,
)
})

It("Validate Pods", func() {
It("Validate ParsePods", func() {
testcase.TestPodStatus(
assert.PodAssertRestart(),
assert.PodAssertReady(),
Expand Down
8 changes: 4 additions & 4 deletions tests/acceptance/shared/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ func FetchIngressIP(namespace string) ([]string, error) {
return ingressIPs, nil
}

// Nodes returns nodes parsed from kubectl get nodes.
func Nodes(print bool) ([]Node, error) {
// ParseNodes returns nodes parsed from kubectl get nodes.
func ParseNodes(print bool) ([]Node, error) {
nodes := make([]Node, 0, 10)

cmd := "kubectl get nodes --no-headers -o wide --kubeconfig=" + KubeConfigFile
Expand Down Expand Up @@ -249,8 +249,8 @@ func Nodes(print bool) ([]Node, error) {
return nodes, nil
}

// Pods returns pods parsed from kubectl get pods.
func Pods(print bool) ([]Pod, error) {
// ParsePods returns pods parsed from kubectl get pods.
func ParsePods(print bool) ([]Pod, error) {
pods := make([]Pod, 0, 10)

cmd := "kubectl get pods -o wide --no-headers -A --kubeconfig=" + KubeConfigFile
Expand Down

0 comments on commit 187f253

Please sign in to comment.