Skip to content

Commit

Permalink
Merge pull request rancher#46958 from HarrisonWAffel/2.10-windows-age…
Browse files Browse the repository at this point in the history
…nt-tls-mode

[main] Fix system agent upgrader logic for Windows nodes
  • Loading branch information
HarrisonWAffel authored Sep 6, 2024
2 parents 4bb7bab + 9a508ad commit 0d525c8
Show file tree
Hide file tree
Showing 10 changed files with 273 additions and 478 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ require (
github.com/Azure/go-autorest/autorest/adal v0.9.23
github.com/Azure/go-autorest/autorest/to v0.4.1-0.20240104002855-4c0e21ca2bbb
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2
github.com/Masterminds/semver/v3 v3.2.1
github.com/Masterminds/semver/v3 v3.3.0
github.com/Masterminds/sprig/v3 v3.2.3
github.com/aws/aws-sdk-go v1.50.38
github.com/aws/aws-sdk-go-v2 v1.30.3
Expand Down Expand Up @@ -140,7 +140,7 @@ require (
github.com/rancher/remotedialer v0.4.0
github.com/rancher/rke v1.6.0
github.com/rancher/steve v0.0.0-20240830125833-ea6c83b279c0
github.com/rancher/system-upgrade-controller/pkg/apis v0.0.0-20210727200656-10b094e30007
github.com/rancher/system-upgrade-controller/pkg/apis v0.0.0-20240301001845-4eacc2dabbde
github.com/rancher/wrangler v1.1.2
github.com/rancher/wrangler/v3 v3.0.0
github.com/robfig/cron v1.2.0
Expand Down
407 changes: 4 additions & 403 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ ENV DOCKER_MACHINE_HARVESTER_VERSION v0.6.7
ENV CATTLE_KDM_BRANCH ${CATTLE_KDM_BRANCH}
ENV HELM_VERSION v3.15.2
ENV KUSTOMIZE_VERSION v5.4.2
ENV CATTLE_WINS_AGENT_VERSION v0.4.17
ENV CATTLE_WINS_AGENT_VERSION v0.4.18-rc1
ENV CATTLE_WINS_AGENT_INSTALL_SCRIPT https://raw.githubusercontent.com/rancher/wins/${CATTLE_WINS_AGENT_VERSION}/install.ps1
ENV CATTLE_WINS_AGENT_UNINSTALL_SCRIPT https://raw.githubusercontent.com/rancher/wins/${CATTLE_WINS_AGENT_VERSION}/uninstall.ps1
ENV CATTLE_WINS_AGENT_UPGRADE_IMAGE rancher/wins:${CATTLE_WINS_AGENT_VERSION}
Expand Down
2 changes: 1 addition & 1 deletion package/windows/Dockerfile.agent
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN go build -tags "${TAGS}" -ldflags "${LDFLAGS}" -o agent.exe ./cmd/agent
FROM mcr.microsoft.com/windows/servercore:${SERVERCORE_VERSION} AS builder
SHELL ["powershell", "-NoLogo", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
# download wins
RUN $URL = 'https://github.com/rancher/wins/releases/download/v0.4.17/wins.exe'; \
RUN $URL = 'https://github.com/rancher/wins/releases/download/v0.4.18-rc1/wins.exe'; \
\
Write-Host ('Downloading Wins from {0} ...' -f $URL); \
curl.exe -sfL $URL -o c:\wins.exe; \
Expand Down
8 changes: 7 additions & 1 deletion pkg/capr/installer/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ func WindowsInstallScript(ctx context.Context, token string, envVars []corev1.En
server = fmt.Sprintf("$env:CATTLE_SERVER=\"%s\"", settings.ServerURL.Get())
}

strictVerify := "false"
if settings.AgentTLSMode.Get() == settings.AgentTLSModeStrict {
strictVerify = "true"
}

return []byte(fmt.Sprintf(`%s
%s
Expand All @@ -186,8 +191,9 @@ func WindowsInstallScript(ctx context.Context, token string, envVars []corev1.En
$env:CSI_PROXY_URL = "%s"
$env:CSI_PROXY_VERSION = "%s"
$env:CSI_PROXY_KUBELET_PATH = "C:%s/bin/kubelet.exe"
$env:STRICT_VERIFY = "%s"
Invoke-WinsInstaller @PSBoundParameters
exit 0
`, data, envVarBuf.String(), binaryURL, server, ca, token, csiProxyURL, csiProxyVersion, dataDir)), nil
`, data, envVarBuf.String(), binaryURL, server, ca, token, csiProxyURL, csiProxyVersion, dataDir, strictVerify)), nil
}
Loading

0 comments on commit 0d525c8

Please sign in to comment.