github.com/wmuizelaar/kpt@v0.0.0-20221018115725-bd564717b2ed/site/book/08-package-orchestration/05-package-lifecycle.md (about) 1 When a new package revision is created, it is in a **`Draft`** lifecycle stage, 2 where the package can be authored, including updating its contents. 3 4 Before a package can be deployed or cloned, it must be **`Published`**. 5 The approval flow is the process by which the package is advanced from 6 **`Draft`** to **`Proposed`** and finally **`Published`** lifecycle stage. 7 8 In the [previous section](./04-package-authoring) we created several packages, 9 let's explore how to publish some of them. 10 11 ```sh 12 # List package revisions (the output was abbreviated to only include Draft) 13 # packages 14 $ kpt alpha rpkg get 15 NAME PACKAGE REVISION LATEST LIFECYCLE REPOSITORY 16 deployments-eeb52a8072ca2602e7ee27f3c56ad6344b024f5b istions v1 false Draft deployments 17 deployments-8baf4892d6bdeda0f26ef4b1088fddb85c5a2486 my-bucket v1 false Draft deployments 18 deployments-93bb9ac8c2fb7a5759547a38f5f48b369f42d08a new-package v2 false Draft deployments 19 ... 20 ``` 21 22 Now, in the role of the package author, we will propose two of those packages 23 to be published: `istions/v1` and `my-bucket/v2`. 24 25 ```sh 26 # Propose two package revisions to be be published 27 $ kpt alpha rpkg propose \ 28 deployments-eeb52a8072ca2602e7ee27f3c56ad6344b024f5b \ 29 deployments-8baf4892d6bdeda0f26ef4b1088fddb85c5a2486 \ 30 -ndefault 31 32 deployments-eeb52a8072ca2602e7ee27f3c56ad6344b024f5b proposed 33 deployments-8baf4892d6bdeda0f26ef4b1088fddb85c5a2486 proposed 34 ``` 35 36 ?> Refer to the [propose command reference][rpkg-propose] for usage. 37 38 The two package revisions are now **`Proposed`**: 39 40 ```sh 41 # Confirm the package revisions are now Proposed (the output was abbreviated 42 # to only show relevant packages) 43 $ kpt alpha rpkg get 44 NAME PACKAGE REVISION LATEST LIFECYCLE REPOSITORY 45 deployments-eeb52a8072ca2602e7ee27f3c56ad6344b024f5b istions v1 false Proposed deployments 46 deployments-8baf4892d6bdeda0f26ef4b1088fddb85c5a2486 my-bucket v1 false Proposed deployments 47 deployments-93bb9ac8c2fb7a5759547a38f5f48b369f42d08a new-package v2 false Draft deployments 48 ... 49 ``` 50 51 At this point, a person in the _platform administrator_ role, or even an 52 automated process, will review and either approve or reject the proposals. 53 To aid with the decision, the platform administrator may inspect the package 54 contents using the commands above, such as `kpt alpha rpkg pull`. 55 56 ```sh 57 # Approve a proposal to publish istions/v1 58 $ kpt alpha rpkg approve deployments-eeb52a8072ca2602e7ee27f3c56ad6344b024f5b -ndefault 59 deployments-eeb52a8072ca2602e7ee27f3c56ad6344b024f5b approved 60 61 # Reject a proposal to publish a my-bucket/v1 62 $ kpt alpha rpkg reject deployments-8baf4892d6bdeda0f26ef4b1088fddb85c5a2486 -ndefault 63 deployments-8baf4892d6bdeda0f26ef4b1088fddb85c5a2486 rejected 64 ``` 65 66 ?> Refer to the [approve][rpkg-approve] and [reject][rpkg-reject] command 67 reference for usage. 68 69 Now, confirm lifecycle stages of the package revisions: 70 71 ```sh 72 # Confirm package revision lifecycle stages after approvals (output was 73 # abbreviated to display only relevant package revisions): 74 $ kpt alpha rpkg get 75 NAME PACKAGE REVISION LATEST LIFECYCLE REPOSITORY 76 deployments-98bc9a49246a5bd0f4c7a82f3d07d0d2d1293cd0 istions main false Published deployments 77 deployments-eeb52a8072ca2602e7ee27f3c56ad6344b024f5b istions v1 true Published deployments 78 deployments-8baf4892d6bdeda0f26ef4b1088fddb85c5a2486 my-bucket v1 false Draft deployments 79 deployments-93bb9ac8c2fb7a5759547a38f5f48b369f42d08a new-package v2 false Draft deployments 80 ... 81 ``` 82 83 The rejected proposal returned the package to **`Draft`**, and the approved 84 proposal resulted in **`Published`** package revision. 85 86 You may have noticed that a `main` revision of the istions package appeared. 87 When a package is approved, Porch will commit it into the branch which was 88 provided at the repository registration (`main` in this case) and apply a tag. 89 As a result, the package revision exists in two locations - tag, and the `main` 90 branch. 91 92 [rpkg-propose]: /reference/cli/alpha/rpkg/propose/ 93 [rpkg-approve]: /reference/cli/alpha/rpkg/approve/ 94 [rpkg-reject]: /reference/cli/alpha/rpkg/reject/