Skip to content

chore(clsp): auto disable ztp on agent start to simplify dev - #1502

Draft
Frostman wants to merge 1 commit into
masterfrom
dev/frostman/clsp-noztp
Draft

chore(clsp): auto disable ztp on agent start to simplify dev#1502
Frostman wants to merge 1 commit into
masterfrom
dev/frostman/clsp-noztp

Conversation

@Frostman

@Frostman Frostman commented Jul 4, 2026

Copy link
Copy Markdown
Member

We need to make sure Celestica SONiC+ 5.0 works fine w/o it so we know that it doesn't break anything by running it too early

Signed-off-by: Sergei Lukianov <me@slukjanov.name>
@Frostman
Frostman requested a review from edipascale July 4, 2026 18:31
@Frostman
Frostman requested a review from a team as a code owner July 4, 2026 18:31
Copilot AI review requested due to automatic review settings July 4, 2026 18:31
@Frostman Frostman added ci:-vlab Disable VLAB tests ci:-upgrade Disable VLAB upgrade tests labels Jul 4, 2026
@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Frostman, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 43 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a603a511-4c87-46c4-ae5c-2e7df07b3258

📥 Commits

Reviewing files that changed from the base of the PR and between 823841d and 141def9.

📒 Files selected for processing (1)
  • pkg/agent/agent.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Frostman
Frostman marked this pull request as draft July 4, 2026 18:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Celestica (SONiC+) enforcement path in the agent to additionally disable ZTP when processing/applying config, aiming to simplify developer workflows on CLS+ devices.

Changes:

  • Pass the request context into enforceCelesticaState so it can be used for command timeouts/cancellation.
  • Add a sudo ztp disable --yes command execution with a 5-minute timeout during Celestica enforcement.
  • Update logging to reflect the new enforcement behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/agent/agent.go
Comment on lines +567 to +572
ctx, cancel := context.WithTimeout(ctx, 5*time.Minute)
defer cancel()

cmd := exec.CommandContext(ctx, "sudo", "ztp", "disable", "--yes")
cmd.Stdout = logutil.NewSink(ctx, slog.Debug, "ztp-disable: ")
cmd.Stderr = logutil.NewSink(ctx, slog.Debug, "ztp-disable: ")
Comment thread pkg/agent/agent.go
Comment on lines +574 to +576
if err := cmd.Run(); err != nil {
return fmt.Errorf("ztp-disable: %w", err)
}
Comment thread pkg/agent/agent.go

// temp hack to patch shadow file for admin user on Celestica SONiC+ to avoid prompt for changing password
slog.Info("Celestica SONiC+ configuration not supported, just enforcing admin password")
slog.Info("Celestica SONiC+ configuration not supported, just enforcing admin password and turning off ZTP")
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

🚀 Temp artifacts published: v0-141def98c 🚀

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

Labels

ci:-upgrade Disable VLAB upgrade tests ci:-vlab Disable VLAB tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants