Skip to content

Commit

Permalink
(feat): Warning users about create OSTree static deltas before rollin…
Browse files Browse the repository at this point in the history
…g out waves

Signed-off-by: Camila Macedo <[email protected]>
  • Loading branch information
Camila Macedo committed Oct 1, 2023
1 parent 823011f commit 3db8013
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion subcommands/waves/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ func init() {
This command only initializes a wave, but does not provision its updates to devices.
Use a "fioctl wave rollout <wave> <group>" to trigger updates of this wave to a device group.
Use a "fioctl wave complete <wave>" to update all devices (make it globally available).
Use a "fioctl wave cancel <wave> to cancel a wave (make it no longer available).`,
Use a "fioctl wave cancel <wave> to cancel a wave (make it no longer available).
We recommend that you generate static deltas for your production targets to optimize
the size of the update. Please, consider generating a static delta for targets using:
$ fioctl targets static-deltas.
`,
Run: doInitWave,
Args: cobra.ExactArgs(3),
Example: `
Expand Down Expand Up @@ -145,6 +150,24 @@ func doInitWave(cmd *cobra.Command, args []string) {
} else {
subcommands.DieNotNil(api.FactoryCreateWave(factory, &wave), "Failed to create a wave")
}

if !hasStaticDelta() {
fmt.Print(`
WARNING: You created a wave for a target version without static deltas.
We recommend that you generate static deltas for your production targets to optimize
the size of the update. Please, consider generating a static delta for targets using:
$ fioctl targets static-deltas.
You can then cancel this wave and create a new one for a target with a static delta.
`)

}
}

func hasStaticDelta() bool {
// TODO:
return true
}

func pruneTargets(currentTargets *client.AtsTargetsMeta, versions []string) client.AtsTargetsMeta {
Expand Down

0 comments on commit 3db8013

Please sign in to comment.