Skip to content

Commit

Permalink
doc: extend documentation of ConfigData object (#551)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skarlso authored Nov 9, 2024
1 parent 08db3ba commit b7b19a5
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/release_notes/v0.25.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Release v0.25.3

- docs: add documentation for config data ()
60 changes: 60 additions & 0 deletions pkg/configdata/configdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,66 @@ import (
)

// ConfigData defines configuration options.
// This data is not promoted to being a CRD, but it contains versionable properties.
// The following is an example structure of this data:
/*
apiVersion: config.ocm.software/v1alpha1
kind: ConfigData
metadata:
name: ocm-config
configuration:
defaults:
replicas: 1
rules:
- value: (( replicas ))
file: helm_release.yaml
path: spec.values.replicaCount
schema:
type: object
additionalProperties: false
properties:
replicas:
type: string
localization:
- file: helm_release.yaml
tag: spec.chart.spec.version
resource:
name: chart
- file: helm_repository.yaml
mapping:
path: spec.url
transform: |-
package main
import (
"encoding/json"
"path"
)
result: string
for x in component.resources {
if x.name == "chart" {
result: path.Dir(x.access.imageReference)
}
}
out: json.Marshal("oci://"+result)
*/
// Localization and Configuration are both provided in the same struct. This is to minimize
// duplication and having to learn multiple structures and Kubernetes Objects.
// ConfigData is not a full-fledged Kubernetes object because nothing is reconciling it
// and there is no need for the cluster to be aware of its presence. It's meant to be created
// and maintained by the Component Consumer.
// Various configuration and localization methods are available to the consumer:
// - **plain yaml substitution**
// - **cue lang** ( https://cuelang.org/ ) with a playground (https://cuelang.org/play/)
// - **strategic patch merge**
// The available Localization resource properties are:
// - **image**
// - **repository**
// - **registry**
// - **tag**.
type ConfigData struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/version/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package version

// ReleaseVersion is the version number in semver format "vX.Y.Z", prefixed with "v".
var ReleaseVersion = "v0.25.2"
var ReleaseVersion = "v0.25.3"

// ReleaseCandidate is the release candidate ID in format "rc.X", which will be appended to the release version.
var ReleaseCandidate = "rc.1"

0 comments on commit b7b19a5

Please sign in to comment.