Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .linkspector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ ignorePatterns:
- pattern: "https://github\\.com/nephio-project/porch/releases/download/.*/porchctl_.*_linux_amd64\\.tar\\.gz"
- pattern: "https://kubernetes\\.io/.*"




replacementPatterns:
- pattern: ".md#.*$"
replacement: ".md"
36 changes: 36 additions & 0 deletions content/en/docs/porch/user-guides/deprecation-of-update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: "Deprecation of update"
type: docs
weight: 4
description: ""
---

## Motivation

The PackageRevision API object was meant to represent only metadata related to a package revision, while the contents of the package revision (i.e. the YAML files) are meant to be exposed via a companion PackageRevisionResources object. However PackageRevision's spec.tasks field contains all changes applied to the contents of the package revision in the form of patches, thus the contents of the package are leaking into the object that supposed to represent only the metadata. This implies that the PackageRevision can quickly grow bigger in size, than the contents of the package it represents.
For more details, see: https://github.com/nephio-project/nephio/issues/892

## Solution

We have introduced a new first task type, called upgrade. When there is a need to update a downstream package revision to a more up to date revision of its upstream package, do not store unnecessarily the diff's between the package revisions. Instead, now we use a 3-way-merge operation, where the old upstream, new upstream and the local revision changes are merged together. The introduced 3 way merge implementation is based on the kyaml's 3-way-merge solution.
With this approach, we can reduce the task list to only one element, also we can deprecate the Patch/Eval/Update task types, since there will be no need for these. The remaining Init/Edit/Clone/Upgrade task can clearly identify the origin of a PackageRevision.
For more details, see: https://github.com/nephio-project/porch/pull/252

### Example
porchctl rpkg upgrade repository.package.1 --namespace=porch-demo --revision=2 --workspace=2
This command upgrades the package `repository.package.1` to the second version (revision=2) of its parent package.
It then creates a new package `repository.package.2` with the workspace name specified in the command (workspace=2).

### Migration guide from `update` to `upgrade`
The `upgrade` command now internally handles the functionality previously provided by:
porchctl rpkg copy --replay-strategy=true
This eliminates the need for users to manually copy a cloned package. Additionally, the `upgrade` command operates on
approved packages.

#### Previous workflow:
porchctl rpkg copy repository.package-copy.2 --namespace=porch-demo --workspace=3 --replay-strategy=true
porchctl rpkg update --discover=upstream
porchctl rpkg update porch-test.subpackage-copy.3 --namespace=porch-demo --revision=2
#### New workflow:
porchctl rpkg upgrade --discover=upstream
porchctl rpkg upgrade porch-test.subpackage-copy.2 --namespace=porch-demo --revision=2 --workspace=3
29 changes: 15 additions & 14 deletions content/en/docs/porch/user-guides/porchctl-cli-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,21 @@ The commands for administering repositories are:

The commands for administering package revisions are:

| Command | Description |
| ------------------------------ | ------------------------------------------------------------------------------------------------ |
| `porchctl rpkg approve` | Approve a proposal to publish a package revision. |
| `porchctl rpkg clone` | Create a clone of an existing package revision. |
| `porchctl rpkg copy` | Create a new package revision from an existing one. |
| `porchctl rpkg del` | Delete a package revision. |
| `porchctl rpkg get` | List package revisions in registered repositories. |
| `porchctl rpkg init` | Initializes a new package revision in a repository. |
| `porchctl rpkg propose` | Propose that a package revision should be published. |
| `porchctl rpkg propose-delete` | Propose deletion of a published package revision. |
| `porchctl rpkg pull` | Pull the content of the package revision. |
| `porchctl rpkg push` | Push resources to a package revision. |
| `porchctl rpkg reject` | Reject a proposal to publish or delete a package revision. |
| `porchctl rpkg upgrade` | Update a downstream package revision to a more recent revision of its upstream package revision. |
| Command | Description |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| `porchctl rpkg approve` | Approve a proposal to publish a package revision. |
| `porchctl rpkg clone` | Create a clone of an existing package revision. |
| `porchctl rpkg copy` | Create a new package revision from an existing one. |
| `porchctl rpkg del` | Delete a package revision. |
| `porchctl rpkg get` | List package revisions in registered repositories. |
| `porchctl rpkg init` | Initializes a new package in a repository. |
| `porchctl rpkg propose` | Propose that a package revision should be published. |
| `porchctl rpkg propose-delete` | Propose deletion of a published package revision. |
| `porchctl rpkg pull` | Pull the content of the package revision. |
| `porchctl rpkg push` | Push resources to a package revision. |
| `porchctl rpkg reject` | Reject a proposal to publish or delete a package revision. |
| `porchctl rpkg update` | Deprecated, please use the upgrade functionality instead. See: [Deprecation of update](./deprecation-of-update.md) |
| `porchctl rpkg upgrade` | Update a downstream package revision to a more recent revision of its upstream package using 3 way merge. |

## Using the porchctl CLI

Expand Down
Loading