Skip to content

Commit d59200a

Browse files
committed
semver template: update examples to use lower camel case
changes to the way we unmarshal meta blobs dictate that (at least the meta) fields use lower camel case for their keys. This PR updates examples and tests to use all lower camel case keys. Thankfully, the demo gifs in the semver template README already use lower camel case so there is no need to regenerate them.
1 parent c728adf commit d59200a

File tree

2 files changed

+40
-42
lines changed

2 files changed

+40
-42
lines changed

alpha/template/composite/builder_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -715,12 +715,12 @@ func TestSemverBuilder(t *testing.T) {
715715
}
716716

717717
const semverYaml = `---
718-
Schema: olm.semver
719-
GenerateMajorChannels: true
720-
GenerateMinorChannels: true
721-
Stable:
722-
Bundles:
723-
- Image: quay.io/olmtest/webhook-operator-bundle:0.0.3
718+
schema: olm.semver
719+
generateMajorChannels: true
720+
generateMinorChannels: true
721+
stable:
722+
bundles:
723+
- image: quay.io/olmtest/webhook-operator-bundle:0.0.3
724724
`
725725

726726
const semverBuiltFbcYaml = `---

alpha/template/semver/README.md

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,42 @@ The `semver template` must have:
1515
The resulting FBC must clearly indicate how generated channels relate to template entities
1616

1717
### Schema Anatomy
18-
For convenience and simplicity, this template currently supports hard-coded channel names `Candidate`, `Fast`, and `Stable`, in order of increasing channel stability. We leverage this relationship to calculate the default channel for the package.
18+
For convenience and simplicity, this template currently supports hard-coded channel names `candidate`, `fast`, and `stable`, in order of increasing channel stability. We leverage this relationship to calculate the default channel for the package.
1919

20-
`GenerateMajorChannels` and `GenerateMinorChannels` dictate whether this template will generate X-stream or Y-stream channels (attributes can be set independently). If omitted, only minor (Y-stream) channels will be generated.
20+
`generateMajorChannels` and `generateMinorChannels` dictate whether this template will generate X-stream or Y-stream channels (attributes can be set independently). If omitted, only minor (Y-stream) channels will be generated.
2121

2222
Under each channel are a list of bundle image references which contribute to that channel.
2323

2424
With the following (hypothetical) example we define a mock bundle which has 11 versions, represented across each of the channel types:
2525
```yaml
26-
Schema: olm.semver
27-
GenerateMajorChannels: true
28-
GenerateMinorChannels: true
29-
Candidate:
30-
Bundles:
31-
- Image: quay.io/foo/olm:testoperator.v0.1.0
32-
- Image: quay.io/foo/olm:testoperator.v0.1.1
33-
- Image: quay.io/foo/olm:testoperator.v0.1.2
34-
- Image: quay.io/foo/olm:testoperator.v0.1.3
35-
- Image: quay.io/foo/olm:testoperator.v0.2.0
36-
- Image: quay.io/foo/olm:testoperator.v0.2.1
37-
- Image: quay.io/foo/olm:testoperator.v0.2.2
38-
- Image: quay.io/foo/olm:testoperator.v0.3.0
39-
- Image: quay.io/foo/olm:testoperator.v1.0.0
40-
- Image: quay.io/foo/olm:testoperator.v1.0.1
41-
- Image: quay.io/foo/olm:testoperator.v1.1.0
42-
Fast:
43-
Bundles:
44-
- Image: quay.io/foo/olm:testoperator.v0.2.1
45-
- Image: quay.io/foo/olm:testoperator.v0.2.2
46-
- Image: quay.io/foo/olm:testoperator.v0.3.0
47-
- Image: quay.io/foo/olm:testoperator.v1.0.1
48-
- Image: quay.io/foo/olm:testoperator.v1.1.0
49-
Stable:
50-
Bundles:
51-
- Image: quay.io/foo/olm:testoperator.v1.0.1
26+
schema: olm.semver
27+
generateMajorChannels: true
28+
generateMinorChannels: true
29+
candidate:
30+
bundles:
31+
- image: quay.io/foo/olm:testoperator.v0.1.0
32+
- image: quay.io/foo/olm:testoperator.v0.1.1
33+
- image: quay.io/foo/olm:testoperator.v0.1.2
34+
- image: quay.io/foo/olm:testoperator.v0.1.3
35+
- image: quay.io/foo/olm:testoperator.v0.2.0
36+
- image: quay.io/foo/olm:testoperator.v0.2.1
37+
- image: quay.io/foo/olm:testoperator.v0.2.2
38+
- image: quay.io/foo/olm:testoperator.v0.3.0
39+
- image: quay.io/foo/olm:testoperator.v1.0.0
40+
- image: quay.io/foo/olm:testoperator.v1.0.1
41+
- image: quay.io/foo/olm:testoperator.v1.1.0
42+
fast:
43+
bundles:
44+
- image: quay.io/foo/olm:testoperator.v0.2.1
45+
- image: quay.io/foo/olm:testoperator.v0.2.2
46+
- image: quay.io/foo/olm:testoperator.v0.3.0
47+
- image: quay.io/foo/olm:testoperator.v1.0.1
48+
- image: quay.io/foo/olm:testoperator.v1.1.0
49+
stable:
50+
bundles:
51+
- image: quay.io/foo/olm:testoperator.v1.0.1
5252
```
53-
In this example, `Candidate` has the entire version range of bundles, `Fast` has a mix of older and more-recent versions, and `Stable` channel only has a single published entry.
53+
In this example, `candidate` has the entire version range of bundles, `fast` has a mix of older and more-recent versions, and `stable` channel only has a single published entry.
5454

5555
### CLI Tool Usage
5656
```
@@ -85,7 +85,7 @@ Note that if the command is called without a file argument and nothing passed in
8585
the command will hang indefinitely. Either a file argument or file information passed
8686
in on standard input is required by the command.
8787
88-
With the template attribute `GenerateMajorChannels: true` resulting major channels from the command are (filtering out `olm.bundle` content):
88+
With the template attribute `generateMajorChannels: true` resulting major channels from the command are (filtering out `olm.bundle` content):
8989
```yaml
9090
---
9191
defaultChannel: stable-v1
@@ -165,10 +165,10 @@ package: testoperator
165165
schema: olm.channel
166166
```
167167

