Skip to content

[dmt] feat: migrate to nelm v2 - #486

Open
fuldaxxx wants to merge 1 commit into
mainfrom
feat/nelm-v2-migrate
Open

fuldaxxx wants to merge 1 commit into
mainfrom
feat/nelm-v2-migrate

Conversation

@fuldaxxx

@fuldaxxx fuldaxxx commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Description

  • Move dmt from github.com/werf/nelm v1 to github.com/werf/nelm/v2 (v2.0.0-alpha.2, the same version Deckhouse's feat/nelm-v2-migrate branch uses) and drop the replace github.com/docker/cli => v27.1.1 directive from go.mod. dmt can be installed with go install again.
  • Bump prometheus/prometheus to v0.312.0 so it matches the prometheus/common v0.67.5 that nelm v2 pulls in. Adapt rule validation to the new API: parser.NewParser(...).ParseExpr, plus explicit model.UTF8Validation for label and metric names, which is the same scheme that was the default before.
  • Resolve the module chart path to an absolute path before rendering. nelm v2 treats any path that doesn't start with / or . as a remote chart reference, so a relative path like modules/foo was being sent to the chart downloader.
  • Keep templates-tests snapshots taken under nelm v1 valid. nelm v1 always emitted top-level metadata.labels/metadata.annotations ({} when unset) and v2 omits them, so the tester fills them in before comparing. Existing snapshots don't need to be regenerated.

Why do we need it, and what problem does it solve?

go install github.com/deckhouse/dmt/cmd/dmt@latest has been broken since v0.2.4:

➜ ~ go install github.com/deckhouse/dmt/cmd/dmt@latest
go: downloading github.com/deckhouse/dmt v0.2.5
go: github.com/deckhouse/dmt/cmd/dmt@latest (in github.com/deckhouse/dmt@v0.2.5):
The go.mod file for the module providing named packages contains one or
more replace directives. It must not contain directives that would cause
it to be interpreted differently than if it were the main module.

The cause is the docker/cli replace added in #470. deckhouse/pkg/registry pins docker/cli v29 for a CVE fix. nelm v1 depends on oras.land/oras-go v1.2.x, which doesn't compile against docker/cli v29 (its AuthConfig conversion breaks). No v1.2.x release of oras-go has a fix, and every nelm v1.x release depends on oras-go v1.2.x, so the replace couldn't be removed while dmt stayed on nelm v1.

nelm v2 uses oras-go/v2 and no longer depends on docker/cli through oras, so the replace is no longer needed:

➜ ~ go install github.com/deckhouse/dmt/cmd/dmt@e29a900bb7057eee4f2808aef1c0563680f9c635
go: downloading github.com/deckhouse/dmt v0.2.6-0.20261009070237-e29a900bb705
➜ ~

The other changes are what the nelm v2 bump requires: a matching prometheus version, absolute chart paths (v2 removed the remote-charts feature gate, so relative paths get treated as remote charts), and keeping existing snapshots compatible.

Signed-off-by: Ruslan Gorbunov <ruslan.gorbunov@flant.com>
@fuldaxxx fuldaxxx self-assigned this Oct 9, 2026
@fuldaxxx fuldaxxx added the dependencies Pull requests that update a dependency file label Oct 9, 2026
@fuldaxxx fuldaxxx changed the title chore: upgrade dependencies and preserve snapshot compatibility [dmt] chore: upgrade dependencies and preserve snapshot compatibility Oct 9, 2026
@fuldaxxx fuldaxxx changed the title [dmt] chore: upgrade dependencies and preserve snapshot compatibility [dmt] feat: migrate to nelm v2 Oct 9, 2026
@fuldaxxx
fuldaxxx requested a review from ipaqsa October 9, 2026 07:49
@fuldaxxx
fuldaxxx marked this pull request as ready for review October 9, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant