Skip to content

Commit

Permalink
fix: skip generating empty .machine.logging
Browse files Browse the repository at this point in the history
This fixes backwards compatibility with previous versions of Talos.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
  • Loading branch information
smira committed Oct 25, 2021
1 parent 60ad006 commit 8b62065
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pkg/machinery/config/types/v1alpha1/v1alpha1_types.go
Expand Up @@ -481,6 +481,15 @@ metadata:
loggingEndpointExample2 = &Endpoint{
mustParseURL("tcp://1.2.3.4:12345"),
}

machineLoggingExample = LoggingConfig{
LoggingDestinations: []LoggingDestination{
{
LoggingEndpoint: loggingEndpointExample2,
LoggingFormat: constants.LoggingFormatJSONLines,
},
},
}
)

// Config defines the v1alpha1 configuration file.
Expand Down Expand Up @@ -670,7 +679,9 @@ type MachineConfig struct {
MachineUdev *UdevConfig `yaml:"udev,omitempty"`
// description: |
// Configures the logging system.
MachineLogging *LoggingConfig `yaml:"logging"`
// examples:
// - value: machineLoggingExample
MachineLogging *LoggingConfig `yaml:"logging,omitempty"`
}

// ClusterConfig represents the cluster-wide config values.
Expand Down
4 changes: 4 additions & 0 deletions pkg/machinery/config/types/v1alpha1/v1alpha1_types_doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions website/content/docs/v0.14/Reference/configuration.md
Expand Up @@ -772,6 +772,20 @@ udev:

Configures the logging system.



Examples:


``` yaml
logging:
# Logging destination.
destinations:
- endpoint: tcp://1.2.3.4:12345 # Where to send logs. Supported protocols are "tcp" and "udp".
format: json_lines # Logs format.
```


</div>

<hr />
Expand Down Expand Up @@ -5600,6 +5614,12 @@ Appears in:
- <code><a href="#machineconfig">MachineConfig</a>.logging</code>


``` yaml
# Logging destination.
destinations:
- endpoint: tcp://1.2.3.4:12345 # Where to send logs. Supported protocols are "tcp" and "udp".
format: json_lines # Logs format.
```

<hr />

Expand Down

0 comments on commit 8b62065

Please sign in to comment.