168-
We generated a channel for each template channel entity corresponding to each of the 0.\#.\#, 1.\#.\# major version ranges with skips to the head of the highest semver in a channel. We also generated a replaces edge to traverse across minor version transitions within each major channel. Finally, we generated an `olm.package` object, setting as default the most-stable channel head we created. This process will prefer `Stable` channel over `Fast`, over `Candidate` and then a higher bundle version over a lower version.
168+
We generated a channel for each template channel entity corresponding to each of the 0.\#.\#, 1.\#.\# major version ranges with skips to the head of the highest semver in a channel. We also generated a replaces edge to traverse across minor version transitions within each major channel. Finally, we generated an `olm.package` object, setting as default the most-stable channel head we created. This process will prefer `stable` channel over `fast`, over `candidate` and then a higher bundle version over a lower version.
169169
(Please note that the naming of the generated channels indicates the digits of significance for that channel. For example, `fast-v1` is a decomposed channel of the `fast` type which contains only major versions of contributing bundles matching `v1`.)
170170

171-
For contrast, with the template attribute `GenerateMinorChannels: true` and running the command again (again skipping rendered bundle image output) we get a bunch more channels:
171+
For contrast, with the template attribute `generateMinorChannels: true` and running the command again (again skipping rendered bundle image output) we get a bunch more channels:
172172
```yaml
173173
---
174174
defaultChannel: stable-v1.0
@@ -278,9 +278,7 @@ Here, a channel is generated for each template channel which differs by minor ve
278278
### DEMOS
279279

280280
#### Major Channel Generation
281-
![`GenerateMajorChannels`](./major-version-demo.gif)
281+
![`generateMajorChannels`](./major-version-demo.gif)
282282

283283
#### Minor Channel Generation
284-
![`GenerateMinorChannels`](./minor-version-demo.gif)
285-
286-
284+
![`generateMinorChannels`](./minor-version-demo.gif)

0 commit comments

Comments
 (0)