Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ kustomize_test/
tools/codegen/boilerplate.go.txt

.checksum.code
.checksum.mod
.checksum.mod

cache/
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- (Feature) (Platform) Do not require LM during install commands
- (Feature) (Platform) ArangoRoute Redirect
- (Feature) (Platform) Request ID & Header Standardization
- (Feature) (Platform) Install multi type support

## [1.3.1](https://github.com/arangodb/kube-arangodb/tree/1.3.1) (2025-10-07)
- (Documentation) Add ArangoPlatformStorage Docs & Examples
Expand Down
87 changes: 87 additions & 0 deletions docs/platform.install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
layout: page
parent: ArangoDBPlatform
title: Platform Installation File Schema
---

# Installation Definition

## Example

```yaml
packages:
nginx: # OCI
chart: "oci://ghcr.io/nginx/charts/nginx-ingress:2.3.1"
version: 2.3.1
prometheus: # Helm Index
chart: "index://prometheus-community.github.io/helm-charts"
version: 1.3.1
alertmanager: # Remote Chart
chart: "https://github.com/prometheus-community/helm-charts/releases/download/alertmanager-0.1.0/alertmanager-0.1.0.tgz"
version: "0.1.0"
local: # Local File
chart: "file:///tmp/local-0.1.0.tgz"
version: "0.1.0"
inline: # Inline
chart: "<base64 string>"
version: "0.2.5"
platform: # Platform LicenseManager
version: v3.0.11
```

## Package

### .package.packages.\<string\>.chart

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.1/pkg/util/k8sutil/helm/package.go#L87)</sup>

Chart defines override of the PackageSpec
It supports multiple modes:
- If undefined, LicenseManager OCI Repository is used
- If starts with `file://` chart is fetched from local FileSystem
- If starts with `http://` or `https://` chart is fetched from the remote URL
- If starts with `index://` chart is fetched using Helm YAML Index File structure (using version and name)
- If Starts with `oci://` chart is fetched from Registry Compatible OCI Repository
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same spelling inconsistency appears in the documentation: "If Starts with oci://" should be "If starts with oci://" (lowercase 's' to match lines 42-43).

Suggested change
- If Starts with `oci://` chart is fetched from Registry Compatible OCI Repository
- If starts with `oci://` chart is fetched from Registry Compatible OCI Repository

Copilot uses AI. Check for mistakes.
- If none above match, chart is decoded using Base64 encoding

***

### .package.packages.\<string\>.overrides

Type: `Object` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.1/pkg/util/k8sutil/helm/package.go#L91)</sup>

Overrides defines Values to override the Helm Chart Defaults (merged with Service Overrides)

***

### .package.packages.\<string\>.stage

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.1/pkg/util/k8sutil/helm/package.go#L74)</sup>

Stage defines stage used in the fetch from LicenseManager

***

### .package.packages.\<string\>.version

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.1/pkg/util/k8sutil/helm/package.go#L77)</sup>

Version keeps the version of the PackageSpec

***

### .package.releases.\<string\>.overrides

Type: `Object` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.1/pkg/util/k8sutil/helm/package.go#L171)</sup>

Overrides defines Values to override the Helm Chart Defaults during installation

***

### .package.releases.\<string\>.package

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.1/pkg/util/k8sutil/helm/package.go#L167)</sup>

Package keeps the name of the Chart used from the installation script.
References to value provided in Packages

