Skip to content

fix: avoid root-owned kubeconfig in LSG pipeline - #4857

Open
John Payne (jpayne3506) wants to merge 2 commits into
masterfrom
jpayne/fix-lsg-kubeconfig
Open

fix: avoid root-owned kubeconfig in LSG pipeline#4857
John Payne (jpayne3506) wants to merge 2 commits into
masterfrom
jpayne/fix-lsg-kubeconfig

Conversation

@jpayne3506

Copy link
Copy Markdown
Contributor

What this changes

  • resolve the AKS Kubernetes version using the host Azure CLI (AZCLI=az) instead of the Makefile's Docker default
  • disable LTS probing for the version-only lookup
  • accept both minor-only (1.35) and patch (1.35.x) node-pool orchestrator version responses

Root cause

make -C ./hack/aks vars evaluated LTS_ARGS using the Makefile's default containerized Azure CLI. Docker bind-mounted the agent's .kube directory and created the previously absent directory as root. The later host az aks get-credentials command then failed with Permission denied: /home/cloudtest/.kube/config.

Validation

  • parsed the modified Azure Pipelines YAML
  • verified the version lookup returns K8S_VER=1.35
  • verified the lookup does not create the agent's .kube directory
  • validated the fix with CNI - LSG Integration Test run 180720465 using the original Noble kernel tuple

Resolve the AKS version with the host Azure CLI so Make does not invoke
the Docker default and create ~/.kube as root. Accept the minor-only
orchestrator version returned by AKS node pool queries.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 851648b1-fbe5-4653-a99c-d4400609bc9d
Copilot AI lite review requested due to automatic review settings September 11, 2026 19:38
@jpayne3506
John Payne (jpayne3506) requested a review from a team as a code owner September 11, 2026 19:38
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The reviewed changes address the kubeconfig issue and version-format compatibility without unresolved blocking concerns.

Pull request overview

Updates the LSG AKS pipeline to avoid root-owned kubeconfig creation and support flexible Kubernetes version responses.

Changes:

  • Uses the host Azure CLI with LTS probing disabled.
  • Accepts minor-only and patch Kubernetes versions.
  • Validates the updated pipeline behavior.
File summaries
File Summary
.pipelines/cni/lsg/lsg-cni-integration-template.yaml Updates version resolution and validation logic.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 851648b1-fbe5-4653-a99c-d4400609bc9d
Copilot AI review requested due to automatic review settings September 11, 2026 19:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Confirm or revert the LTS behavior change and align the validation error message with accepted inputs.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (1)

.pipelines/cni/lsg/lsg-cni-integration-template.yaml:89

  • The validation now also accepts an exact minor-only response, but this failure text still says only $K8S_VERSION.x is expected. A failed check for an invalid value would therefore report a condition that contradicts the acceptance logic; include both accepted forms in the message.
                  [[ "$ACTUAL_K8S_VERSION" == "$K8S_VERSION" || "$ACTUAL_K8S_VERSION" == "$K8S_VERSION".* ]] || {
                    echo "Expected Kubernetes $K8S_VERSION.x, got $ACTUAL_K8S_VERSION"
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread .pipelines/cni/lsg/lsg-cni-integration-template.yaml
@jpayne3506

Copy link
Copy Markdown
Contributor Author

/azp run Azure Container Networking PR

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants