Skip to content

Commit

Permalink
chore: generate docs versions var
Browse files Browse the repository at this point in the history
Generate documentation var files to be used
in network-operator-docs repo.

Signed-off-by: Fred Rolland <[email protected]>
  • Loading branch information
rollandf committed Jul 22, 2024
1 parent 6800708 commit 4e621f8
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,11 @@ release-build:
cd hack && $(GO) run release.go --templateDir ./templates/values/ --outputDir ../deployment/network-operator/
cd hack && $(GO) run release.go --templateDir ./templates/config/manager --outputDir ../config/manager/

.PHONY: generate-docs-versions-var
generate-docs-versions-var:
cd hack && $(GO) run release.go --templateDir ./templates/docs-versions-var/ --outputDir .
mv hack/vars.yaml hack/vars.rst

# dev environment

MINIKUBE_CLUSTER_NAME = net-op-dev
Expand Down
6 changes: 6 additions & 0 deletions hack/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ type SHA256ImageRef struct {

// Release contains versions for operator release templates.
type Release struct {
OcpDefaulChannel string
HelmChartVersion string
NetworkOperator *ReleaseImageSpec
NetworkOperatorInitContainer *ReleaseImageSpec
SriovNetworkOperator *ReleaseImageSpec
Expand Down Expand Up @@ -136,6 +138,10 @@ func main() {
if *retrieveSha {
resolveImagesSha(&release)
}
parts := strings.Split(release.NetworkOperator.Version, ".")
release.OcpDefaulChannel = fmt.Sprintf("%s.%s", parts[0], parts[1])
release.HelmChartVersion = strings.TrimPrefix(release.NetworkOperator.Version, "v")

var files []string
err := filepath.Walk(*templateDir, func(path string, info os.FileInfo, err error) error {
// Error during traversal
Expand Down
1 change: 1 addition & 0 deletions hack/release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
NetworkOperator:
image: network-operator
repository: nvcr.io/nvstaging/mellanox
version: v24.7.0-beta.2
NetworkOperatorInitContainer:
image: network-operator-init-container
repository: ghcr.io/mellanox
Expand Down
21 changes: 21 additions & 0 deletions hack/templates/docs-versions-var/vars.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. |network-operator-version| replace:: {{ .NetworkOperator.Version }}
.. |helm-chart-version| replace:: {{ .HelmChartVersion }}
.. |ocp-channel| replace:: {{ .OcpDefaulChannel }}
.. |mofed-version| replace:: {{ .Mofed.Version }}
.. |mofed-init-container-version| replace:: {{ .NetworkOperatorInitContainer.Version }}
.. |sriov-device-plugin-version| replace:: {{ .SriovDevicePlugin.Version }}
.. |k8s-rdma-shared-dev-plugin-version| replace:: {{ .RdmaSharedDevicePlugin.Version }}
.. |ib-kubernetes-version| replace:: {{ .IbKubernetes.Version }}
.. |cni-plugins-version| replace:: {{ .CniPlugins.Version }}
.. |multus-version| replace:: {{ .Multus.Version }}
.. |ipoib-cni-version| replace:: {{ .Ipoib.Version }}
.. |whereabouts-version| replace:: {{ .IpamPlugin.Version }}
.. |nvidia-ipam-version| replace:: {{ .NvIPAM.Version }}
.. |nic-feature-discovery-version| replace:: {{ .NicFeatureDiscovery.Version }}
.. |sriovnetop-version| replace:: {{ .SriovNetworkOperator.Version }}
.. |sriovnetop-sriov-cni-version| replace:: {{ .SriovCni.Version }}
.. |sriovnetop-ib-sriov-cni-version| replace:: {{ .SriovIbCni.Version }}
.. |sriovnetop-sriov-device-plugin-version| replace:: {{ .SriovDevicePlugin.Version }}
.. |doca-telemetry-version| replace:: {{ .DOCATelemetryService.Version }}
.. |node-feature-discovery-version| replace:: v0.15.6

0 comments on commit 4e621f8

Please sign in to comment.