12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ require (
github.com/prometheus/prom2json v1.3.3
github.com/robfig/cron v1.2.0
github.com/rs/zerolog v1.33.0
github.com/spf13/cobra v1.9.1
github.com/spf13/pflag v1.0.6
github.com/spf13/cobra v1.10.1
github.com/spf13/pflag v1.0.10
github.com/stretchr/testify v1.10.0
golang.org/x/sync v0.17.0
golang.org/x/sys v0.37.0
golang.org/x/sys v0.38.0
golang.org/x/text v0.30.0
golang.org/x/time v0.11.0
google.golang.org/genproto/googleapis/rpc v0.0.0-20251022142026-3a174f9686a8
Expand All @@ -84,7 +84,7 @@ require (
github.com/golang-jwt/jwt/v5 v5.2.2
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1
github.com/jedib0t/go-pretty/v6 v6.6.5
github.com/regclient/regclient v0.8.3
github.com/regclient/regclient v0.10.0
golang.org/x/oauth2 v0.30.0
google.golang.org/api v0.235.0
google.golang.org/genproto/googleapis/api v0.0.0-20250804133106-a7a43d27e69b
Expand Down Expand Up @@ -181,7 +181,7 @@ require (
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kkdai/maglev v0.2.0 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/compress v1.18.1 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
Expand Down Expand Up @@ -223,7 +223,7 @@ require (
github.com/stretchr/objx v0.5.2 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/ulikunitz/xz v0.5.12 // indirect
github.com/ulikunitz/xz v0.5.15 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
Expand Down
13 changes: 13 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ github.com/kkdai/maglev v0.2.0 h1:w6DCW0kAA6fstZqXkrBrlgIC3jeIRXkjOYea/m6EK/Y=
github.com/kkdai/maglev v0.2.0/go.mod h1:d+mt8Lmt3uqi9aRb/BnPjzD0fy+ETs1vVXiGRnqHVZ4=
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
github.com/klauspost/compress v1.18.1 h1:bcSGx7UbpBqMChDtsF28Lw6v/G94LPrrbMbdC3JH2co=
github.com/klauspost/compress v1.18.1/go.mod h1:ZQFFVG+MdnR0P+l6wpXgIL4NTtwiKIdBnrBd8Nrxr+0=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk=
github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
Expand Down Expand Up @@ -456,6 +458,8 @@ github.com/prometheus/prom2json v1.3.3 h1:IYfSMiZ7sSOfliBoo89PcufjWO4eAR0gznGcET
github.com/prometheus/prom2json v1.3.3/go.mod h1:Pv4yIPktEkK7btWsrUTWDDDrnpUrAELaOCj+oFwlgmc=
github.com/regclient/regclient v0.8.3 h1:AFAPu/vmOYGyY22AIgzdBUKbzH+83lEpRioRYJ/reCs=
github.com/regclient/regclient v0.8.3/go.mod h1:gjQh5uBVZoo/CngchghtQh9Hx81HOMKRRDd5WPcPkbk=
github.com/regclient/regclient v0.10.0 h1:V+mbcd/PBwQkd89M2KAPAAC1qMyrw9f5BKvCtPgw/C8=
github.com/regclient/regclient v0.10.0/go.mod h1:fDYvRK2yFUE7pyEXKj+jKzTAtuwXsGQ6Tr0KPvxwP00=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ=
Expand All @@ -480,8 +484,13 @@ github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w=
github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=
github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spiffe/go-spiffe/v2 v2.5.0 h1:N2I01KCUkv1FAjZXJMwh95KK1ZIQLYbPfhaxw8WS0hE=
github.com/spiffe/go-spiffe/v2 v2.5.0/go.mod h1:P+NxobPc6wXhVtINNtFjNWGBTreew1GBUCwT2wPmb7g=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand All @@ -496,6 +505,8 @@ github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4d
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc=
github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/ulikunitz/xz v0.5.15 h1:9DNdB5s+SgV3bQ2ApL10xRc35ck0DuIX/isZvIk+ubY=
github.com/ulikunitz/xz v0.5.15/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
Expand Down Expand Up @@ -588,6 +599,8 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ=
golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/term v0.36.0 h1:zMPR+aF8gfksFprF/Nc/rd1wRS1EI6nDBGyWAvDzx2Q=
golang.org/x/term v0.36.0/go.mod h1:Qu394IJq6V6dCBRgwqshf3mPF85AqzYEzofzRdZkWss=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
109 changes: 77 additions & 32 deletions internal/docs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ package internal

import (
"bufio"
"bytes"
"fmt"
"go/ast"
"go/token"
Expand Down Expand Up @@ -51,16 +50,15 @@ import (
schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1"
storageApi "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha"
"github.com/arangodb/kube-arangodb/pkg/util"
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/helm"
)

const (
// title of docs/api/README.md page
apiIndexPageTitle = "CRD reference"
)

func (d DocDefinitions) RenderMarkdown(t *testing.T, repositoryPath string) []byte {
out := bytes.NewBuffer(nil)

func (d DocDefinitions) RenderMarkdown(t *testing.T, out io.Writer, repositoryPath string) {
els := 0

for _, el := range d {
Expand Down Expand Up @@ -189,8 +187,55 @@ func (d DocDefinitions) RenderMarkdown(t *testing.T, repositoryPath string) []by
}
}
}
}

func Test_GenerateSecondaryAPIDocs(t *testing.T) {
root := os.Getenv("ROOT")
require.NotEmpty(t, root)

fset := token.NewFileSet()

fields := parseSourceFiles(t, root, fset, path.Join(root, "pkg/util/k8sutil/helm"))

return out.Bytes()
out, err := os.OpenFile(path.Join(root, "docs/platform.install.md"), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
require.NoError(t, err)

defer func() {
require.NoError(t, out.Close())
}()

writeFrontMatter(t, out, map[string]string{
"layout": "page",
"title": "Platform Installation File Schema",
"parent": "ArangoDBPlatform",
})
writef(t, out, "# Installation Definition\n\n")
writef(t, out, "## Example\n\n")
writef(t, out, "```yaml\n")
writef(t, out, `packages:
nginx: # OCI
chart: "oci://ghcr.io/nginx/charts/nginx-ingress:2.3.1"
version: 2.3.1
prometheus: # Helm Index
chart: "index://prometheus-community.github.io/helm-charts"
version: 1.3.1
alertmanager: # Remote Chart
chart: "https://github.com/prometheus-community/helm-charts/releases/download/alertmanager-0.1.0/alertmanager-0.1.0.tgz"
version: "0.1.0"
local: # Local File
chart: "file:///tmp/local-0.1.0.tgz"
version: "0.1.0"
inline: # Inline
chart: "<base64 string>"
version: "0.2.5"
platform: # Platform LicenseManager
version: v3.0.11
`)
writef(t, out, "```\n\n")

generateDocsOut(t, "Package", map[string]interface{}{
"Package": helm.Package{},
}, fields, fset, out)
}

func Test_GenerateAPIDocs(t *testing.T) {
Expand Down Expand Up @@ -503,59 +548,59 @@ func prepareGitHubTreePath(t *testing.T, root string) string {
return fmt.Sprintf("https://github.com/arangodb/kube-arangodb/blob/%s", ref)
}

func generateDocs(t *testing.T, objects map[string]map[string]interface{}, fields map[string]*ast.Field, fs *token.FileSet) map[string]string {
func generateDocsOut(t *testing.T, objectName string, sections map[string]interface{}, fields map[string]*ast.Field, fs *token.FileSet, out io.Writer) {
root := os.Getenv("ROOT")
require.NotEmpty(t, root)

outPaths := make(map[string]string)

repositoryPath := prepareGitHubTreePath(t, root)

for objectName, sections := range objects {
t.Run(objectName, func(t *testing.T) {
renderSections := map[string][]byte{}
for section, fieldInstance := range sections {
t.Run(section, func(t *testing.T) {
t.Run(objectName, func(t *testing.T) {
for _, section := range util.SortKeys(sections) {
writef(t, out, "## %s\n\n", util.BoolSwitch(section == "", "Object", section))

sectionParsed := iterateOverObject(t, fields, "", goStrings.ToLower(section), reflect.TypeOf(fieldInstance), "")
t.Run(section, func(t *testing.T) {
fieldInstance := sections[section]

defs := make(DocDefinitions, 0, len(sectionParsed))
for _, el := range sectionParsed {
defs = append(defs, parseDocDefinition(t, root, cleanPrefixPath(el.K.path), el.K.typ, el.K, el.V, fs))
}
defs.Sort()
sectionParsed := iterateOverObject(t, fields, "", goStrings.ToLower(section), reflect.TypeOf(fieldInstance), "")

renderSections[section] = defs.RenderMarkdown(t, repositoryPath)
})
}
defs := make(DocDefinitions, 0, len(sectionParsed))
for _, el := range sectionParsed {
defs = append(defs, parseDocDefinition(t, root, cleanPrefixPath(el.K.path), el.K.typ, el.K, el.V, fs))
}
defs.Sort()

defs.RenderMarkdown(t, out, repositoryPath)
})
}
})
}

fileName := fmt.Sprintf("%s.md", objectName)
outPaths[objectName] = fileName
func generateDocs(t *testing.T, objects map[string]map[string]interface{}, fields map[string]*ast.Field, fs *token.FileSet) {
root := os.Getenv("ROOT")
require.NotEmpty(t, root)

for objectName, sections := range objects {
t.Run(objectName, func(t *testing.T) {
outPath := path.Join(root, "docs/api", fmt.Sprintf("%s.md", objectName))
out, err := os.OpenFile(outPath, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644)
out, err := os.OpenFile(outPath, os.O_TRUNC|os.O_WRONLY|os.O_CREATE, 0644)
require.NoError(t, err)

defer func() {
require.NoError(t, out.Close())
}()

objName := goStrings.ReplaceAll(objectName, ".", " ")

writeFrontMatter(t, out, map[string]string{
"layout": "page",
"title": objName,
"parent": apiIndexPageTitle,
})
writef(t, out, "# API Reference for %s\n\n", objName)

util.IterateSorted(renderSections, func(name string, section []byte) {
writef(t, out, "## %s\n\n", util.BoolSwitch(name == "", "Object", name))

_, err = out.Write(section)
require.NoError(t, err)
})
generateDocsOut(t, objectName, sections, fields, fs, out)
})
}
return outPaths
}

func write(t *testing.T, out io.Writer, format string) {
Expand Down
9 changes: 9 additions & 0 deletions pkg/license_manager/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ func NewClientFromConn(conn driver.Connection) Client {
}

type Client interface {
Identity(ctx context.Context) (Identity, error)

License(ctx context.Context, req LicenseRequest) (LicenseResponse, error)

Registry(ctx context.Context) (RegistryResponse, error)
Expand All @@ -92,6 +94,9 @@ type LicenseResponse struct {
Expires *ugrpc.Object[*timestamppb.Timestamp] `json:"expires,omitempty"`
}

type Identity struct {
}

type RegistryResponse struct {
Token string `json:"token"`
}
Expand All @@ -100,6 +105,10 @@ type client struct {
conn driver.Connection
}

func (c client) Identity(ctx context.Context) (Identity, error) {
return arangod.GetRequest[Identity](ctx, c.conn, "_api", "v1", "identity").AcceptCode(200).Response()
}

func (c client) RegistryConfig(ctx context.Context, endpoint, id string, token *string, stages ...Stage) ([]byte, error) {
var t string

Expand Down
Loading