2 Commits

Author SHA1 Message Date
8c443ba402 chore(doc): regenerate the doc
All checks were successful
Go-Tests / tests (push) Successful in 2m37s
Go-Tests / sonar (push) Successful in 1m2s
2025-09-16 08:59:27 +02:00
a4647aa69a chore(code): Unecessary type checking
Changed how to use the type checking for label content.
2025-09-16 08:58:51 +02:00
4 changed files with 34 additions and 20 deletions

View File

@@ -78,7 +78,7 @@ tested some concepts.
You can help us in many ways.
- The first things we really need, more than money, more than anything else, is to have feedback. If you use Katenary,
if you have some issues, if you have some ideas, please open an issue on the [GitHub repository](https://github.com/Katenary/katenary).
if you have some issues, if you have some ideas, please open an issue on [our repository](https://repo.katenary.io/Katenary/katenary).
- The second thing is to help us to fix issues. If you're a Go developer, or if you want to fix the documentation,
your help is greatly appreciated.
- And then, of course, we need money, or sponsors.
@@ -88,6 +88,8 @@ You can help us in many ways.
We will be happy to communicate your help by putting your logo on the website and in the documentation. You can sponsor
us by giving us some money, or by giving us some time of your developers, or leaving us some time to work on the project.
Please, contact us by email at [contact at katenary dot io](mailto:contact@katenary.io).
### If you're an individual
All main contributors[^3] will be listed on the website and in the documentation.

View File

@@ -17,7 +17,7 @@ const DirectoryPermission = 0o755
```
<a name="AsResourceName"></a>
## func [AsResourceName](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L197>)
## func [AsResourceName](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L198>)
```go
func AsResourceName(name string) string
@@ -26,7 +26,7 @@ func AsResourceName(name string) string
AsResourceName returns a resource name with underscores to respect the kubernetes naming convention. It's the opposite of FixedResourceName.
<a name="Confirm"></a>
## func [Confirm](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L165>)
## func [Confirm](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L166>)
```go
func Confirm(question string, icon ...logger.Icon) bool
@@ -44,7 +44,7 @@ func CountStartingSpaces(line string) int
CountStartingSpaces counts the number of spaces at the beginning of a string.
<a name="EncodeBasicYaml"></a>
## func [EncodeBasicYaml](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L179>)
## func [EncodeBasicYaml](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L180>)
```go
func EncodeBasicYaml(data any) ([]byte, error)
@@ -53,7 +53,7 @@ func EncodeBasicYaml(data any) ([]byte, error)
EncodeBasicYaml encodes a basic yaml from an interface.
<a name="FixedResourceName"></a>
## func [FixedResourceName](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L191>)
## func [FixedResourceName](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L192>)
```go
func FixedResourceName(name string) string
@@ -152,7 +152,7 @@ func TplValue(serviceName, variable string, pipes ...string) string
TplValue returns a string that can be used in a template to access a value from the values file.
<a name="WordWrap"></a>
## func [WordWrap](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L160>)
## func [WordWrap](<https://repo.katenary.io/Katenary/katenary/blob/master/internal/utils/utils.go#L161>)
```go
func WordWrap(text string, lineWidth int) string

View File

@@ -1,7 +1,7 @@
'\" t
.\" Automatically generated by Pandoc 3.1.11.1
.\"
.TH "Katenary" "1" "2025-08-29" "mkdocs-manpage v2.0.1" "Katenary helm chart generator"
.TH "Katenary" "1" "2025-09-15" "mkdocs-manpage v2.0.1" "Katenary helm chart generator"
.SH Basic Usage
Basically, you can use \f[CR]katenary\f[R] to transpose a docker\-compose file (or any compose file compatible with \f[CR]podman\-compose\f[R] and \f[CR]docker\-compose\f[R]) to a configurable Helm Chart.
This resulting helm chart can be installed with \f[CR]helm\f[R] command to your Kubernetes cluster.
@@ -414,11 +414,11 @@ The file or directory is relative to the service directory.
.PP
If it is a directory, all files inside it are added to the ConfigMap.
.PP
If the directory as subdirectories, so one configmap per subpath are created.
If the directory as subdirectories, so one ConfigMap per sub\-path are created.
.PP
Warning
.PP
It is not intended to be used to store an entire project in configmaps.
It is not intended to be used to store an entire project in ConfigMaps.
It is intended to be used to store configuration files that are not managed by the application, like nginx configuration files.
Keep in mind that your project sources should be stored in an application image or in a storage.
.PP
@@ -438,8 +438,13 @@ Create a cronjob from the service.
.PP
This adds a cronjob to the chart.
.PP
The label value is a YAML object with the following attributes: \- command: the command to be executed \- schedule: the cron schedule (cron format or \[at]every where \[dq]every\[dq] is a duration like 1h30m, daily, hourly...)
\- rbac: false (optionnal), if true, it will create a role, a rolebinding and a serviceaccount to make your cronjob able to connect the Kubernetes API
The label value is a YAML object with the following attributes:
.IP \[bu] 2
command: the command to be executed
.IP \[bu] 2
schedule: the cron schedule (cron format or \[at]every where \[dq]every\[dq] is a duration like 1h30m, daily, hourly...)
.IP \[bu] 2
rbac: false (optionnal), if true, it will create a role, a rolebinding and a serviceaccount to make your cronjob able to connect the Kubernetes API
.PP
\f[B]Example:\f[R]
.IP
@@ -532,7 +537,7 @@ service1:
service2:
image: php:7.4\-fpm
labels:
# get the congigMap from service1 where FOO is
# get the congigMap from service1 where FOO is
# defined inside this service too
katenary.v3/env\-from: |\-
\- myservice1
@@ -555,7 +560,13 @@ a \f[CR]voumeMount\f[R] in the pod for \f[B]each container\f[R]
.IP \[bu] 2
a \f[CR]initContainer\f[R] for each definition
.PP
Fields: \- name: the name of the volume (manadatory) \- mountPath: the path where the volume is mounted in the pod (optional, default is \f[CR]/opt\f[R]) \- init: a command to run to initialize the volume with data (optional)
Fields:
.IP \[bu] 2
name: the name of the volume (manadatory)
.IP \[bu] 2
mountPath: the path where the volume is mounted in the pod (optional, default is \f[CR]/opt\f[R])
.IP \[bu] 2
init: a command to run to initialize the volume with data (optional)
.PP
Warning
.PP
@@ -645,7 +656,7 @@ ghost:
image: ghost:1.25.5
labels:
# The chart is now named ghost, and the appVersion is 1.25.5.
# In Deployment, the image attribute is set to ghost:1.25.5 if
# In Deployment, the image attribute is set to ghost:1.25.5 if
# you don\[aq]t change the \[dq]tag\[dq] attribute in values.yaml
katenary.v3/main\-app: true
.EE
@@ -734,7 +745,7 @@ Environment variables to be added to the values.yaml
.PP
\f[B]Type\f[R]: \f[CR][]string or map[string]string\f[R]
.PP
By default, all environment variables in the \[dq]env\[dq] and environment files are added to configmaps with the static values set.
By default, all environment variables in the \[dq]env\[dq] and environment files are added to ConfigMaps with the static values set.
This label allows adding environment variables to the values.yaml file.
.PP
Note that the value inside the configmap is \f[CR]{{ tpl vaname . }}\f[R], so you can set the value to a template that will be rendered with the values.yaml file.
@@ -756,7 +767,7 @@ labels:
\- TO_CONFIGURE
# complex values, set as a template in values.yaml with a documentation
\- A_COMPLEX_VALUE: |\-
This is the documentation for the variable to
This is the documentation for the variable to
configure in values.yaml.
It can be, of course, a multiline text.
.EE

View File

@@ -136,16 +136,17 @@ func GetValuesFromLabel(service types.ServiceConfig, LabelValues string) map[str
log.Printf("Error parsing label %s: %s", v, err)
log.Fatal(err)
}
for _, value := range labelContent {
switch val := value.(type) {
switch value := value.(type) {
case string:
descriptions[val] = nil
descriptions[value] = nil
case map[string]any:
for k, v := range value.(map[string]any) {
for k, v := range value {
descriptions[k] = &EnvConfig{Service: service, Description: v.(string)}
}
case map[any]any:
for k, v := range value.(map[any]any) {
for k, v := range value {
descriptions[k.(string)] = &EnvConfig{Service: service, Description: v.(string)}
}
default: