feat: support environment in ExtensionServicesConfig

Support setting extension services environment variables in
`ExtensionServiceConfig` document.

Refactor `ExtensionServicesConfig` -> `ExtensionServiceConfig` and move extensions config under `runtime` pkg.

Fixes: #8271

Signed-off-by: Noel Georgi <git@frezbo.dev>
This commit is contained in:
Noel Georgi 2024-02-06 22:21:07 +05:30
parent 3fe82ec461
commit 15e8bca2b2
No known key found for this signature in database
GPG Key ID: 21A9F444075C9E36
45 changed files with 1069 additions and 668 deletions

Binary file not shown.

View File

@ -17,19 +17,20 @@ message EventSinkConfigSpec {
string endpoint = 1;
}
// ExtensionServicesConfigFile describes extensions service config files.
message ExtensionServicesConfigFile {
// ExtensionServiceConfigFile describes extensions service config files.
message ExtensionServiceConfigFile {
string content = 1;
string mount_path = 2;
}
// ExtensionServicesConfigSpec describes status of rendered extensions service config files.
message ExtensionServicesConfigSpec {
repeated ExtensionServicesConfigFile files = 2;
// ExtensionServiceConfigSpec describes status of rendered extensions service config files.
message ExtensionServiceConfigSpec {
repeated ExtensionServiceConfigFile files = 1;
repeated string environment = 2;
}
// ExtensionServicesConfigStatusSpec describes status of rendered extensions service config files.
message ExtensionServicesConfigStatusSpec {
// ExtensionServiceConfigStatusSpec describes status of rendered extensions service config files.
message ExtensionServiceConfigStatusSpec {
string spec_version = 1;
}

View File

@ -21,6 +21,7 @@ import (
"github.com/siderolabs/talos/pkg/machinery/config/encoder"
"github.com/siderolabs/talos/pkg/machinery/config/types/network"
"github.com/siderolabs/talos/pkg/machinery/config/types/runtime"
"github.com/siderolabs/talos/pkg/machinery/config/types/runtime/extensions"
"github.com/siderolabs/talos/pkg/machinery/config/types/siderolink"
v1alpha1 "github.com/siderolabs/talos/pkg/machinery/config/types/v1alpha1"
)
@ -120,6 +121,10 @@ var docsCmd = &cobra.Command{
name: "v1alpha1",
fileDoc: v1alpha1.GetFileDoc(),
},
{
name: "extensions",
fileDoc: extensions.GetFileDoc(),
},
} {
path := filepath.Join(dir, pkg.name)

View File

@ -80,19 +80,22 @@ Talos Linux now supports OpenNebula platform.
[notes.extensions]
title = "Extension Services Config"
description = """\
Talos now supports supplying configuration files for extension services that can be mounted into the extension service container.
Talos now supports supplying configuration files and environment variables for extension services.
The extension service configuration is a separate config document. An example is shown below:
```yaml
---
apiVersion: v1alpha1
kind: ExtensionServicesConfig
config:
- name: nut-client
configFiles:
- content: MONITOR ${upsmonHost} 1 remote pass password
mountPath: /usr/local/etc/nut/upsmon.conf
kind: ExtensionServiceConfig
name: nut-client
configFiles:
- content: MONITOR ${upsmonHost} 1 remote pass password
mountPath: /usr/local/etc/nut/upsmon.conf
environment:
- UPS_NAME=ups
```
For documentation, see [Extension Services Config Files](https://www.talos.dev/v1.7/reference/configuration/extensions/extensionserviceconfig/).
"""
[notes.k8supgrade]

View File

@ -47,7 +47,7 @@ func (ctrl *ExtensionServiceController) Inputs() []controller.Input {
return []controller.Input{
{
Namespace: runtime.NamespaceName,
Type: runtime.ExtensionServicesConfigStatusType,
Type: runtime.ExtensionServiceConfigStatusType,
Kind: controller.InputStrong,
},
}
@ -84,7 +84,7 @@ func (ctrl *ExtensionServiceController) Run(ctx context.Context, r controller.Ru
// load initial state of configStatuses
if ctrl.configStatusCache == nil {
configStatuses, err := safe.ReaderListAll[*runtime.ExtensionServicesConfigStatus](ctx, r)
configStatuses, err := safe.ReaderListAll[*runtime.ExtensionServiceConfigStatus](ctx, r)
if err != nil {
return fmt.Errorf("error listing extension services config: %w", err)
}
@ -146,7 +146,7 @@ func (ctrl *ExtensionServiceController) Run(ctx context.Context, r controller.Ru
case <-r.EventCh():
}
configStatuses, err := safe.ReaderListAll[*runtime.ExtensionServicesConfigStatus](ctx, r)
configStatuses, err := safe.ReaderListAll[*runtime.ExtensionServiceConfigStatus](ctx, r)
if err != nil {
return fmt.Errorf("error listing extension services config: %w", err)
}

View File

@ -20,16 +20,16 @@ import (
"github.com/siderolabs/talos/pkg/machinery/resources/runtime"
)
// ExtensionServicesConfigController watches v1alpha1.Config, creates/updates/deletes extension services config.
type ExtensionServicesConfigController struct{}
// ExtensionServiceConfigController watches v1alpha1.Config, creates/updates/deletes extension services config.
type ExtensionServiceConfigController struct{}
// Name implements controller.Controller interface.
func (ctrl *ExtensionServicesConfigController) Name() string {
return "runtime.ExtensionServicesConfigController"
func (ctrl *ExtensionServiceConfigController) Name() string {
return "runtime.ExtensionServiceConfigController"
}
// Inputs implements controller.Controller interface.
func (ctrl *ExtensionServicesConfigController) Inputs() []controller.Input {
func (ctrl *ExtensionServiceConfigController) Inputs() []controller.Input {
return []controller.Input{
{
Namespace: config.NamespaceName,
@ -41,10 +41,10 @@ func (ctrl *ExtensionServicesConfigController) Inputs() []controller.Input {
}
// Outputs implements controller.Controller interface.
func (ctrl *ExtensionServicesConfigController) Outputs() []controller.Output {
func (ctrl *ExtensionServiceConfigController) Outputs() []controller.Output {
return []controller.Output{
{
Type: runtime.ExtensionServicesConfigType,
Type: runtime.ExtensionServiceConfigType,
Kind: controller.OutputExclusive,
},
}
@ -53,7 +53,7 @@ func (ctrl *ExtensionServicesConfigController) Outputs() []controller.Output {
// Run implements controller.Controller interface.
//
//nolint:gocyclo
func (ctrl *ExtensionServicesConfigController) Run(ctx context.Context, r controller.Runtime, logger *zap.Logger) error {
func (ctrl *ExtensionServiceConfigController) Run(ctx context.Context, r controller.Runtime, logger *zap.Logger) error {
for {
select {
case <-ctx.Done():
@ -68,16 +68,18 @@ func (ctrl *ExtensionServicesConfigController) Run(ctx context.Context, r contro
r.StartTrackingOutputs()
if cfg != nil && cfg.Config() != nil && cfg.Config().ExtensionServicesConfig() != nil {
for _, ext := range cfg.Config().ExtensionServicesConfig().ConfigData() {
if err = safe.WriterModify(ctx, r, runtime.NewExtensionServicesConfigSpec(runtime.NamespaceName, ext.Name()), func(spec *runtime.ExtensionServicesConfig) error {
spec.TypedSpec().Files = xslices.Map(ext.ConfigFiles(), func(c extconfig.ExtensionServicesConfigFile) runtime.ExtensionServicesConfigFile {
return runtime.ExtensionServicesConfigFile{
if cfg != nil && cfg.Config() != nil {
for _, extConfig := range cfg.Config().ExtensionServiceConfigs() {
if err = safe.WriterModify(ctx, r, runtime.NewExtensionServiceConfigSpec(runtime.NamespaceName, extConfig.Name()), func(spec *runtime.ExtensionServiceConfig) error {
spec.TypedSpec().Files = xslices.Map(extConfig.ConfigFiles(), func(c extconfig.ExtensionServiceConfigFile) runtime.ExtensionServiceConfigFile {
return runtime.ExtensionServiceConfigFile{
Content: c.Content(),
MountPath: c.Path(),
MountPath: c.MountPath(),
}
})
spec.TypedSpec().Environment = extConfig.Environment()
return nil
}); err != nil {
return err
@ -85,7 +87,7 @@ func (ctrl *ExtensionServicesConfigController) Run(ctx context.Context, r contro
}
}
if err = safe.CleanupOutputs[*runtime.ExtensionServicesConfig](ctx, r); err != nil {
if err = safe.CleanupOutputs[*runtime.ExtensionServiceConfig](ctx, r); err != nil {
return err
}
}

View File

@ -20,33 +20,33 @@ import (
"github.com/siderolabs/talos/pkg/machinery/resources/runtime"
)
// ExtensionServicesConfigFilesController writes down the config files for extension services.
type ExtensionServicesConfigFilesController struct {
// ExtensionServiceConfigFilesController writes down the config files for extension services.
type ExtensionServiceConfigFilesController struct {
V1Alpha1Mode v1alpha1runtime.Mode
ExtensionsConfigBaseDir string
}
// Name implements controller.Controller interface.
func (ctrl *ExtensionServicesConfigFilesController) Name() string {
return "runtime.ExtensionServicesConfigFilesController"
func (ctrl *ExtensionServiceConfigFilesController) Name() string {
return "runtime.ExtensionServiceConfigFilesController"
}
// Inputs implements controller.Controller interface.
func (ctrl *ExtensionServicesConfigFilesController) Inputs() []controller.Input {
func (ctrl *ExtensionServiceConfigFilesController) Inputs() []controller.Input {
return []controller.Input{
{
Namespace: runtime.NamespaceName,
Type: runtime.ExtensionServicesConfigType,
Type: runtime.ExtensionServiceConfigType,
Kind: controller.InputStrong,
},
}
}
// Outputs implements controller.Controller interface.
func (ctrl *ExtensionServicesConfigFilesController) Outputs() []controller.Output {
func (ctrl *ExtensionServiceConfigFilesController) Outputs() []controller.Output {
return []controller.Output{
{
Type: runtime.ExtensionServicesConfigStatusType,
Type: runtime.ExtensionServiceConfigStatusType,
Kind: controller.OutputExclusive,
},
}
@ -55,7 +55,7 @@ func (ctrl *ExtensionServicesConfigFilesController) Outputs() []controller.Outpu
// Run implements controller.Controller interface.
//
//nolint:gocyclo
func (ctrl *ExtensionServicesConfigFilesController) Run(ctx context.Context, r controller.Runtime, logger *zap.Logger) error {
func (ctrl *ExtensionServiceConfigFilesController) Run(ctx context.Context, r controller.Runtime, logger *zap.Logger) error {
if ctrl.V1Alpha1Mode == v1alpha1runtime.ModeContainer {
return nil
}
@ -67,7 +67,7 @@ func (ctrl *ExtensionServicesConfigFilesController) Run(ctx context.Context, r c
case <-r.EventCh():
}
list, err := safe.ReaderListAll[*runtime.ExtensionServicesConfig](ctx, r)
list, err := safe.ReaderListAll[*runtime.ExtensionServiceConfig](ctx, r)
if err != nil {
return fmt.Errorf("error listing extension services config: %w", err)
}
@ -95,7 +95,7 @@ func (ctrl *ExtensionServicesConfigFilesController) Run(ctx context.Context, r c
touchedFiles[fileName] = struct{}{}
}
if err = safe.WriterModify(ctx, r, runtime.NewExtensionServicesConfigStatusSpec(runtime.NamespaceName, iter.Value().Metadata().ID()), func(spec *runtime.ExtensionServicesConfigStatus) error {
if err = safe.WriterModify(ctx, r, runtime.NewExtensionServiceConfigStatusSpec(runtime.NamespaceName, iter.Value().Metadata().ID()), func(spec *runtime.ExtensionServiceConfigStatus) error {
spec.TypedSpec().SpecVersion = iter.Value().Metadata().Version().String()
return nil
@ -117,7 +117,7 @@ func (ctrl *ExtensionServicesConfigFilesController) Run(ctx context.Context, r c
return err
}
if err = safe.CleanupOutputs[*runtime.ExtensionServicesConfigStatus](ctx, r); err != nil {
if err = safe.CleanupOutputs[*runtime.ExtensionServiceConfigStatus](ctx, r); err != nil {
return err
}
}

View File

@ -18,18 +18,18 @@ import (
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
)
type ExtensionServicesConfigFilesSuite struct {
type ExtensionServiceConfigFilesSuite struct {
ctest.DefaultSuite
extensionsConfigDir string
}
func TestExtensionServicesConfigFilesSuite(t *testing.T) {
func TestExtensionServiceConfigFilesSuite(t *testing.T) {
extensionsConfigDir := t.TempDir()
suite.Run(t, &ExtensionServicesConfigFilesSuite{
suite.Run(t, &ExtensionServiceConfigFilesSuite{
DefaultSuite: ctest.DefaultSuite{
AfterSetup: func(suite *ctest.DefaultSuite) {
suite.Require().NoError(suite.Runtime().RegisterController(&runtime.ExtensionServicesConfigFilesController{
suite.Require().NoError(suite.Runtime().RegisterController(&runtime.ExtensionServiceConfigFilesController{
ExtensionsConfigBaseDir: extensionsConfigDir,
}))
},
@ -38,7 +38,7 @@ func TestExtensionServicesConfigFilesSuite(t *testing.T) {
})
}
func (suite *ExtensionServicesConfigFilesSuite) TestReconcileExtensionServicesConfigFiles() {
func (suite *ExtensionServiceConfigFilesSuite) TestReconcileExtensionServiceConfigFiles() {
for _, tt := range []struct {
extensionName string
configFiles []struct {
@ -75,23 +75,23 @@ func (suite *ExtensionServicesConfigFilesSuite) TestReconcileExtensionServicesCo
},
},
} {
extensionServicesConfigFiles := runtimeres.NewExtensionServicesConfigSpec(runtimeres.NamespaceName, tt.extensionName)
extensionServicesConfigFiles.TypedSpec().Files = xslices.Map(tt.configFiles, func(config struct {
extensionServiceConfigFiles := runtimeres.NewExtensionServiceConfigSpec(runtimeres.NamespaceName, tt.extensionName)
extensionServiceConfigFiles.TypedSpec().Files = xslices.Map(tt.configFiles, func(config struct {
content string
mountPath string
},
) runtimeres.ExtensionServicesConfigFile {
return runtimeres.ExtensionServicesConfigFile{
) runtimeres.ExtensionServiceConfigFile {
return runtimeres.ExtensionServiceConfigFile{
Content: config.content,
MountPath: config.mountPath,
}
})
suite.Require().NoError(suite.State().Create(suite.Ctx(), extensionServicesConfigFiles))
suite.Require().NoError(suite.State().Create(suite.Ctx(), extensionServiceConfigFiles))
ctest.AssertResource(suite, tt.extensionName,
func(status *runtimeres.ExtensionServicesConfigStatus, asrt *assert.Assertions) {
asrt.Equal(extensionServicesConfigFiles.Metadata().Version().String(), status.TypedSpec().SpecVersion)
func(status *runtimeres.ExtensionServiceConfigStatus, asrt *assert.Assertions) {
asrt.Equal(extensionServiceConfigFiles.Metadata().Version().String(), status.TypedSpec().SpecVersion)
},
)
@ -113,8 +113,8 @@ func (suite *ExtensionServicesConfigFilesSuite) TestReconcileExtensionServicesCo
suite.Assert().NoError(err)
// delete test-extension-b resource
suite.Assert().NoError(suite.State().Destroy(suite.Ctx(), runtimeres.NewExtensionServicesConfigSpec(runtimeres.NamespaceName, "test-extension-b").Metadata()))
ctest.AssertNoResource[*runtimeres.ExtensionServicesConfigStatus](suite, "test-extension-b")
suite.Assert().NoError(suite.State().Destroy(suite.Ctx(), runtimeres.NewExtensionServiceConfigSpec(runtimeres.NamespaceName, "test-extension-b").Metadata()))
ctest.AssertNoResource[*runtimeres.ExtensionServiceConfigStatus](suite, "test-extension-b")
suite.Assert().NoFileExists(filepath.Join(suite.extensionsConfigDir, "test", "testdata"))
suite.Assert().NoDirExists(filepath.Join(suite.extensionsConfigDir, "test"))

View File

@ -13,65 +13,35 @@ import (
"github.com/siderolabs/talos/internal/app/machined/pkg/controllers/ctest"
"github.com/siderolabs/talos/internal/app/machined/pkg/controllers/runtime"
cntrconfig "github.com/siderolabs/talos/pkg/machinery/config/config"
"github.com/siderolabs/talos/pkg/machinery/config/container"
"github.com/siderolabs/talos/pkg/machinery/config/types/extensionservicesconfig"
"github.com/siderolabs/talos/pkg/machinery/config/types/runtime/extensions"
"github.com/siderolabs/talos/pkg/machinery/resources/config"
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
)
type ExtensionServicesConfigSuite struct {
type ExtensionServiceConfigSuite struct {
ctest.DefaultSuite
}
func TestExtensionServicesConfigSuite(t *testing.T) {
suite.Run(t, &ExtensionServicesConfigSuite{
func TestExtensionServiceConfigSuite(t *testing.T) {
suite.Run(t, &ExtensionServiceConfigSuite{
DefaultSuite: ctest.DefaultSuite{
AfterSetup: func(suite *ctest.DefaultSuite) {
suite.Require().NoError(suite.Runtime().RegisterController(&runtime.ExtensionServicesConfigController{}))
suite.Require().NoError(suite.Runtime().RegisterController(&runtime.ExtensionServiceConfigController{}))
},
},
})
}
func (suite *ExtensionServicesConfigSuite) TestReconcileExtensionServicesConfig() {
extensionsServiceConfigDoc := extensionservicesconfig.NewExtensionServicesConfigV1Alpha1()
extensionsServiceConfigDoc.Config = []extensionservicesconfig.ExtensionServiceConfig{
{
ExtensionName: "test-extension-a",
ExtensionServiceConfigFiles: []extensionservicesconfig.ExtensionServiceConfigFile{
{
ExtensionContent: "test-content-a",
ExtensionMountPath: "/etc/test",
},
},
},
{
ExtensionName: "test-extension-b",
ExtensionServiceConfigFiles: []extensionservicesconfig.ExtensionServiceConfigFile{
{
ExtensionContent: "test-content-b",
ExtensionMountPath: "/etc/bar",
},
{
ExtensionContent: "test-content-c",
ExtensionMountPath: "/var/etc/foo",
},
},
},
}
cntr, err := container.New(extensionsServiceConfigDoc)
suite.Require().NoError(err)
cfg := config.NewMachineConfig(cntr)
suite.Require().NoError(suite.State().Create(suite.Ctx(), cfg))
for _, tt := range []struct {
func (suite *ExtensionServiceConfigSuite) TestReconcileExtensionServiceConfig() {
extensionServiceConfigs := []struct {
extensionName string
configFiles []struct {
content string
mountPath string
}
environment []string
}{
{
extensionName: "test-extension-a",
@ -100,34 +70,72 @@ func (suite *ExtensionServicesConfigSuite) TestReconcileExtensionServicesConfig(
mountPath: "/var/etc/foo",
},
},
environment: []string{
"FOO=BAR",
},
},
} {
ctest.AssertResource(suite, tt.extensionName, func(config *runtimeres.ExtensionServicesConfig, asrt *assert.Assertions) {
}
cfgs := xslices.Map(extensionServiceConfigs, func(tt struct {
extensionName string
configFiles []struct {
content string
mountPath string
}
environment []string
},
) cntrconfig.Document {
cfg := extensions.NewServicesConfigV1Alpha1()
cfg.ServiceName = tt.extensionName
cfg.ServiceConfigFiles = xslices.Map(tt.configFiles, func(config struct {
content string
mountPath string
},
) extensions.ConfigFile {
return extensions.ConfigFile{
ConfigFileContent: config.content,
ConfigFileMountPath: config.mountPath,
}
})
cfg.ServiceEnvironment = tt.environment
return cfg
})
cntr, err := container.New(cfgs...)
suite.Require().NoError(err)
machineConfig := config.NewMachineConfig(cntr)
suite.Require().NoError(suite.State().Create(suite.Ctx(), machineConfig))
for _, tt := range extensionServiceConfigs {
ctest.AssertResource(suite, tt.extensionName, func(config *runtimeres.ExtensionServiceConfig, asrt *assert.Assertions) {
spec := config.TypedSpec()
configFileData := xslices.Map(tt.configFiles, func(config struct {
content string
mountPath string
},
) runtimeres.ExtensionServicesConfigFile {
return runtimeres.ExtensionServicesConfigFile{
) runtimeres.ExtensionServiceConfigFile {
return runtimeres.ExtensionServiceConfigFile{
Content: config.content,
MountPath: config.mountPath,
}
})
suite.Assert().Equal(configFileData, spec.Files)
suite.Assert().Equal(tt.environment, spec.Environment)
})
}
// test deletion
extensionsServiceConfigDoc.Config = extensionsServiceConfigDoc.Config[1:] // remove first extension service config
cntr, err = container.New(extensionsServiceConfigDoc)
cfg := extensions.NewServicesConfigV1Alpha1()
cfg.ServiceName = "test-extension-a"
cntr, err = container.New(cfg)
suite.Require().NoError(err)
newCfg := config.NewMachineConfig(cntr)
newCfg.Metadata().SetVersion(cfg.Metadata().Version())
suite.Require().NoError(suite.State().Update(suite.Ctx(), cfg))
machineConfig = config.NewMachineConfig(cntr)
suite.Require().NoError(suite.State().Destroy(suite.Ctx(), machineConfig.Metadata()))
ctest.AssertNoResource[*runtimeres.ExtensionServicesConfig](suite, "test-extension-a")
ctest.AssertNoResource[*runtimeres.ExtensionServiceConfig](suite, "test-extension-a")
}

View File

@ -172,7 +172,7 @@ func (suite *ExtensionServiceSuite) TestReconcile() {
svcMock.getTimesStartedStopped(),
)
helloConfig := runtime.NewExtensionServicesConfigStatusSpec(runtime.NamespaceName, "hello-world")
helloConfig := runtime.NewExtensionServiceConfigStatusSpec(runtime.NamespaceName, "hello-world")
helloConfig.TypedSpec().SpecVersion = "1"
suite.Require().NoError(suite.state.Create(suite.ctx, helloConfig))
@ -201,7 +201,7 @@ func (suite *ExtensionServiceSuite) TestReconcile() {
},
})
unexpectedConfig := runtime.NewExtensionServicesConfigStatusSpec(runtime.NamespaceName, "unexpected")
unexpectedConfig := runtime.NewExtensionServiceConfigStatusSpec(runtime.NamespaceName, "unexpected")
unexpectedConfig.TypedSpec().SpecVersion = "1"
suite.Require().NoError(suite.state.Create(suite.ctx, unexpectedConfig))

View File

@ -255,10 +255,10 @@ func (ctrl *Controller) Run(ctx context.Context, drainer *runtime.Drainer) error
&runtimecontrollers.DropUpgradeFallbackController{
MetaProvider: ctrl.v1alpha1Runtime.State().Machine(),
},
&runtimecontrollers.ExtensionServicesConfigController{},
&runtimecontrollers.ExtensionServicesConfigFilesController{
&runtimecontrollers.ExtensionServiceConfigController{},
&runtimecontrollers.ExtensionServiceConfigFilesController{
V1Alpha1Mode: ctrl.v1alpha1Runtime.State().Platform().Mode(),
ExtensionsConfigBaseDir: constants.ExtensionServicesUserConfigPath,
ExtensionsConfigBaseDir: constants.ExtensionServiceUserConfigPath,
},
&runtimecontrollers.EventsSinkConfigController{
Cmdline: procfs.ProcCmdline(),
@ -270,7 +270,7 @@ func (ctrl *Controller) Run(ctx context.Context, drainer *runtime.Drainer) error
},
&runtimecontrollers.ExtensionServiceController{
V1Alpha1Services: system.Services(ctrl.v1alpha1Runtime),
ConfigPath: constants.ExtensionServicesConfigPath,
ConfigPath: constants.ExtensionServiceConfigPath,
},
&runtimecontrollers.ExtensionStatusController{},
&runtimecontrollers.KernelModuleConfigController{},

View File

@ -173,8 +173,8 @@ func NewState() (*State, error) {
&perf.Memory{},
&runtime.DevicesStatus{},
&runtime.EventSinkConfig{},
&runtime.ExtensionServicesConfig{},
&runtime.ExtensionServicesConfigStatus{},
&runtime.ExtensionServiceConfig{},
&runtime.ExtensionServiceConfigStatus{},
&runtime.ExtensionStatus{},
&runtime.KernelModuleSpec{},
&runtime.KernelParamSpec{},

View File

@ -52,7 +52,7 @@ func (svc *Extension) PreFunc(ctx context.Context, r runtime.Runtime) error {
// re-mount service rootfs as overlay rw mount to allow containerd to mount there /dev, /proc, etc.
svc.overlay = mount.NewMountPoint(
"",
filepath.Join(constants.ExtensionServicesRootfsPath, svc.Spec.Name),
filepath.Join(constants.ExtensionServiceRootfsPath, svc.Spec.Name),
"",
0,
"",
@ -111,7 +111,7 @@ func (svc *Extension) DependsOn(r runtime.Runtime) []string {
func (svc *Extension) getOCIOptions(envVars []string, mounts []specs.Mount) []oci.SpecOpts {
ociOpts := []oci.SpecOpts{
oci.WithRootFSPath(filepath.Join(constants.ExtensionServicesRootfsPath, svc.Spec.Name)),
oci.WithRootFSPath(filepath.Join(constants.ExtensionServiceRootfsPath, svc.Spec.Name)),
containerd.WithRootfsPropagation(svc.Spec.Container.Security.RootfsPropagation),
oci.WithCgroup(filepath.Join(constants.CgroupExtensions, svc.Spec.Name)),
oci.WithMounts(mounts),
@ -166,18 +166,25 @@ func (svc *Extension) Runner(r runtime.Runtime) (runner.Runner, error) {
mounts := append([]specs.Mount{}, svc.Spec.Container.Mounts...)
configSpec, err := safe.StateGetByID[*runtimeres.ExtensionServicesConfig](context.Background(), r.State().V1Alpha2().Resources(), svc.Spec.Name)
envVars, err := svc.parseEnvironment()
if err != nil {
return nil, err
}
configSpec, err := safe.StateGetByID[*runtimeres.ExtensionServiceConfig](context.Background(), r.State().V1Alpha2().Resources(), svc.Spec.Name)
if err == nil {
spec := configSpec.TypedSpec()
for _, ext := range spec.Files {
mounts = append(mounts, specs.Mount{
Source: filepath.Join(constants.ExtensionServicesUserConfigPath, svc.Spec.Name, strings.ReplaceAll(strings.TrimPrefix(ext.MountPath, "/"), "/", "-")),
Source: filepath.Join(constants.ExtensionServiceUserConfigPath, svc.Spec.Name, strings.ReplaceAll(strings.TrimPrefix(ext.MountPath, "/"), "/", "-")),
Destination: ext.MountPath,
Type: "bind",
Options: []string{"ro", "bind"},
})
}
envVars = append(envVars, spec.Environment...)
} else if !state.IsNotFoundError(err) {
return nil, err
}
@ -193,11 +200,6 @@ func (svc *Extension) Runner(r runtime.Runtime) (runner.Runner, error) {
restartType = restart.UntilSuccess
}
envVars, err := svc.parseEnvironment()
if err != nil {
return nil, err
}
ociSpecOpts := svc.getOCIOptions(envVars, mounts)
debug := false

View File

@ -120,8 +120,8 @@ func (x *EventSinkConfigSpec) GetEndpoint() string {
return ""
}
// ExtensionServicesConfigFile describes extensions service config files.
type ExtensionServicesConfigFile struct {
// ExtensionServiceConfigFile describes extensions service config files.
type ExtensionServiceConfigFile struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@ -130,8 +130,8 @@ type ExtensionServicesConfigFile struct {
MountPath string `protobuf:"bytes,2,opt,name=mount_path,json=mountPath,proto3" json:"mount_path,omitempty"`
}
func (x *ExtensionServicesConfigFile) Reset() {
*x = ExtensionServicesConfigFile{}
func (x *ExtensionServiceConfigFile) Reset() {
*x = ExtensionServiceConfigFile{}
if protoimpl.UnsafeEnabled {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -139,13 +139,13 @@ func (x *ExtensionServicesConfigFile) Reset() {
}
}
func (x *ExtensionServicesConfigFile) String() string {
func (x *ExtensionServiceConfigFile) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExtensionServicesConfigFile) ProtoMessage() {}
func (*ExtensionServiceConfigFile) ProtoMessage() {}
func (x *ExtensionServicesConfigFile) ProtoReflect() protoreflect.Message {
func (x *ExtensionServiceConfigFile) ProtoReflect() protoreflect.Message {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -157,36 +157,37 @@ func (x *ExtensionServicesConfigFile) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use ExtensionServicesConfigFile.ProtoReflect.Descriptor instead.
func (*ExtensionServicesConfigFile) Descriptor() ([]byte, []int) {
// Deprecated: Use ExtensionServiceConfigFile.ProtoReflect.Descriptor instead.
func (*ExtensionServiceConfigFile) Descriptor() ([]byte, []int) {
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{2}
}
func (x *ExtensionServicesConfigFile) GetContent() string {
func (x *ExtensionServiceConfigFile) GetContent() string {
if x != nil {
return x.Content
}
return ""
}
func (x *ExtensionServicesConfigFile) GetMountPath() string {
func (x *ExtensionServiceConfigFile) GetMountPath() string {
if x != nil {
return x.MountPath
}
return ""
}
// ExtensionServicesConfigSpec describes status of rendered extensions service config files.
type ExtensionServicesConfigSpec struct {
// ExtensionServiceConfigSpec describes status of rendered extensions service config files.
type ExtensionServiceConfigSpec struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Files []*ExtensionServicesConfigFile `protobuf:"bytes,2,rep,name=files,proto3" json:"files,omitempty"`
Files []*ExtensionServiceConfigFile `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty"`
Environment []string `protobuf:"bytes,2,rep,name=environment,proto3" json:"environment,omitempty"`
}
func (x *ExtensionServicesConfigSpec) Reset() {
*x = ExtensionServicesConfigSpec{}
func (x *ExtensionServiceConfigSpec) Reset() {
*x = ExtensionServiceConfigSpec{}
if protoimpl.UnsafeEnabled {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -194,13 +195,13 @@ func (x *ExtensionServicesConfigSpec) Reset() {
}
}
func (x *ExtensionServicesConfigSpec) String() string {
func (x *ExtensionServiceConfigSpec) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExtensionServicesConfigSpec) ProtoMessage() {}
func (*ExtensionServiceConfigSpec) ProtoMessage() {}
func (x *ExtensionServicesConfigSpec) ProtoReflect() protoreflect.Message {
func (x *ExtensionServiceConfigSpec) ProtoReflect() protoreflect.Message {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -212,20 +213,27 @@ func (x *ExtensionServicesConfigSpec) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use ExtensionServicesConfigSpec.ProtoReflect.Descriptor instead.
func (*ExtensionServicesConfigSpec) Descriptor() ([]byte, []int) {
// Deprecated: Use ExtensionServiceConfigSpec.ProtoReflect.Descriptor instead.
func (*ExtensionServiceConfigSpec) Descriptor() ([]byte, []int) {
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{3}
}
func (x *ExtensionServicesConfigSpec) GetFiles() []*ExtensionServicesConfigFile {
func (x *ExtensionServiceConfigSpec) GetFiles() []*ExtensionServiceConfigFile {
if x != nil {
return x.Files
}
return nil
}
// ExtensionServicesConfigStatusSpec describes status of rendered extensions service config files.
type ExtensionServicesConfigStatusSpec struct {
func (x *ExtensionServiceConfigSpec) GetEnvironment() []string {
if x != nil {
return x.Environment
}
return nil
}
// ExtensionServiceConfigStatusSpec describes status of rendered extensions service config files.
type ExtensionServiceConfigStatusSpec struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@ -233,8 +241,8 @@ type ExtensionServicesConfigStatusSpec struct {
SpecVersion string `protobuf:"bytes,1,opt,name=spec_version,json=specVersion,proto3" json:"spec_version,omitempty"`
}
func (x *ExtensionServicesConfigStatusSpec) Reset() {
*x = ExtensionServicesConfigStatusSpec{}
func (x *ExtensionServiceConfigStatusSpec) Reset() {
*x = ExtensionServiceConfigStatusSpec{}
if protoimpl.UnsafeEnabled {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -242,13 +250,13 @@ func (x *ExtensionServicesConfigStatusSpec) Reset() {
}
}
func (x *ExtensionServicesConfigStatusSpec) String() string {
func (x *ExtensionServiceConfigStatusSpec) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExtensionServicesConfigStatusSpec) ProtoMessage() {}
func (*ExtensionServiceConfigStatusSpec) ProtoMessage() {}
func (x *ExtensionServicesConfigStatusSpec) ProtoReflect() protoreflect.Message {
func (x *ExtensionServiceConfigStatusSpec) ProtoReflect() protoreflect.Message {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -260,12 +268,12 @@ func (x *ExtensionServicesConfigStatusSpec) ProtoReflect() protoreflect.Message
return mi.MessageOf(x)
}
// Deprecated: Use ExtensionServicesConfigStatusSpec.ProtoReflect.Descriptor instead.
func (*ExtensionServicesConfigStatusSpec) Descriptor() ([]byte, []int) {
// Deprecated: Use ExtensionServiceConfigStatusSpec.ProtoReflect.Descriptor instead.
func (*ExtensionServiceConfigStatusSpec) Descriptor() ([]byte, []int) {
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{4}
}
func (x *ExtensionServicesConfigStatusSpec) GetSpecVersion() string {
func (x *ExtensionServiceConfigStatusSpec) GetSpecVersion() string {
if x != nil {
return x.SpecVersion
}
@ -1137,132 +1145,133 @@ var file_resource_definitions_runtime_runtime_proto_rawDesc = []byte{
0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x22, 0x31, 0x0a, 0x13, 0x45, 0x76, 0x65, 0x6e,
0x74, 0x53, 0x69, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x70, 0x65, 0x63, 0x12,
0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x56, 0x0a, 0x1b, 0x45,
0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73,
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f,
0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e,
0x74, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x61,
0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x50,
0x61, 0x74, 0x68, 0x22, 0x74, 0x0a, 0x1b, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x70,
0x65, 0x63, 0x12, 0x55, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x72,
0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x46, 0x69,
0x6c, 0x65, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x22, 0x46, 0x0a, 0x21, 0x45, 0x78, 0x74,
0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x43, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x21,
0x0a, 0x0c, 0x73, 0x70, 0x65, 0x63, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x70, 0x65, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x22, 0x4a, 0x0a, 0x14, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
0x65, 0x53, 0x70, 0x65, 0x63, 0x53, 0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a,
0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,
0x09, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x22, 0x50, 0x0a,
0x13, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x53, 0x70, 0x65, 0x63,
0x53, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x67,
0x6e, 0x6f, 0x72, 0x65, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28,
0x08, 0x52, 0x0c, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x22,
0x6d, 0x0a, 0x15, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x53, 0x74,
0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x75, 0x72, 0x72,
0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x75, 0x72, 0x72, 0x65,
0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x20, 0x0a, 0x0b,
0x75, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
0x08, 0x52, 0x0b, 0x75, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x22, 0x44,
0x0a, 0x11, 0x4b, 0x6d, 0x73, 0x67, 0x4c, 0x6f, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53,
0x70, 0x65, 0x63, 0x12, 0x2f, 0x0a, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
0x6f, 0x6e, 0x2e, 0x55, 0x52, 0x4c, 0x52, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x22, 0xb1, 0x01, 0x0a, 0x11, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x4b, 0x0a, 0x05, 0x73, 0x74,
0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x74, 0x61, 0x6c, 0x6f,
0x73, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e,
0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x52, 0x75, 0x6e,
0x74, 0x69, 0x6d, 0x65, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x67, 0x65,
0x52, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x12, 0x4f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,
0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x2e,
0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x4d, 0x61, 0x63,
0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x8a, 0x01, 0x0a, 0x13, 0x4d, 0x61, 0x63,
0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52,
0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x5d, 0x0a, 0x10, 0x75, 0x6e, 0x6d, 0x65, 0x74, 0x5f,
0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x32, 0x2e, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x55, 0x0a, 0x1a, 0x45,
0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43,
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e,
0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74,
0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x61, 0x74,
0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x61,
0x74, 0x68, 0x22, 0x94, 0x01, 0x0a, 0x1a, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x70, 0x65,
0x63, 0x12, 0x54, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x3e, 0x2e, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
0x65, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x72, 0x75,
0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x55, 0x6e, 0x6d, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69,
0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x75, 0x6e, 0x6d, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x1c, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x65,
0x6e, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x53, 0x70, 0x65, 0x63, 0x12, 0x25, 0x0a, 0x0e, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e,
0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d,
0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3e, 0x0a,
0x13, 0x72, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65,
0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x63, 0x6f, 0x6d,
0x6d, 0x6f, 0x6e, 0x2e, 0x4e, 0x65, 0x74, 0x49, 0x50, 0x52, 0x12, 0x72, 0x65, 0x61, 0x63, 0x68,
0x61, 0x62, 0x6c, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0x23, 0x0a,
0x0b, 0x4d, 0x65, 0x74, 0x61, 0x4b, 0x65, 0x79, 0x53, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05,
0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x22, 0x24, 0x0a, 0x0e, 0x4d, 0x65, 0x74, 0x61, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x64,
0x53, 0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x08, 0x52, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x22, 0xd5, 0x01, 0x0a, 0x0f, 0x4d, 0x6f, 0x75,
0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x16, 0x0a, 0x06,
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x0f,
0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18,
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65,
0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12,
0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01,
0x28, 0x08, 0x52, 0x09, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x12, 0x31, 0x0a,
0x14, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x76,
0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x65, 0x6e, 0x63,
0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73,
0x22, 0xf5, 0x01, 0x0a, 0x14, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4d, 0x65, 0x74,
0x61, 0x64, 0x61, 0x74, 0x61, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61,
0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61,
0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d,
0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x7a, 0x6f, 0x6e,
0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x7a, 0x6f, 0x6e, 0x65, 0x12, 0x23, 0x0a,
0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x79,
0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69,
0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63,
0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f,
0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64,
0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x6f, 0x74, 0x18, 0x08, 0x20, 0x01,
0x28, 0x08, 0x52, 0x04, 0x73, 0x70, 0x6f, 0x74, 0x22, 0xb2, 0x01, 0x0a, 0x11, 0x53, 0x65, 0x63,
0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1f,
0x0a, 0x0b, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20,
0x01, 0x28, 0x08, 0x52, 0x0a, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x42, 0x6f, 0x6f, 0x74, 0x12,
0x3d, 0x0a, 0x1b, 0x75, 0x6b, 0x69, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x6b,
0x65, 0x79, 0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x18, 0x75, 0x6b, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67,
0x4b, 0x65, 0x79, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x12, 0x3d,
0x0a, 0x1b, 0x70, 0x63, 0x72, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x6b, 0x65,
0x79, 0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x52, 0x18, 0x70, 0x63, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x4b,
0x65, 0x79, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x22, 0x2e, 0x0a,
0x16, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x54, 0x6f,
0x6b, 0x65, 0x6e, 0x53, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x3c, 0x0a,
0x0e, 0x55, 0x6e, 0x6d, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12,
0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x42, 0x4c, 0x5a, 0x4a, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x69, 0x64, 0x65, 0x72, 0x6f,
0x6c, 0x61, 0x62, 0x73, 0x2f, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6d,
0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x72, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73,
0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x46, 0x69, 0x6c, 0x65,
0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72,
0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x6e,
0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x45, 0x0a, 0x20, 0x45, 0x78, 0x74,
0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x21, 0x0a,
0x0c, 0x73, 0x70, 0x65, 0x63, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x70, 0x65, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
0x22, 0x4a, 0x0a, 0x14, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
0x53, 0x70, 0x65, 0x63, 0x53, 0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a,
0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09,
0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x22, 0x50, 0x0a, 0x13,
0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x53, 0x70, 0x65, 0x63, 0x53,
0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x67, 0x6e,
0x6f, 0x72, 0x65, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08,
0x52, 0x0c, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x22, 0x6d,
0x0a, 0x15, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x53, 0x74, 0x61,
0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x75, 0x72, 0x72, 0x65,
0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e,
0x74, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x75,
0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08,
0x52, 0x0b, 0x75, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x22, 0x44, 0x0a,
0x11, 0x4b, 0x6d, 0x73, 0x67, 0x4c, 0x6f, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x70,
0x65, 0x63, 0x12, 0x2f, 0x0a, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x2e, 0x55, 0x52, 0x4c, 0x52, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x22, 0xb1, 0x01, 0x0a, 0x11, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53,
0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x4b, 0x0a, 0x05, 0x73, 0x74, 0x61,
0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x74, 0x61, 0x6c, 0x6f, 0x73,
0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x52, 0x75, 0x6e, 0x74,
0x69, 0x6d, 0x65, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x67, 0x65, 0x52,
0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x12, 0x4f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x2e, 0x72,
0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x4d, 0x61, 0x63, 0x68,
0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52,
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x8a, 0x01, 0x0a, 0x13, 0x4d, 0x61, 0x63, 0x68,
0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12,
0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05,
0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x5d, 0x0a, 0x10, 0x75, 0x6e, 0x6d, 0x65, 0x74, 0x5f, 0x63,
0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x32, 0x2e, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x72, 0x75, 0x6e,
0x74, 0x69, 0x6d, 0x65, 0x2e, 0x55, 0x6e, 0x6d, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74,
0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x75, 0x6e, 0x6d, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x1c, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x6e,
0x61, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69,
0x67, 0x53, 0x70, 0x65, 0x63, 0x12, 0x25, 0x0a, 0x0e, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x5f,
0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6c,
0x69, 0x73, 0x74, 0x65, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3e, 0x0a, 0x13,
0x72, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73,
0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
0x6f, 0x6e, 0x2e, 0x4e, 0x65, 0x74, 0x49, 0x50, 0x52, 0x12, 0x72, 0x65, 0x61, 0x63, 0x68, 0x61,
0x62, 0x6c, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0x23, 0x0a, 0x0b,
0x4d, 0x65, 0x74, 0x61, 0x4b, 0x65, 0x79, 0x53, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
0x65, 0x22, 0x24, 0x0a, 0x0e, 0x4d, 0x65, 0x74, 0x61, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x53,
0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x08, 0x52, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x22, 0xd5, 0x01, 0x0a, 0x0f, 0x4d, 0x6f, 0x75, 0x6e,
0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x73,
0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75,
0x72, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x66,
0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d,
0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18,
0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c,
0x0a, 0x09, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28,
0x08, 0x52, 0x09, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x12, 0x31, 0x0a, 0x14,
0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69,
0x64, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x65, 0x6e, 0x63, 0x72,
0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x22,
0xf5, 0x01, 0x0a, 0x14, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4d, 0x65, 0x74, 0x61,
0x64, 0x61, 0x74, 0x61, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74,
0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74,
0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65,
0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x7a, 0x6f, 0x6e, 0x65,
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x7a, 0x6f, 0x6e, 0x65, 0x12, 0x23, 0x0a, 0x0d,
0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x79, 0x70,
0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64,
0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65,
0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x69,
0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x6f, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28,
0x08, 0x52, 0x04, 0x73, 0x70, 0x6f, 0x74, 0x22, 0xb2, 0x01, 0x0a, 0x11, 0x53, 0x65, 0x63, 0x75,
0x72, 0x69, 0x74, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1f, 0x0a,
0x0b, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01,
0x28, 0x08, 0x52, 0x0a, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x42, 0x6f, 0x6f, 0x74, 0x12, 0x3d,
0x0a, 0x1b, 0x75, 0x6b, 0x69, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x6b, 0x65,
0x79, 0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x18, 0x75, 0x6b, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x4b,
0x65, 0x79, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x12, 0x3d, 0x0a,
0x1b, 0x70, 0x63, 0x72, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x6b, 0x65, 0x79,
0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x18, 0x70, 0x63, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x4b, 0x65,
0x79, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x22, 0x2e, 0x0a, 0x16,
0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x54, 0x6f, 0x6b,
0x65, 0x6e, 0x53, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x3c, 0x0a, 0x0e,
0x55, 0x6e, 0x6d, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12,
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x69, 0x64, 0x65, 0x72, 0x6f, 0x6c,
0x61, 0x62, 0x73, 0x2f, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6d, 0x61,
0x63, 0x68, 0x69, 0x6e, 0x65, 0x72, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -1279,31 +1288,31 @@ func file_resource_definitions_runtime_runtime_proto_rawDescGZIP() []byte {
var file_resource_definitions_runtime_runtime_proto_msgTypes = make([]protoimpl.MessageInfo, 19)
var file_resource_definitions_runtime_runtime_proto_goTypes = []interface{}{
(*DevicesStatusSpec)(nil), // 0: talos.resource.definitions.runtime.DevicesStatusSpec
(*EventSinkConfigSpec)(nil), // 1: talos.resource.definitions.runtime.EventSinkConfigSpec
(*ExtensionServicesConfigFile)(nil), // 2: talos.resource.definitions.runtime.ExtensionServicesConfigFile
(*ExtensionServicesConfigSpec)(nil), // 3: talos.resource.definitions.runtime.ExtensionServicesConfigSpec
(*ExtensionServicesConfigStatusSpec)(nil), // 4: talos.resource.definitions.runtime.ExtensionServicesConfigStatusSpec
(*KernelModuleSpecSpec)(nil), // 5: talos.resource.definitions.runtime.KernelModuleSpecSpec
(*KernelParamSpecSpec)(nil), // 6: talos.resource.definitions.runtime.KernelParamSpecSpec
(*KernelParamStatusSpec)(nil), // 7: talos.resource.definitions.runtime.KernelParamStatusSpec
(*KmsgLogConfigSpec)(nil), // 8: talos.resource.definitions.runtime.KmsgLogConfigSpec
(*MachineStatusSpec)(nil), // 9: talos.resource.definitions.runtime.MachineStatusSpec
(*MachineStatusStatus)(nil), // 10: talos.resource.definitions.runtime.MachineStatusStatus
(*MaintenanceServiceConfigSpec)(nil), // 11: talos.resource.definitions.runtime.MaintenanceServiceConfigSpec
(*MetaKeySpec)(nil), // 12: talos.resource.definitions.runtime.MetaKeySpec
(*MetaLoadedSpec)(nil), // 13: talos.resource.definitions.runtime.MetaLoadedSpec
(*MountStatusSpec)(nil), // 14: talos.resource.definitions.runtime.MountStatusSpec
(*PlatformMetadataSpec)(nil), // 15: talos.resource.definitions.runtime.PlatformMetadataSpec
(*SecurityStateSpec)(nil), // 16: talos.resource.definitions.runtime.SecurityStateSpec
(*UniqueMachineTokenSpec)(nil), // 17: talos.resource.definitions.runtime.UniqueMachineTokenSpec
(*UnmetCondition)(nil), // 18: talos.resource.definitions.runtime.UnmetCondition
(*common.URL)(nil), // 19: common.URL
(enums.RuntimeMachineStage)(0), // 20: talos.resource.definitions.enums.RuntimeMachineStage
(*common.NetIP)(nil), // 21: common.NetIP
(*DevicesStatusSpec)(nil), // 0: talos.resource.definitions.runtime.DevicesStatusSpec
(*EventSinkConfigSpec)(nil), // 1: talos.resource.definitions.runtime.EventSinkConfigSpec
(*ExtensionServiceConfigFile)(nil), // 2: talos.resource.definitions.runtime.ExtensionServiceConfigFile
(*ExtensionServiceConfigSpec)(nil), // 3: talos.resource.definitions.runtime.ExtensionServiceConfigSpec
(*ExtensionServiceConfigStatusSpec)(nil), // 4: talos.resource.definitions.runtime.ExtensionServiceConfigStatusSpec
(*KernelModuleSpecSpec)(nil), // 5: talos.resource.definitions.runtime.KernelModuleSpecSpec
(*KernelParamSpecSpec)(nil), // 6: talos.resource.definitions.runtime.KernelParamSpecSpec
(*KernelParamStatusSpec)(nil), // 7: talos.resource.definitions.runtime.KernelParamStatusSpec
(*KmsgLogConfigSpec)(nil), // 8: talos.resource.definitions.runtime.KmsgLogConfigSpec
(*MachineStatusSpec)(nil), // 9: talos.resource.definitions.runtime.MachineStatusSpec
(*MachineStatusStatus)(nil), // 10: talos.resource.definitions.runtime.MachineStatusStatus
(*MaintenanceServiceConfigSpec)(nil), // 11: talos.resource.definitions.runtime.MaintenanceServiceConfigSpec
(*MetaKeySpec)(nil), // 12: talos.resource.definitions.runtime.MetaKeySpec
(*MetaLoadedSpec)(nil), // 13: talos.resource.definitions.runtime.MetaLoadedSpec
(*MountStatusSpec)(nil), // 14: talos.resource.definitions.runtime.MountStatusSpec
(*PlatformMetadataSpec)(nil), // 15: talos.resource.definitions.runtime.PlatformMetadataSpec
(*SecurityStateSpec)(nil), // 16: talos.resource.definitions.runtime.SecurityStateSpec
(*UniqueMachineTokenSpec)(nil), // 17: talos.resource.definitions.runtime.UniqueMachineTokenSpec
(*UnmetCondition)(nil), // 18: talos.resource.definitions.runtime.UnmetCondition
(*common.URL)(nil), // 19: common.URL
(enums.RuntimeMachineStage)(0), // 20: talos.resource.definitions.enums.RuntimeMachineStage
(*common.NetIP)(nil), // 21: common.NetIP
}
var file_resource_definitions_runtime_runtime_proto_depIdxs = []int32{
2, // 0: talos.resource.definitions.runtime.ExtensionServicesConfigSpec.files:type_name -> talos.resource.definitions.runtime.ExtensionServicesConfigFile
2, // 0: talos.resource.definitions.runtime.ExtensionServiceConfigSpec.files:type_name -> talos.resource.definitions.runtime.ExtensionServiceConfigFile
19, // 1: talos.resource.definitions.runtime.KmsgLogConfigSpec.destinations:type_name -> common.URL
20, // 2: talos.resource.definitions.runtime.MachineStatusSpec.stage:type_name -> talos.resource.definitions.enums.RuntimeMachineStage
10, // 3: talos.resource.definitions.runtime.MachineStatusSpec.status:type_name -> talos.resource.definitions.runtime.MachineStatusStatus
@ -1347,7 +1356,7 @@ func file_resource_definitions_runtime_runtime_proto_init() {
}
}
file_resource_definitions_runtime_runtime_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExtensionServicesConfigFile); i {
switch v := v.(*ExtensionServiceConfigFile); i {
case 0:
return &v.state
case 1:
@ -1359,7 +1368,7 @@ func file_resource_definitions_runtime_runtime_proto_init() {
}
}
file_resource_definitions_runtime_runtime_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExtensionServicesConfigSpec); i {
switch v := v.(*ExtensionServiceConfigSpec); i {
case 0:
return &v.state
case 1:
@ -1371,7 +1380,7 @@ func file_resource_definitions_runtime_runtime_proto_init() {
}
}
file_resource_definitions_runtime_runtime_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExtensionServicesConfigStatusSpec); i {
switch v := v.(*ExtensionServiceConfigStatusSpec); i {
case 0:
return &v.state
case 1:

View File

@ -106,7 +106,7 @@ func (m *EventSinkConfigSpec) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
func (m *ExtensionServicesConfigFile) MarshalVT() (dAtA []byte, err error) {
func (m *ExtensionServiceConfigFile) MarshalVT() (dAtA []byte, err error) {
if m == nil {
return nil, nil
}
@ -119,12 +119,12 @@ func (m *ExtensionServicesConfigFile) MarshalVT() (dAtA []byte, err error) {
return dAtA[:n], nil
}
func (m *ExtensionServicesConfigFile) MarshalToVT(dAtA []byte) (int, error) {
func (m *ExtensionServiceConfigFile) MarshalToVT(dAtA []byte) (int, error) {
size := m.SizeVT()
return m.MarshalToSizedBufferVT(dAtA[:size])
}
func (m *ExtensionServicesConfigFile) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
func (m *ExtensionServiceConfigFile) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
if m == nil {
return 0, nil
}
@ -153,7 +153,7 @@ func (m *ExtensionServicesConfigFile) MarshalToSizedBufferVT(dAtA []byte) (int,
return len(dAtA) - i, nil
}
func (m *ExtensionServicesConfigSpec) MarshalVT() (dAtA []byte, err error) {
func (m *ExtensionServiceConfigSpec) MarshalVT() (dAtA []byte, err error) {
if m == nil {
return nil, nil
}
@ -166,12 +166,12 @@ func (m *ExtensionServicesConfigSpec) MarshalVT() (dAtA []byte, err error) {
return dAtA[:n], nil
}
func (m *ExtensionServicesConfigSpec) MarshalToVT(dAtA []byte) (int, error) {
func (m *ExtensionServiceConfigSpec) MarshalToVT(dAtA []byte) (int, error) {
size := m.SizeVT()
return m.MarshalToSizedBufferVT(dAtA[:size])
}
func (m *ExtensionServicesConfigSpec) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
func (m *ExtensionServiceConfigSpec) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
if m == nil {
return 0, nil
}
@ -183,6 +183,15 @@ func (m *ExtensionServicesConfigSpec) MarshalToSizedBufferVT(dAtA []byte) (int,
i -= len(m.unknownFields)
copy(dAtA[i:], m.unknownFields)
}
if len(m.Environment) > 0 {
for iNdEx := len(m.Environment) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Environment[iNdEx])
copy(dAtA[i:], m.Environment[iNdEx])
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Environment[iNdEx])))
i--
dAtA[i] = 0x12
}
}
if len(m.Files) > 0 {
for iNdEx := len(m.Files) - 1; iNdEx >= 0; iNdEx-- {
size, err := m.Files[iNdEx].MarshalToSizedBufferVT(dAtA[:i])
@ -192,13 +201,13 @@ func (m *ExtensionServicesConfigSpec) MarshalToSizedBufferVT(dAtA []byte) (int,
i -= size
i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
i--
dAtA[i] = 0x12
dAtA[i] = 0xa
}
}
return len(dAtA) - i, nil
}
func (m *ExtensionServicesConfigStatusSpec) MarshalVT() (dAtA []byte, err error) {
func (m *ExtensionServiceConfigStatusSpec) MarshalVT() (dAtA []byte, err error) {
if m == nil {
return nil, nil
}
@ -211,12 +220,12 @@ func (m *ExtensionServicesConfigStatusSpec) MarshalVT() (dAtA []byte, err error)
return dAtA[:n], nil
}
func (m *ExtensionServicesConfigStatusSpec) MarshalToVT(dAtA []byte) (int, error) {
func (m *ExtensionServiceConfigStatusSpec) MarshalToVT(dAtA []byte) (int, error) {
size := m.SizeVT()
return m.MarshalToSizedBufferVT(dAtA[:size])
}
func (m *ExtensionServicesConfigStatusSpec) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
func (m *ExtensionServiceConfigStatusSpec) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
if m == nil {
return 0, nil
}
@ -1046,7 +1055,7 @@ func (m *EventSinkConfigSpec) SizeVT() (n int) {
return n
}
func (m *ExtensionServicesConfigFile) SizeVT() (n int) {
func (m *ExtensionServiceConfigFile) SizeVT() (n int) {
if m == nil {
return 0
}
@ -1064,7 +1073,7 @@ func (m *ExtensionServicesConfigFile) SizeVT() (n int) {
return n
}
func (m *ExtensionServicesConfigSpec) SizeVT() (n int) {
func (m *ExtensionServiceConfigSpec) SizeVT() (n int) {
if m == nil {
return 0
}
@ -1076,11 +1085,17 @@ func (m *ExtensionServicesConfigSpec) SizeVT() (n int) {
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
}
}
if len(m.Environment) > 0 {
for _, s := range m.Environment {
l = len(s)
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
}
}
n += len(m.unknownFields)
return n
}
func (m *ExtensionServicesConfigStatusSpec) SizeVT() (n int) {
func (m *ExtensionServiceConfigStatusSpec) SizeVT() (n int) {
if m == nil {
return 0
}
@ -1548,7 +1563,7 @@ func (m *EventSinkConfigSpec) UnmarshalVT(dAtA []byte) error {
}
return nil
}
func (m *ExtensionServicesConfigFile) UnmarshalVT(dAtA []byte) error {
func (m *ExtensionServiceConfigFile) UnmarshalVT(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@ -1571,10 +1586,10 @@ func (m *ExtensionServicesConfigFile) UnmarshalVT(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: ExtensionServicesConfigFile: wiretype end group for non-group")
return fmt.Errorf("proto: ExtensionServiceConfigFile: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ExtensionServicesConfigFile: illegal tag %d (wire type %d)", fieldNum, wire)
return fmt.Errorf("proto: ExtensionServiceConfigFile: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
@ -1663,7 +1678,7 @@ func (m *ExtensionServicesConfigFile) UnmarshalVT(dAtA []byte) error {
}
return nil
}
func (m *ExtensionServicesConfigSpec) UnmarshalVT(dAtA []byte) error {
func (m *ExtensionServiceConfigSpec) UnmarshalVT(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@ -1686,13 +1701,13 @@ func (m *ExtensionServicesConfigSpec) UnmarshalVT(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: ExtensionServicesConfigSpec: wiretype end group for non-group")
return fmt.Errorf("proto: ExtensionServiceConfigSpec: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ExtensionServicesConfigSpec: illegal tag %d (wire type %d)", fieldNum, wire)
return fmt.Errorf("proto: ExtensionServiceConfigSpec: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 2:
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Files", wireType)
}
@ -1721,11 +1736,43 @@ func (m *ExtensionServicesConfigSpec) UnmarshalVT(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Files = append(m.Files, &ExtensionServicesConfigFile{})
m.Files = append(m.Files, &ExtensionServiceConfigFile{})
if err := m.Files[len(m.Files)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Environment", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protohelpers.ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protohelpers.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protohelpers.ErrInvalidLength
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Environment = append(m.Environment, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := protohelpers.Skip(dAtA[iNdEx:])
@ -1748,7 +1795,7 @@ func (m *ExtensionServicesConfigSpec) UnmarshalVT(dAtA []byte) error {
}
return nil
}
func (m *ExtensionServicesConfigStatusSpec) UnmarshalVT(dAtA []byte) error {
func (m *ExtensionServiceConfigStatusSpec) UnmarshalVT(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@ -1771,10 +1818,10 @@ func (m *ExtensionServicesConfigStatusSpec) UnmarshalVT(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: ExtensionServicesConfigStatusSpec: wiretype end group for non-group")
return fmt.Errorf("proto: ExtensionServiceConfigStatusSpec: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ExtensionServicesConfigStatusSpec: illegal tag %d (wire type %d)", fieldNum, wire)
return fmt.Errorf("proto: ExtensionServiceConfigStatusSpec: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:

View File

@ -11,7 +11,7 @@ type Config interface {
Machine() MachineConfig
Cluster() ClusterConfig
SideroLink() SideroLinkConfig
ExtensionServicesConfig() ExtensionServicesConfigConfig
ExtensionServiceConfigs() []ExtensionServiceConfig
Runtime() RuntimeConfig
NetworkRules() NetworkRuleConfig
}

View File

@ -0,0 +1,18 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package config
// ExtensionServiceConfig is a config for extension services.
type ExtensionServiceConfig interface {
Name() string
ConfigFiles() []ExtensionServiceConfigFile
Environment() []string
}
// ExtensionServiceConfigFile is a config file for extension services.
type ExtensionServiceConfigFile interface {
Content() string
MountPath() string
}

View File

@ -1,22 +0,0 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package config
// ExtensionServicesConfigConfig is a config for extension services.
type ExtensionServicesConfigConfig interface {
ConfigData() []ExtensionServicesConfig
}
// ExtensionServicesConfig is a config for extension services.
type ExtensionServicesConfig interface {
Name() string
ConfigFiles() []ExtensionServicesConfigFile
}
// ExtensionServicesConfigFile is a config file for extension services.
type ExtensionServicesConfigFile interface {
Content() string
Path() string
}

View File

@ -293,14 +293,14 @@ omit: false
name: "misspelled apiVersion",
source: []byte(`---
apiversion: v1alpha1
kind: ExtensionServicesConfig
kind: ExtensionServiceConfig
config:
- name: nut-client
configFiles:
- content: MONITOR ${upsmonHost} 1 remote pass foo
mountPath: /usr/local/etc/nut/upsmon.conf
`),
expectedErr: "\"ExtensionServicesConfig\" \"\": not registered",
expectedErr: "\"ExtensionServiceConfig\" \"\": not registered",
},
}

View File

@ -1,7 +1,6 @@
apiVersion: v1alpha1
kind: ExtensionServicesConfig
config:
- name: foo
configFiles:
- content: hello
mountPath: /etc/foo
kind: ExtensionServiceConfig
name: foo
configFiles:
- content: hello
mountPath: /etc/foo

View File

@ -151,14 +151,9 @@ func (container *Container) SideroLink() config.SideroLinkConfig {
return matching[0]
}
// ExtensionServicesConfig implements config.Config interface.
func (container *Container) ExtensionServicesConfig() config.ExtensionServicesConfigConfig {
matching := findMatchingDocs[config.ExtensionServicesConfigConfig](container.documents)
if len(matching) == 0 {
return nil
}
return matching[0]
// ExtensionServiceConfigs implements config.Config interface.
func (container *Container) ExtensionServiceConfigs() []config.ExtensionServiceConfig {
return findMatchingDocs[config.ExtensionServiceConfig](container.documents)
}
// Runtime implements config.Config interface.

View File

@ -16,7 +16,7 @@ import (
"github.com/siderolabs/talos/pkg/machinery/config/config"
"github.com/siderolabs/talos/pkg/machinery/config/configloader"
"github.com/siderolabs/talos/pkg/machinery/config/container"
"github.com/siderolabs/talos/pkg/machinery/config/types/extensionservicesconfig"
"github.com/siderolabs/talos/pkg/machinery/config/types/runtime/extensions"
"github.com/siderolabs/talos/pkg/machinery/config/types/siderolink"
"github.com/siderolabs/talos/pkg/machinery/config/types/v1alpha1"
)
@ -38,16 +38,12 @@ func TestNew(t *testing.T) {
sideroLinkCfg := siderolink.NewConfigV1Alpha1()
sideroLinkCfg.APIUrlConfig.URL = must.Value(url.Parse("https://siderolink.api/join?jointoken=secret&user=alice"))(t)
extensionsCfg := extensionservicesconfig.NewExtensionServicesConfigV1Alpha1()
extensionsCfg.Config = []extensionservicesconfig.ExtensionServiceConfig{
extensionsCfg := extensions.NewServicesConfigV1Alpha1()
extensionsCfg.ServiceName = "test-extension"
extensionsCfg.ServiceConfigFiles = []extensions.ConfigFile{
{
ExtensionName: "test-extension",
ExtensionServiceConfigFiles: []extensionservicesconfig.ExtensionServiceConfigFile{
{
ExtensionContent: "test",
ExtensionMountPath: "/etc/test",
},
},
ConfigFileContent: "test",
ConfigFileMountPath: "/etc/test",
},
}
@ -59,7 +55,7 @@ func TestNew(t *testing.T) {
assert.True(t, cfg.Machine().Features().RBACEnabled())
assert.Equal(t, "topsecret", cfg.Cluster().Secret())
assert.Equal(t, "https://siderolink.api/join?jointoken=secret&user=alice", cfg.SideroLink().APIUrl().String())
assert.Equal(t, "test-extension", cfg.ExtensionServicesConfig().ConfigData()[0].Name())
assert.Equal(t, "test-extension", cfg.ExtensionServiceConfigs()[0].Name())
assert.Same(t, v1alpha1Cfg, cfg.RawV1Alpha1())
assert.Equal(t, []config.Document{v1alpha1Cfg, sideroLinkCfg, extensionsCfg}, cfg.Documents())

View File

@ -2,6 +2,82 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://talos.dev/v1.7/schemas/config.schema.json",
"$defs": {
"extensions.ConfigFile": {
"properties": {
"content": {
"type": "string",
"title": "content",
"description": "The content of the extension service config file.\n",
"markdownDescription": "The content of the extension service config file.",
"x-intellij-html-description": "\u003cp\u003eThe content of the extension service config file.\u003c/p\u003e\n"
},
"mountPath": {
"type": "string",
"title": "mountPath",
"description": "The mount path of the extension service config file.\n",
"markdownDescription": "The mount path of the extension service config file.",
"x-intellij-html-description": "\u003cp\u003eThe mount path of the extension service config file.\u003c/p\u003e\n"
}
},
"additionalProperties": false,
"type": "object"
},
"extensions.ServiceConfigV1Alpha1": {
"properties": {
"apiVersion": {
"enum": [
"v1alpha1"
],
"title": "apiVersion",
"description": "apiVersion is the API version of the resource.\n",
"markdownDescription": "apiVersion is the API version of the resource.",
"x-intellij-html-description": "\u003cp\u003eapiVersion is the API version of the resource.\u003c/p\u003e\n"
},
"kind": {
"enum": [
"ExtensionServiceConfig"
],
"title": "kind",
"description": "kind is the kind of the resource.\n",
"markdownDescription": "kind is the kind of the resource.",
"x-intellij-html-description": "\u003cp\u003ekind is the kind of the resource.\u003c/p\u003e\n"
},
"name": {
"type": "string",
"title": "name",
"description": "Name of the extension service.\n",
"markdownDescription": "Name of the extension service.",
"x-intellij-html-description": "\u003cp\u003eName of the extension service.\u003c/p\u003e\n"
},
"configFiles": {
"items": {
"$ref": "#/$defs/extensions.ConfigFile"
},
"type": "array",
"title": "configFiles",
"description": "The config files for the extension service.\n",
"markdownDescription": "The config files for the extension service.",
"x-intellij-html-description": "\u003cp\u003eThe config files for the extension service.\u003c/p\u003e\n"
},
"environment": {
"items": {
"type": "string"
},
"type": "array",
"title": "environment",
"description": "The environment for the extension service.\n",
"markdownDescription": "The environment for the extension service.",
"x-intellij-html-description": "\u003cp\u003eThe environment for the extension service.\u003c/p\u003e\n"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"apiVersion",
"kind",
"name"
]
},
"network.DefaultActionConfigV1Alpha1": {
"properties": {
"apiVersion": {
@ -3204,6 +3280,9 @@
}
},
"oneOf": [
{
"$ref": "#/$defs/extensions.ServiceConfigV1Alpha1"
},
{
"$ref": "#/$defs/network.DefaultActionConfigV1Alpha1"
},

View File

@ -1,23 +0,0 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
// Code generated by "deep-copy -type V1Alpha1 -pointer-receiver -header-file ../../../../../hack/boilerplate.txt -o deep_copy.generated.go ."; DO NOT EDIT.
package extensionservicesconfig
// DeepCopy generates a deep copy of *V1Alpha1.
func (o *V1Alpha1) DeepCopy() *V1Alpha1 {
var cp V1Alpha1 = *o
if o.Config != nil {
cp.Config = make([]ExtensionServiceConfig, len(o.Config))
copy(cp.Config, o.Config)
for i2 := range o.Config {
if o.Config[i2].ExtensionServiceConfigFiles != nil {
cp.Config[i2].ExtensionServiceConfigFiles = make([]ExtensionServiceConfigFile, len(o.Config[i2].ExtensionServiceConfigFiles))
copy(cp.Config[i2].ExtensionServiceConfigFiles, o.Config[i2].ExtensionServiceConfigFiles)
}
}
}
return &cp
}

View File

@ -1,143 +0,0 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
// Package extensionservicesconfig provides extensions config documents.
package extensionservicesconfig
import (
"errors"
"fmt"
"github.com/siderolabs/gen/xslices"
"github.com/siderolabs/talos/pkg/machinery/config/config"
"github.com/siderolabs/talos/pkg/machinery/config/internal/registry"
"github.com/siderolabs/talos/pkg/machinery/config/types/meta"
"github.com/siderolabs/talos/pkg/machinery/config/validation"
)
//go:generate deep-copy -type V1Alpha1 -pointer-receiver -header-file ../../../../../hack/boilerplate.txt -o deep_copy.generated.go .
// Kind is a Extension config document kind.
const Kind = "ExtensionServicesConfig"
func init() {
registry.Register(Kind, func(version string) config.Document {
switch version {
case "v1alpha1":
return &V1Alpha1{}
default:
return nil
}
})
}
// Check interfaces.
var (
_ config.ExtensionServicesConfigConfig = &V1Alpha1{}
_ config.Document = &V1Alpha1{}
_ config.Validator = &V1Alpha1{}
)
// V1Alpha1 is a extensionservicesconfig document.
type V1Alpha1 struct {
meta.Meta `yaml:",inline"`
Config []ExtensionServiceConfig `yaml:"config"`
}
// ExtensionServiceConfig is a config for extension services.
type ExtensionServiceConfig struct {
ExtensionName string `yaml:"name"`
ExtensionServiceConfigFiles []ExtensionServiceConfigFile `yaml:"configFiles"`
}
// ExtensionServiceConfigFile is a config file for extension services.
type ExtensionServiceConfigFile struct {
ExtensionContent string `yaml:"content"`
ExtensionMountPath string `yaml:"mountPath"`
}
// NewExtensionServicesConfigV1Alpha1 creates a new siderolink config document.
func NewExtensionServicesConfigV1Alpha1() *V1Alpha1 {
return &V1Alpha1{
Meta: meta.Meta{
MetaKind: Kind,
MetaAPIVersion: "v1alpha1",
},
}
}
// Clone implements config.Document interface.
func (e *V1Alpha1) Clone() config.Document {
return e.DeepCopy()
}
// Validate implements config.Validatator interface.
func (e *V1Alpha1) Validate(validation.RuntimeMode, ...validation.Option) ([]string, error) {
if len(e.Config) == 0 {
return nil, errors.New("no extensions config found")
}
for _, ext := range e.Config {
if ext.ExtensionName == "" {
return nil, errors.New("extension name is required")
}
if len(ext.ExtensionServiceConfigFiles) == 0 {
return nil, fmt.Errorf("no config files found for extension %q", ext.ExtensionName)
}
for _, file := range ext.ExtensionServiceConfigFiles {
if file.ExtensionContent == "" {
return nil, fmt.Errorf("extension content is required for extension %q", ext.ExtensionName)
}
if file.ExtensionMountPath == "" {
return nil, fmt.Errorf("extension mount path is required for extension %q", ext.ExtensionName)
}
}
}
return nil, nil
}
// ExtensionsCfg implements config.ExtensionsConfig interface.
func (e *V1Alpha1) ExtensionsCfg() config.ExtensionServicesConfigConfig {
return e
}
// ConfigData implements config.ExtensionConfig interface.
func (e *V1Alpha1) ConfigData() []config.ExtensionServicesConfig {
return xslices.Map(e.Config, func(c ExtensionServiceConfig) config.ExtensionServicesConfig {
return &ExtensionServiceConfig{
ExtensionName: c.ExtensionName,
ExtensionServiceConfigFiles: c.ExtensionServiceConfigFiles,
}
})
}
// Name implements config.ExtensionConfig interface.
func (e *ExtensionServiceConfig) Name() string {
return e.ExtensionName
}
// ConfigFiles implements config.ExtensionConfig interface.
func (e *ExtensionServiceConfig) ConfigFiles() []config.ExtensionServicesConfigFile {
return xslices.Map(e.ExtensionServiceConfigFiles, func(c ExtensionServiceConfigFile) config.ExtensionServicesConfigFile {
return &ExtensionServiceConfigFile{
ExtensionContent: c.ExtensionContent,
ExtensionMountPath: c.ExtensionMountPath,
}
})
}
// Content implements config.ConfigFile interface.
func (e *ExtensionServiceConfigFile) Content() string {
return e.ExtensionContent
}
// Path implements config.ConfigFile interface.
func (e *ExtensionServiceConfigFile) Path() string {
return e.ExtensionMountPath
}

View File

@ -1,43 +0,0 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package extensionservicesconfig_test
import (
_ "embed"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/siderolabs/talos/pkg/machinery/config/encoder"
"github.com/siderolabs/talos/pkg/machinery/config/types/extensionservicesconfig"
)
//go:embed testdata/extension_service_config.yaml
var expectedExtensionServicesConfigDocument []byte
func TestExtensionServicesConfigMarshalStability(t *testing.T) {
t.Parallel()
cfg := extensionservicesconfig.NewExtensionServicesConfigV1Alpha1()
cfg.Config = []extensionservicesconfig.ExtensionServiceConfig{
{
ExtensionName: "foo",
ExtensionServiceConfigFiles: []extensionservicesconfig.ExtensionServiceConfigFile{
{
ExtensionContent: "hello",
ExtensionMountPath: "/etc/foo",
},
},
},
}
marshaled, err := encoder.NewEncoder(cfg, encoder.WithComments(encoder.CommentsDisabled)).Encode()
require.NoError(t, err)
t.Log(string(marshaled))
assert.Equal(t, expectedExtensionServicesConfigDocument, marshaled)
}

View File

@ -1,7 +0,0 @@
apiVersion: v1alpha1
kind: ExtensionServicesConfig
config:
- name: foo
configFiles:
- content: hello
mountPath: /etc/foo

View File

@ -0,0 +1,21 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
// Code generated by "deep-copy -type ServiceConfigV1Alpha1 -pointer-receiver -header-file ../../../../../../hack/boilerplate.txt -o deep_copy.generated.go ."; DO NOT EDIT.
package extensions
// DeepCopy generates a deep copy of *ServiceConfigV1Alpha1.
func (o *ServiceConfigV1Alpha1) DeepCopy() *ServiceConfigV1Alpha1 {
var cp ServiceConfigV1Alpha1 = *o
if o.ServiceConfigFiles != nil {
cp.ServiceConfigFiles = make([]ConfigFile, len(o.ServiceConfigFiles))
copy(cp.ServiceConfigFiles, o.ServiceConfigFiles)
}
if o.ServiceEnvironment != nil {
cp.ServiceEnvironment = make([]string, len(o.ServiceEnvironment))
copy(cp.ServiceEnvironment, o.ServiceEnvironment)
}
return &cp
}

View File

@ -0,0 +1,10 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
// Package extensions provides extensions config documents.
package extensions
//go:generate docgen -output extensions_doc.go extensions.go service_config.go
//go:generate deep-copy -type ServiceConfigV1Alpha1 -pointer-receiver -header-file ../../../../../../hack/boilerplate.txt -o deep_copy.generated.go .

View File

@ -0,0 +1,91 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
// Code generated by hack/docgen tool. DO NOT EDIT.
package extensions
import (
"github.com/siderolabs/talos/pkg/machinery/config/encoder"
)
func (ServiceConfigV1Alpha1) Doc() *encoder.Doc {
doc := &encoder.Doc{
Type: "ExtensionServiceConfig",
Comments: [3]string{"" /* encoder.HeadComment */, "ExtensionServiceConfig is a extensionserviceconfig document." /* encoder.LineComment */, "" /* encoder.FootComment */},
Description: "ExtensionServiceConfig is a extensionserviceconfig document.",
Fields: []encoder.Doc{
{},
{
Name: "name",
Type: "string",
Note: "",
Description: "Name of the extension service.",
Comments: [3]string{"" /* encoder.HeadComment */, "Name of the extension service." /* encoder.LineComment */, "" /* encoder.FootComment */},
},
{
Name: "configFiles",
Type: "[]ConfigFile",
Note: "",
Description: "The config files for the extension service.",
Comments: [3]string{"" /* encoder.HeadComment */, "The config files for the extension service." /* encoder.LineComment */, "" /* encoder.FootComment */},
},
{
Name: "environment",
Type: "[]string",
Note: "",
Description: "The environment for the extension service.",
Comments: [3]string{"" /* encoder.HeadComment */, "The environment for the extension service." /* encoder.LineComment */, "" /* encoder.FootComment */},
},
},
}
doc.AddExample("", extensionServiceConfigV1Alpha1())
return doc
}
func (ConfigFile) Doc() *encoder.Doc {
doc := &encoder.Doc{
Type: "ConfigFile",
Comments: [3]string{"" /* encoder.HeadComment */, "ConfigFile is a config file for extension services." /* encoder.LineComment */, "" /* encoder.FootComment */},
Description: "ConfigFile is a config file for extension services.",
AppearsIn: []encoder.Appearance{
{
TypeName: "ServiceConfigV1Alpha1",
FieldName: "configFiles",
},
},
Fields: []encoder.Doc{
{
Name: "content",
Type: "string",
Note: "",
Description: "The content of the extension service config file.",
Comments: [3]string{"" /* encoder.HeadComment */, "The content of the extension service config file." /* encoder.LineComment */, "" /* encoder.FootComment */},
},
{
Name: "mountPath",
Type: "string",
Note: "",
Description: "The mount path of the extension service config file.",
Comments: [3]string{"" /* encoder.HeadComment */, "The mount path of the extension service config file." /* encoder.LineComment */, "" /* encoder.FootComment */},
},
},
}
return doc
}
// GetFileDoc returns documentation for the file extensions_doc.go.
func GetFileDoc() *encoder.FileDoc {
return &encoder.FileDoc{
Name: "extensions",
Description: "Package extensions provides extensions config documents.\n",
Structs: []*encoder.Doc{
ServiceConfigV1Alpha1{}.Doc(),
ConfigFile{}.Doc(),
},
}
}

View File

@ -0,0 +1,155 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package extensions
//docgen:jsonschema
import (
"fmt"
"github.com/siderolabs/gen/xslices"
"github.com/siderolabs/talos/pkg/machinery/config/config"
"github.com/siderolabs/talos/pkg/machinery/config/internal/registry"
"github.com/siderolabs/talos/pkg/machinery/config/types/meta"
"github.com/siderolabs/talos/pkg/machinery/config/validation"
)
// ServiceConfigKind is a Extension config document kind.
const ServiceConfigKind = "ExtensionServiceConfig"
func init() {
registry.Register(ServiceConfigKind, func(version string) config.Document {
switch version {
case "v1alpha1":
return &ServiceConfigV1Alpha1{}
default:
return nil
}
})
}
// Check interfaces.
var (
_ config.ExtensionServiceConfig = &ServiceConfigV1Alpha1{}
_ config.Document = &ServiceConfigV1Alpha1{}
_ config.Validator = &ServiceConfigV1Alpha1{}
)
// ServiceConfigV1Alpha1 is a extensionserviceconfig document.
//
// examples:
// - value: extensionServiceConfigV1Alpha1()
// alias: ExtensionServiceConfig
// schemaRoot: true
// schemaMeta: v1alpha1/ExtensionServiceConfig
type ServiceConfigV1Alpha1 struct {
meta.Meta `yaml:",inline"`
// description: |
// Name of the extension service.
// schemaRequired: true
ServiceName string `yaml:"name"`
// description: |
// The config files for the extension service.
ServiceConfigFiles []ConfigFile `yaml:"configFiles,omitempty"`
// description: |
// The environment for the extension service.
ServiceEnvironment []string `yaml:"environment,omitempty"`
}
// ConfigFile is a config file for extension services.
type ConfigFile struct {
// description: |
// The content of the extension service config file.
ConfigFileContent string `yaml:"content"`
// description: |
// The mount path of the extension service config file.
ConfigFileMountPath string `yaml:"mountPath"`
}
// NewServicesConfigV1Alpha1 creates a new siderolink config document.
func NewServicesConfigV1Alpha1() *ServiceConfigV1Alpha1 {
return &ServiceConfigV1Alpha1{
Meta: meta.Meta{
MetaKind: ServiceConfigKind,
MetaAPIVersion: "v1alpha1",
},
}
}
// Clone implements config.Document interface.
func (e *ServiceConfigV1Alpha1) Clone() config.Document {
return e.DeepCopy()
}
// Validate implements config.Validatator interface.
func (e *ServiceConfigV1Alpha1) Validate(validation.RuntimeMode, ...validation.Option) ([]string, error) {
if e.ServiceName == "" {
return nil, fmt.Errorf("name is required")
}
if len(e.ServiceConfigFiles) == 0 && len(e.ServiceEnvironment) == 0 {
if len(e.ServiceConfigFiles) == 0 {
return nil, fmt.Errorf("no config files found for extension %q", e.ServiceName)
}
if len(e.ServiceEnvironment) == 0 {
return nil, fmt.Errorf("no environment defined for extension %q", e.ServiceName)
}
}
for _, file := range e.ServiceConfigFiles {
if file.ConfigFileContent == "" {
return nil, fmt.Errorf("extension content is required for extension %q", e.ServiceName)
}
if file.ConfigFileMountPath == "" {
return nil, fmt.Errorf("extension mount path is required for extension %q", e.ServiceName)
}
}
return nil, nil
}
// Name implements config.ExtensionServiceConfig interface.
func (e *ServiceConfigV1Alpha1) Name() string {
return e.ServiceName
}
// ConfigFiles implements config.ExtensionServiceConfig interface.
func (e *ServiceConfigV1Alpha1) ConfigFiles() []config.ExtensionServiceConfigFile {
return xslices.Map(e.ServiceConfigFiles, func(c ConfigFile) config.ExtensionServiceConfigFile {
return c
})
}
// Environment implements config.ExtensionServiceConfig interface.
func (e *ServiceConfigV1Alpha1) Environment() []string {
return e.ServiceEnvironment
}
// Content implements config.ExtensionServiceConfigFile interface.
func (e ConfigFile) Content() string {
return e.ConfigFileContent
}
// MountPath implements config.ExtensionServiceConfigFile interface.
func (e ConfigFile) MountPath() string {
return e.ConfigFileMountPath
}
func extensionServiceConfigV1Alpha1() *ServiceConfigV1Alpha1 {
cfg := NewServicesConfigV1Alpha1()
cfg.ServiceName = "nut-client"
cfg.ServiceConfigFiles = []ConfigFile{
{
ConfigFileContent: "MONITOR ${upsmonHost} 1 remote username password",
ConfigFileMountPath: "/usr/local/etc/nut/upsmon.conf",
},
}
cfg.ServiceEnvironment = []string{"NUT_UPS=upsname"}
return cfg
}

View File

@ -0,0 +1,40 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package extensions_test
import (
_ "embed"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/siderolabs/talos/pkg/machinery/config/encoder"
"github.com/siderolabs/talos/pkg/machinery/config/types/runtime/extensions"
)
//go:embed testdata/extension_service_config.yaml
var expectedExtensionServiceConfigDocument []byte
func TestExtensionServiceConfigMarshalStability(t *testing.T) {
t.Parallel()
cfg := extensions.NewServicesConfigV1Alpha1()
cfg.ServiceName = "foo"
cfg.ServiceConfigFiles = []extensions.ConfigFile{
{
ConfigFileContent: "hello",
ConfigFileMountPath: "/etc/foo",
},
}
cfg.ServiceEnvironment = []string{"FOO=BAR"}
marshaled, err := encoder.NewEncoder(cfg, encoder.WithComments(encoder.CommentsDisabled)).Encode()
require.NoError(t, err)
t.Log(string(marshaled))
assert.Equal(t, expectedExtensionServiceConfigDocument, marshaled)
}

View File

@ -0,0 +1,8 @@
apiVersion: v1alpha1
kind: ExtensionServiceConfig
name: foo
configFiles:
- content: hello
mountPath: /etc/foo
environment:
- FOO=BAR

View File

@ -6,9 +6,9 @@
package types
import (
_ "github.com/siderolabs/talos/pkg/machinery/config/types/extensionservicesconfig" // import config types to register them
_ "github.com/siderolabs/talos/pkg/machinery/config/types/network" // import config types to register them
_ "github.com/siderolabs/talos/pkg/machinery/config/types/runtime" // import config types to register them
_ "github.com/siderolabs/talos/pkg/machinery/config/types/siderolink" // import config types to register them
_ "github.com/siderolabs/talos/pkg/machinery/config/types/v1alpha1" // import config types to register them
_ "github.com/siderolabs/talos/pkg/machinery/config/types/network" // import config types to register them
_ "github.com/siderolabs/talos/pkg/machinery/config/types/runtime" // import config types to register them
_ "github.com/siderolabs/talos/pkg/machinery/config/types/runtime/extensions" // import config types to register them
_ "github.com/siderolabs/talos/pkg/machinery/config/types/siderolink" // import config types to register them
_ "github.com/siderolabs/talos/pkg/machinery/config/types/v1alpha1" // import config types to register them
)

View File

@ -850,16 +850,16 @@ const (
// FirmwarePath is the path to the standard Linux firmware location.
FirmwarePath = "/lib/firmware"
// ExtensionServicesConfigPath is the directory path which contains configuration files of extension services.
// ExtensionServiceConfigPath is the directory path which contains configuration files of extension services.
//
// See pkg/machinery/extensions/services for the file format.
ExtensionServicesConfigPath = "/usr/local/etc/containers"
ExtensionServiceConfigPath = "/usr/local/etc/containers"
// ExtensionServicesRootfsPath is the path to the extracted rootfs files of extension services.
ExtensionServicesRootfsPath = "/usr/local/lib/containers"
// ExtensionServiceRootfsPath is the path to the extracted rootfs files of extension services.
ExtensionServiceRootfsPath = "/usr/local/lib/containers"
// ExtensionServicesUserConfigPath is the path to the user provider extension services config directory.
ExtensionServicesUserConfigPath = SystemOverlaysPath + "/extensions"
// ExtensionServiceUserConfigPath is the path to the user provided extension services config directory.
ExtensionServiceUserConfigPath = SystemOverlaysPath + "/extensions"
// DBusServiceSocketPath is the path to the D-Bus socket for the logind mock to connect to.
DBusServiceSocketPath = SystemRunPath + "/dbus/service.socket"

View File

@ -80,7 +80,7 @@ func (condition *ExtensionServiceConfigStatusCondition) String() string {
func (condition *ExtensionServiceConfigStatusCondition) Wait(ctx context.Context) error {
_, err := condition.state.WatchFor(
ctx,
resource.NewMetadata(NamespaceName, ExtensionServicesConfigStatusType, condition.serviceName, resource.VersionUndefined),
resource.NewMetadata(NamespaceName, ExtensionServiceConfigStatusType, condition.serviceName, resource.VersionUndefined),
state.WithEventTypes(state.Created, state.Updated),
)

View File

@ -2,7 +2,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
// Code generated by "deep-copy -type DevicesStatusSpec -type EventSinkConfigSpec -type ExtensionServicesConfigSpec -type ExtensionServicesConfigStatusSpec -type KernelModuleSpecSpec -type KernelParamSpecSpec -type KernelParamStatusSpec -type KmsgLogConfigSpec -type MaintenanceServiceConfigSpec -type MaintenanceServiceRequestSpec -type MachineResetSignalSpec -type MachineStatusSpec -type MetaKeySpec -type MountStatusSpec -type PlatformMetadataSpec -type SecurityStateSpec -type MetaLoadedSpec -type UniqueMachineTokenSpec -header-file ../../../../hack/boilerplate.txt -o deep_copy.generated.go ."; DO NOT EDIT.
// Code generated by "deep-copy -type DevicesStatusSpec -type EventSinkConfigSpec -type ExtensionServiceConfigSpec -type ExtensionServiceConfigStatusSpec -type KernelModuleSpecSpec -type KernelParamSpecSpec -type KernelParamStatusSpec -type KmsgLogConfigSpec -type MaintenanceServiceConfigSpec -type MaintenanceServiceRequestSpec -type MachineResetSignalSpec -type MachineStatusSpec -type MetaKeySpec -type MountStatusSpec -type PlatformMetadataSpec -type SecurityStateSpec -type MetaLoadedSpec -type UniqueMachineTokenSpec -header-file ../../../../hack/boilerplate.txt -o deep_copy.generated.go ."; DO NOT EDIT.
package runtime
@ -23,19 +23,23 @@ func (o EventSinkConfigSpec) DeepCopy() EventSinkConfigSpec {
return cp
}
// DeepCopy generates a deep copy of ExtensionServicesConfigSpec.
func (o ExtensionServicesConfigSpec) DeepCopy() ExtensionServicesConfigSpec {
var cp ExtensionServicesConfigSpec = o
// DeepCopy generates a deep copy of ExtensionServiceConfigSpec.
func (o ExtensionServiceConfigSpec) DeepCopy() ExtensionServiceConfigSpec {
var cp ExtensionServiceConfigSpec = o
if o.Files != nil {
cp.Files = make([]ExtensionServicesConfigFile, len(o.Files))
cp.Files = make([]ExtensionServiceConfigFile, len(o.Files))
copy(cp.Files, o.Files)
}
if o.Environment != nil {
cp.Environment = make([]string, len(o.Environment))
copy(cp.Environment, o.Environment)
}
return cp
}
// DeepCopy generates a deep copy of ExtensionServicesConfigStatusSpec.
func (o ExtensionServicesConfigStatusSpec) DeepCopy() ExtensionServicesConfigStatusSpec {
var cp ExtensionServicesConfigStatusSpec = o
// DeepCopy generates a deep copy of ExtensionServiceConfigStatusSpec.
func (o ExtensionServiceConfigStatusSpec) DeepCopy() ExtensionServiceConfigStatusSpec {
var cp ExtensionServiceConfigStatusSpec = o
return cp
}

View File

@ -13,42 +13,43 @@ import (
"github.com/siderolabs/talos/pkg/machinery/proto"
)
// ExtensionServicesConfigType is a type of ExtensionServicesConfig.
const ExtensionServicesConfigType = resource.Type("ExtensionServicesConfigs.runtime.talos.dev")
// ExtensionServiceConfigType is a type of ExtensionServiceConfig.
const ExtensionServiceConfigType = resource.Type("ExtensionServiceConfigs.runtime.talos.dev")
// ExtensionServicesConfig represents a resource that describes status of rendered extensions service config files.
type ExtensionServicesConfig = typed.Resource[ExtensionServicesConfigSpec, ExtensionServicesConfigExtension]
// ExtensionServiceConfig represents a resource that describes status of rendered extensions service config files.
type ExtensionServiceConfig = typed.Resource[ExtensionServiceConfigSpec, ExtensionServiceConfigExtension]
// ExtensionServicesConfigSpec describes status of rendered extensions service config files.
// ExtensionServiceConfigSpec describes status of rendered extensions service config files.
//
//gotagsrewrite:gen
type ExtensionServicesConfigSpec struct {
Files []ExtensionServicesConfigFile `yaml:"files" protobuf:"2"`
type ExtensionServiceConfigSpec struct {
Files []ExtensionServiceConfigFile `yaml:"files,omitempty" protobuf:"1"`
Environment []string `yaml:"environment,omitempty" protobuf:"2"`
}
// ExtensionServicesConfigFile describes extensions service config files.
// ExtensionServiceConfigFile describes extensions service config files.
//
//gotagsrewrite:gen
type ExtensionServicesConfigFile struct {
type ExtensionServiceConfigFile struct {
Content string `yaml:"content" protobuf:"1"`
MountPath string `yaml:"mountPath" protobuf:"2"`
}
// NewExtensionServicesConfigSpec initializes a new ExtensionServiceConfigSpec.
func NewExtensionServicesConfigSpec(namespace resource.Namespace, id resource.ID) *ExtensionServicesConfig {
return typed.NewResource[ExtensionServicesConfigSpec, ExtensionServicesConfigExtension](
resource.NewMetadata(namespace, ExtensionServicesConfigType, id, resource.VersionUndefined),
ExtensionServicesConfigSpec{},
// NewExtensionServiceConfigSpec initializes a new ExtensionServiceConfigSpec.
func NewExtensionServiceConfigSpec(namespace resource.Namespace, id resource.ID) *ExtensionServiceConfig {
return typed.NewResource[ExtensionServiceConfigSpec, ExtensionServiceConfigExtension](
resource.NewMetadata(namespace, ExtensionServiceConfigType, id, resource.VersionUndefined),
ExtensionServiceConfigSpec{},
)
}
// ExtensionServicesConfigExtension provides auxiliary methods for ExtensionServiceConfig.
type ExtensionServicesConfigExtension struct{}
// ExtensionServiceConfigExtension provides auxiliary methods for ExtensionServiceConfig.
type ExtensionServiceConfigExtension struct{}
// ResourceDefinition implements meta.ResourceDefinitionProvider interface.
func (ExtensionServicesConfigExtension) ResourceDefinition() meta.ResourceDefinitionSpec {
func (ExtensionServiceConfigExtension) ResourceDefinition() meta.ResourceDefinitionSpec {
return meta.ResourceDefinitionSpec{
Type: ExtensionServicesConfigType,
Type: ExtensionServiceConfigType,
Aliases: []resource.Type{},
DefaultNamespace: NamespaceName,
PrintColumns: []meta.PrintColumn{},
@ -58,7 +59,7 @@ func (ExtensionServicesConfigExtension) ResourceDefinition() meta.ResourceDefini
func init() {
proto.RegisterDefaultTypes()
err := protobuf.RegisterDynamic[ExtensionServicesConfigSpec](ExtensionServicesConfigType, &ExtensionServicesConfig{})
err := protobuf.RegisterDynamic[ExtensionServiceConfigSpec](ExtensionServiceConfigType, &ExtensionServiceConfig{})
if err != nil {
panic(err)
}

View File

@ -13,34 +13,34 @@ import (
"github.com/siderolabs/talos/pkg/machinery/proto"
)
// ExtensionServicesConfigStatusType is a type of ExtensionServicesConfig.
const ExtensionServicesConfigStatusType = resource.Type("ExtensionServicesConfigStatuses.runtime.talos.dev")
// ExtensionServiceConfigStatusType is a type of ExtensionServiceConfig.
const ExtensionServiceConfigStatusType = resource.Type("ExtensionServiceConfigStatuses.runtime.talos.dev")
// ExtensionServicesConfigStatus represents a resource that describes status of rendered extensions service config files.
type ExtensionServicesConfigStatus = typed.Resource[ExtensionServicesConfigStatusSpec, ExtensionServicesConfigStatusExtension]
// ExtensionServiceConfigStatus represents a resource that describes status of rendered extensions service config files.
type ExtensionServiceConfigStatus = typed.Resource[ExtensionServiceConfigStatusSpec, ExtensionServiceConfigStatusExtension]
// ExtensionServicesConfigStatusSpec describes status of rendered extensions service config files.
// ExtensionServiceConfigStatusSpec describes status of rendered extensions service config files.
//
//gotagsrewrite:gen
type ExtensionServicesConfigStatusSpec struct {
type ExtensionServiceConfigStatusSpec struct {
SpecVersion string `yaml:"specVersion" protobuf:"1"`
}
// NewExtensionServicesConfigStatusSpec initializes a new ExtensionServicesConfigStatusSpec.
func NewExtensionServicesConfigStatusSpec(namespace resource.Namespace, id resource.ID) *ExtensionServicesConfigStatus {
return typed.NewResource[ExtensionServicesConfigStatusSpec, ExtensionServicesConfigStatusExtension](
resource.NewMetadata(namespace, ExtensionServicesConfigStatusType, id, resource.VersionUndefined),
ExtensionServicesConfigStatusSpec{},
// NewExtensionServiceConfigStatusSpec initializes a new ExtensionServiceConfigStatusSpec.
func NewExtensionServiceConfigStatusSpec(namespace resource.Namespace, id resource.ID) *ExtensionServiceConfigStatus {
return typed.NewResource[ExtensionServiceConfigStatusSpec, ExtensionServiceConfigStatusExtension](
resource.NewMetadata(namespace, ExtensionServiceConfigStatusType, id, resource.VersionUndefined),
ExtensionServiceConfigStatusSpec{},
)
}
// ExtensionServicesConfigStatusExtension provides auxiliary methods for ExtensionServiceConfig.
type ExtensionServicesConfigStatusExtension struct{}
// ExtensionServiceConfigStatusExtension provides auxiliary methods for ExtensionServiceConfig.
type ExtensionServiceConfigStatusExtension struct{}
// ResourceDefinition implements meta.ResourceDefinitionProvider interface.
func (ExtensionServicesConfigStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec {
func (ExtensionServiceConfigStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec {
return meta.ResourceDefinitionSpec{
Type: ExtensionServicesConfigStatusType,
Type: ExtensionServiceConfigStatusType,
Aliases: []resource.Type{},
DefaultNamespace: NamespaceName,
PrintColumns: []meta.PrintColumn{},
@ -50,7 +50,7 @@ func (ExtensionServicesConfigStatusExtension) ResourceDefinition() meta.Resource
func init() {
proto.RegisterDefaultTypes()
err := protobuf.RegisterDynamic[ExtensionServicesConfigStatusSpec](ExtensionServicesConfigStatusType, &ExtensionServicesConfigStatus{})
err := protobuf.RegisterDynamic[ExtensionServiceConfigStatusSpec](ExtensionServiceConfigStatusType, &ExtensionServiceConfigStatus{})
if err != nil {
panic(err)
}

View File

@ -4,4 +4,4 @@
package runtime
//go:generate deep-copy -type DevicesStatusSpec -type EventSinkConfigSpec -type ExtensionServicesConfigSpec -type ExtensionServicesConfigStatusSpec -type KernelModuleSpecSpec -type KernelParamSpecSpec -type KernelParamStatusSpec -type KmsgLogConfigSpec -type MaintenanceServiceConfigSpec -type MaintenanceServiceRequestSpec -type MachineResetSignalSpec -type MachineStatusSpec -type MetaKeySpec -type MountStatusSpec -type PlatformMetadataSpec -type SecurityStateSpec -type MetaLoadedSpec -type UniqueMachineTokenSpec -header-file ../../../../hack/boilerplate.txt -o deep_copy.generated.go .
//go:generate deep-copy -type DevicesStatusSpec -type EventSinkConfigSpec -type ExtensionServiceConfigSpec -type ExtensionServiceConfigStatusSpec -type KernelModuleSpecSpec -type KernelParamSpecSpec -type KernelParamStatusSpec -type KmsgLogConfigSpec -type MaintenanceServiceConfigSpec -type MaintenanceServiceRequestSpec -type MachineResetSignalSpec -type MachineStatusSpec -type MetaKeySpec -type MountStatusSpec -type PlatformMetadataSpec -type SecurityStateSpec -type MetaLoadedSpec -type UniqueMachineTokenSpec -header-file ../../../../hack/boilerplate.txt -o deep_copy.generated.go .

View File

@ -128,8 +128,8 @@ Available dependencies:
* `path: <path>`: wait for the `<path>` to exist
* `network: [addresses, connectivity, hostname, etcfiles]`: wait for the specified network readiness checks to succeed
* `time: true`: wait for the NTP time sync
* `configuration: true`: wait for `ExtensionServicesConfig` resource with a name matching the extension name to be available.
The mounts specified in the `ExtensionServicesConfig` will be added as extra mounts to the extension service.
* `configuration: true`: wait for `ExtensionServiceConfig` resource with a name matching the extension name to be available.
The mounts specified in the `ExtensionServiceConfig` will be added as extra mounts to the extension service.
### `restart`

View File

@ -209,9 +209,9 @@ description: Talos gRPC API reference.
- [resource/definitions/runtime/runtime.proto](#resource/definitions/runtime/runtime.proto)
- [DevicesStatusSpec](#talos.resource.definitions.runtime.DevicesStatusSpec)
- [EventSinkConfigSpec](#talos.resource.definitions.runtime.EventSinkConfigSpec)
- [ExtensionServicesConfigFile](#talos.resource.definitions.runtime.ExtensionServicesConfigFile)
- [ExtensionServicesConfigSpec](#talos.resource.definitions.runtime.ExtensionServicesConfigSpec)
- [ExtensionServicesConfigStatusSpec](#talos.resource.definitions.runtime.ExtensionServicesConfigStatusSpec)
- [ExtensionServiceConfigFile](#talos.resource.definitions.runtime.ExtensionServiceConfigFile)
- [ExtensionServiceConfigSpec](#talos.resource.definitions.runtime.ExtensionServiceConfigSpec)
- [ExtensionServiceConfigStatusSpec](#talos.resource.definitions.runtime.ExtensionServiceConfigStatusSpec)
- [KernelModuleSpecSpec](#talos.resource.definitions.runtime.KernelModuleSpecSpec)
- [KernelParamSpecSpec](#talos.resource.definitions.runtime.KernelParamSpecSpec)
- [KernelParamStatusSpec](#talos.resource.definitions.runtime.KernelParamStatusSpec)
@ -3833,10 +3833,10 @@ EventSinkConfigSpec describes configuration of Talos event log streaming.
<a name="talos.resource.definitions.runtime.ExtensionServicesConfigFile"></a>
<a name="talos.resource.definitions.runtime.ExtensionServiceConfigFile"></a>
### ExtensionServicesConfigFile
ExtensionServicesConfigFile describes extensions service config files.
### ExtensionServiceConfigFile
ExtensionServiceConfigFile describes extensions service config files.
| Field | Type | Label | Description |
@ -3849,25 +3849,26 @@ ExtensionServicesConfigFile describes extensions service config files.
<a name="talos.resource.definitions.runtime.ExtensionServicesConfigSpec"></a>
<a name="talos.resource.definitions.runtime.ExtensionServiceConfigSpec"></a>
### ExtensionServicesConfigSpec
ExtensionServicesConfigSpec describes status of rendered extensions service config files.
### ExtensionServiceConfigSpec
ExtensionServiceConfigSpec describes status of rendered extensions service config files.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| files | [ExtensionServicesConfigFile](#talos.resource.definitions.runtime.ExtensionServicesConfigFile) | repeated | |
| files | [ExtensionServiceConfigFile](#talos.resource.definitions.runtime.ExtensionServiceConfigFile) | repeated | |
| environment | [string](#string) | repeated | |
<a name="talos.resource.definitions.runtime.ExtensionServicesConfigStatusSpec"></a>
<a name="talos.resource.definitions.runtime.ExtensionServiceConfigStatusSpec"></a>
### ExtensionServicesConfigStatusSpec
ExtensionServicesConfigStatusSpec describes status of rendered extensions service config files.
### ExtensionServiceConfigStatusSpec
ExtensionServiceConfigStatusSpec describes status of rendered extensions service config files.
| Field | Type | Label | Description |

View File

@ -0,0 +1,8 @@
---
description: |
Package extensions provides extensions config documents.
title: extensions
---
<!-- markdownlint-disable -->

View File

@ -0,0 +1,57 @@
---
description: ExtensionServiceConfig is a extensionserviceconfig document.
title: ExtensionServiceConfig
---
<!-- markdownlint-disable -->
{{< highlight yaml >}}
apiVersion: v1alpha1
kind: ExtensionServiceConfig
name: nut-client # Name of the extension service.
# The config files for the extension service.
configFiles:
- content: MONITOR ${upsmonHost} 1 remote username password # The content of the extension service config file.
mountPath: /usr/local/etc/nut/upsmon.conf # The mount path of the extension service config file.
# The environment for the extension service.
environment:
- NUT_UPS=upsname
{{< /highlight >}}
| Field | Type | Description | Value(s) |
|-------|------|-------------|----------|
|`name` |string |Name of the extension service. | |
|`configFiles` |<a href="#ExtensionServiceConfig.configFiles.">[]ConfigFile</a> |The config files for the extension service. | |
|`environment` |[]string |The environment for the extension service. | |
## configFiles[] {#ExtensionServiceConfig.configFiles.}
ConfigFile is a config file for extension services.
| Field | Type | Description | Value(s) |
|-------|------|-------------|----------|
|`content` |string |The content of the extension service config file. | |
|`mountPath` |string |The mount path of the extension service config file. | |

View File

@ -2,6 +2,82 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://talos.dev/v1.7/schemas/config.schema.json",
"$defs": {
"extensions.ConfigFile": {
"properties": {
"content": {
"type": "string",
"title": "content",
"description": "The content of the extension service config file.\n",
"markdownDescription": "The content of the extension service config file.",
"x-intellij-html-description": "\u003cp\u003eThe content of the extension service config file.\u003c/p\u003e\n"
},
"mountPath": {
"type": "string",
"title": "mountPath",
"description": "The mount path of the extension service config file.\n",
"markdownDescription": "The mount path of the extension service config file.",
"x-intellij-html-description": "\u003cp\u003eThe mount path of the extension service config file.\u003c/p\u003e\n"
}
},
"additionalProperties": false,
"type": "object"
},
"extensions.ServiceConfigV1Alpha1": {
"properties": {
"apiVersion": {
"enum": [
"v1alpha1"
],
"title": "apiVersion",
"description": "apiVersion is the API version of the resource.\n",
"markdownDescription": "apiVersion is the API version of the resource.",
"x-intellij-html-description": "\u003cp\u003eapiVersion is the API version of the resource.\u003c/p\u003e\n"
},
"kind": {
"enum": [
"ExtensionServiceConfig"
],
"title": "kind",
"description": "kind is the kind of the resource.\n",
"markdownDescription": "kind is the kind of the resource.",
"x-intellij-html-description": "\u003cp\u003ekind is the kind of the resource.\u003c/p\u003e\n"
},
"name": {
"type": "string",
"title": "name",
"description": "Name of the extension service.\n",
"markdownDescription": "Name of the extension service.",
"x-intellij-html-description": "\u003cp\u003eName of the extension service.\u003c/p\u003e\n"
},
"configFiles": {
"items": {
"$ref": "#/$defs/extensions.ConfigFile"
},
"type": "array",
"title": "configFiles",
"description": "The config files for the extension service.\n",
"markdownDescription": "The config files for the extension service.",
"x-intellij-html-description": "\u003cp\u003eThe config files for the extension service.\u003c/p\u003e\n"
},
"environment": {
"items": {
"type": "string"
},
"type": "array",
"title": "environment",
"description": "The environment for the extension service.\n",
"markdownDescription": "The environment for the extension service.",
"x-intellij-html-description": "\u003cp\u003eThe environment for the extension service.\u003c/p\u003e\n"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"apiVersion",
"kind",
"name"
]
},
"network.DefaultActionConfigV1Alpha1": {
"properties": {
"apiVersion": {
@ -3204,6 +3280,9 @@
}
},
"oneOf": [
{
"$ref": "#/$defs/extensions.ServiceConfigV1Alpha1"
},
{
"$ref": "#/$defs/network.DefaultActionConfigV1Alpha1"
},