From 67ce1b700372637050218715411984226b6ab9ef Mon Sep 17 00:00:00 2001
From: jianli-97 <lijian2@kylinos.cn>
Date: Mon, 15 Apr 2024 13:30:27 +0800
Subject: [PATCH] modify as nestos stream

---
 docs/development/os-metadata.md       | 2 +-
 src/rpm_ostree/cli_status.rs          | 2 +-
 tests/fixtures/rpm-ostree-staged.json | 4 ++--
 tests/fixtures/rpm-ostree-status.json | 2 +-
 tests/kola/server/test-stream.sh      | 6 +++---
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/docs/development/os-metadata.md b/docs/development/os-metadata.md
index a99a48b..b6edc57 100644
--- a/docs/development/os-metadata.md
+++ b/docs/development/os-metadata.md
@@ -30,7 +30,7 @@ Booted deployment must provide several mandatory metadata entries:
  * `checksum`: OSTree commit revision
  * `version`: OS version
  * under `base-commit-meta`:
-   * `fedora-coreos.stream`: update stream
+   * `nestos.stream`: update stream
 
 All those metadata entries must exist with a non-empty string value.
 
diff --git a/src/rpm_ostree/cli_status.rs b/src/rpm_ostree/cli_status.rs
index 1be93e3..68682e8 100644
--- a/src/rpm_ostree/cli_status.rs
+++ b/src/rpm_ostree/cli_status.rs
@@ -74,7 +74,7 @@ pub struct Deployment {
 /// Metadata from base commit (only fields relevant to zincati).
 #[derive(Clone, Debug, Deserialize)]
 struct BaseCommitMeta {
-    #[serde(rename = "fedora-coreos.stream")]
+    #[serde(rename = "nestos.stream")]
     stream: Option<String>,
 }
 
diff --git a/tests/fixtures/rpm-ostree-staged.json b/tests/fixtures/rpm-ostree-staged.json
index 12bac6e..7e25bad 100644
--- a/tests/fixtures/rpm-ostree-staged.json
+++ b/tests/fixtures/rpm-ostree-staged.json
@@ -9,7 +9,7 @@
         "coreos-assembler.config-dirty" : "false",
         "rpmostree.inputhash" : "77dbde3d9502f2f87757d2b68b93b52efa2c65fb7b1fc317e0ffc50b483a3a52",
         "coreos-assembler.basearch" : "x86_64",
-        "fedora-coreos.stream" : "stable",
+        "nestos.stream" : "stable",
         "version" : "31.20200517.3.0",
         "rpmostree.initramfs-args" : [
           "--add=ignition",
@@ -79,7 +79,7 @@
         "coreos-assembler.config-dirty" : "false",
         "rpmostree.inputhash" : "3efbafd926cbd112d0049aaebf5c025812229ab23fc84bd6800d959ac919b03a",
         "coreos-assembler.basearch" : "x86_64",
-        "fedora-coreos.stream" : "stable",
+        "nestos.stream" : "stable",
         "version" : "31.20200505.3.0",
         "rpmostree.initramfs-args" : [
           "--add=ignition",
diff --git a/tests/fixtures/rpm-ostree-status.json b/tests/fixtures/rpm-ostree-status.json
index 6e62cc2..ed041cc 100644
--- a/tests/fixtures/rpm-ostree-status.json
+++ b/tests/fixtures/rpm-ostree-status.json
@@ -8,7 +8,7 @@
         "coreos-assembler.config-dirty" : "true",
         "coreos-assembler.config-gitrev" : "e5ffda727170e124c7f7d8782e256b0462bf9869",
         "coreos-assembler.basearch" : "x86_64",
-        "fedora-coreos.stream" : "testing-devel",
+        "nestos.stream" : "testing-devel",
         "rpmostree.inputhash" : "0e2ba98bac847c8a8cc5ffd42822a41d53ef6719ccaf6a0094559768aa24da33",
         "version" : "30.1",
         "rpmostree.rpmmd-repos" : [
diff --git a/tests/kola/server/test-stream.sh b/tests/kola/server/test-stream.sh
index 96b1d52..f45e913 100755
--- a/tests/kola/server/test-stream.sh
+++ b/tests/kola/server/test-stream.sh
@@ -66,7 +66,7 @@ EOF
     ostree --repo=/var/www pull-local /ostree/repo "$cur_payload"
     # Create a new branch `test-branch` by creating a dummy commit.
     ostree --repo=/var/www commit --branch='test-branch' --tree ref="$cur_payload" \
-            --add-metadata-string version='dummy' --keep-metadata='fedora-coreos.stream' \
+            --add-metadata-string version='dummy' --keep-metadata='nestos.stream' \
             --keep-metadata='coreos-assembler.basearch' --parent="$cur_payload"
     # Add the OSTree repo at /var/www as a new `local` remote.
     ostree remote add --no-gpg-verify local http://localhost test-branch
@@ -75,7 +75,7 @@ EOF
     # Create a new commit on `test-branch` that has an unknown stream.
     bad_version="$cur_version".bad-update
     bad_payload="$(ostree --repo=/var/www commit --branch=test-branch --tree ref="$cur_payload" \
-                    --add-metadata-string version="$bad_version" --add-metadata-string fedora-coreos.stream='unknown-stream' \
+                    --add-metadata-string version="$bad_version" --add-metadata-string nestos.stream='unknown-stream' \
                     --keep-metadata='coreos-assembler.basearch' --parent="$cur_payload")"
 
     jq \
@@ -101,7 +101,7 @@ EOF
     # Create a new commit on `test-branch` that's on the correct stream.
     good_version="$cur_version".good-update
     good_payload="$(ostree --repo=/var/www commit --branch=test-branch --tree ref="$cur_payload" \
-                    --add-metadata-string version="$good_version" --keep-metadata='fedora-coreos.stream' \
+                    --add-metadata-string version="$good_version" --keep-metadata='nestos.stream' \
                     --keep-metadata='coreos-assembler.basearch' --parent="$cur_payload")"
 
     jq \
-- 
2.33.0

