Skip to content

Commit

Permalink
chore(example): let's limit the listed versions (#1136)
Browse files Browse the repository at this point in the history
#### What this PR does / why we need it

Why should every release require us to re-generate the samples?
  • Loading branch information
hilmarf authored Nov 25, 2024
1 parent a6bbc23 commit 30a7828
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/lib/tour/07-resource-management/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ function before finishing.
The final output of this example looks like:

```yaml
versions for component ocm.software/ocmcli: 0.1.0-alpha.2, 0.1.0-dev, 0.3.0-dev, 0.3.0-rc.2, 0.3.0-rc.3, 0.3.0, 0.4.0-dev, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.5.0, 0.6.0, 0.7.0, 0.8.0, 0.9.0, 0.10.0, 0.11.0, 0.12.0, 0.12.1, 0.13.0, 0.14.0, 0.15.0, 0.16.0, 0.16.1, 0.16.2, 0.17.0-rc.1, 0.17.0, 0.18.0-rc.1, 0.18.0-rc.2, 0.18.0
versions for component ocm.software/ocmcli: ..., 0.9.0, 0.10.0, 0.11.0, 0.12.0, 0.12.1, 0.13.0, 0.14.0, 0.15.0, 0.17.0, 0.18.0, ...
looking up resources of the latest version:
version: 0.17.0
provider: ocm.software
Expand Down
5 changes: 2 additions & 3 deletions examples/lib/tour/07-resource-management/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ import (
"strings"

"github.com/mandelsoft/goutils/errors"

"ocm.software/ocm/api/utils/blobaccess/blobaccess"

"ocm.software/ocm/api/ocm"
metav1 "ocm.software/ocm/api/ocm/compdesc/meta/v1"
"ocm.software/ocm/api/ocm/extensions/repositories/ocireg"
"ocm.software/ocm/api/utils/blobaccess/blobaccess"
"ocm.software/ocm/api/utils/semverutils"
)

Expand Down Expand Up @@ -207,6 +205,7 @@ func GatherResources(ctx ocm.Context, factory ResourceFactory) ([]Resource, erro
if err != nil {
return nil, errors.Wrapf(err, "cannot sort versions")
}
versions = []string{"...", "0.9.0", "0.10.0", "0.11.0", "0.12.0", "0.12.1", "0.13.0", "0.14.0", "0.15.0", "0.17.0", "0.18.0", "..."}
fmt.Printf("versions for component ocm.software/ocmcli: %s\n", strings.Join(versions, ", "))

// Now, we have a look at the latest version. it is
Expand Down

0 comments on commit 30a7828

Please sign in to comment.