Skip to content

check admin status instead of actual status#197

Merged
iljarotar merged 15 commits into
masterfrom
fix-downports-bug
Jul 17, 2026
Merged

check admin status instead of actual status#197
iljarotar merged 15 commits into
masterfrom
fix-downports-bug

Conversation

@iljarotar

@iljarotar iljarotar commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Description

fixes #196
depends on metal-stack/metal-api#655 and metal-stack/metal-go#228

Works in test environment. How to reproduce:

On a switch, run ip l set <interface> down on some interface that has a machine connection. With latest metal-core this will cause the admin_status of that interface to be set to down. With this PR it stays up.

TODO

  • actual nic status does not recognize all down ports. We have several cases of switches where some links are down with NO-CARRIER but have a green status.
  • if admin status on switch differs from desired status in metal-api apply status from metal-api (currently configuration is skipped if config doesn't differ from previous one)

@iljarotar
iljarotar requested a review from a team as a code owner June 26, 2026 11:50
@iljarotar
iljarotar marked this pull request as draft June 26, 2026 13:14
@iljarotar
iljarotar marked this pull request as ready for review July 2, 2026 14:59
@iljarotar
iljarotar marked this pull request as draft July 3, 2026 14:53
@iljarotar iljarotar moved this to In Progress in Development Jul 13, 2026
@iljarotar
iljarotar marked this pull request as ready for review July 15, 2026 14:00
Comment thread cmd/internal/switcher/sonic/db/configdb.go Outdated

func (d *ConfigDB) SetAdminStatus(ctx context.Context, interfaceName string, adminStatus types.PortStatus) error {
if adminStatus != types.PortStatusDown && adminStatus != types.PortStatusUp {
return nil

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.

maybe return an error?

iljarotar and others added 2 commits July 16, 2026 12:48
@iljarotar
iljarotar merged commit a61ab58 into master Jul 17, 2026
1 check passed
@iljarotar
iljarotar deleted the fix-downports-bug branch July 17, 2026 10:59
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Development Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

metal-core is setting ports to admin_status: down

2 participants