talm upgrade rewrites install.image in every -f file but upgrades only the first file's nodes

オープン
#244 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
活発
技術スタック
go

調査の方向性

Start by reading the talm upgrade path around filesToProcess[0] and writeBackInstallImageToFiles, then compare it with the Long help text cited in the issue. Decide what multiple -f files mean for upgrade before changing behavior. Done means the chosen semantics and the write-back behavior are consistent, so untouched nodes are not left claiming an image they never ran.

索引モデルが issue の本文から書いたものです。

説明

area/commands area/upgrade kind/bug

talm upgrade takes its node set from the modeline of the first -f file, but the post-upgrade write-back runs over the whole list:

configFile := filesToProcess[0]                          // nodes come from here
writeBackInstallImageToFiles(filesToProcess, targetImage) // every file is rewritten

So talm upgrade -f nodes/node0.yaml -f nodes/node1.yaml upgrades node0 and then rewrites machine.install.image in both bodies. node1.yaml ends up claiming an image node1 never ran, and the next talm apply merges that claim into its config.

That is the failure the write-back was built to prevent, inverted. The help text spells out the reasoning — "without this a follow-up talm apply would merge the stale install.image over the chart-rendered new value" — which is exactly what now happens to the nodes that were never touched.

Both halves are documented in the Long help as separate sentences and never reconciled. Before changing either, the -f list needs a decided meaning for upgrade: it is not the same as for apply, where the first file anchors and the rest are side-patches.

主要言語
Go
スター
493
フォーク
23
平均マージ
5日 13時間
マージ済み PR(30日)
3

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cozystack/talm のほかの issue

cozystack/talm の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。