mirror of
https://github.com/siderolabs/talos.git
synced 2025-11-06 11:21:13 +01:00
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:
parent
3fe82ec461
commit
15e8bca2b2
Binary file not shown.
@ -17,19 +17,20 @@ message EventSinkConfigSpec {
|
|||||||
string endpoint = 1;
|
string endpoint = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExtensionServicesConfigFile describes extensions service config files.
|
// ExtensionServiceConfigFile describes extensions service config files.
|
||||||
message ExtensionServicesConfigFile {
|
message ExtensionServiceConfigFile {
|
||||||
string content = 1;
|
string content = 1;
|
||||||
string mount_path = 2;
|
string mount_path = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExtensionServicesConfigSpec describes status of rendered extensions service config files.
|
// ExtensionServiceConfigSpec describes status of rendered extensions service config files.
|
||||||
message ExtensionServicesConfigSpec {
|
message ExtensionServiceConfigSpec {
|
||||||
repeated ExtensionServicesConfigFile files = 2;
|
repeated ExtensionServiceConfigFile files = 1;
|
||||||
|
repeated string environment = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExtensionServicesConfigStatusSpec describes status of rendered extensions service config files.
|
// ExtensionServiceConfigStatusSpec describes status of rendered extensions service config files.
|
||||||
message ExtensionServicesConfigStatusSpec {
|
message ExtensionServiceConfigStatusSpec {
|
||||||
string spec_version = 1;
|
string spec_version = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import (
|
|||||||
"github.com/siderolabs/talos/pkg/machinery/config/encoder"
|
"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/network"
|
||||||
"github.com/siderolabs/talos/pkg/machinery/config/types/runtime"
|
"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"
|
"github.com/siderolabs/talos/pkg/machinery/config/types/siderolink"
|
||||||
v1alpha1 "github.com/siderolabs/talos/pkg/machinery/config/types/v1alpha1"
|
v1alpha1 "github.com/siderolabs/talos/pkg/machinery/config/types/v1alpha1"
|
||||||
)
|
)
|
||||||
@ -120,6 +121,10 @@ var docsCmd = &cobra.Command{
|
|||||||
name: "v1alpha1",
|
name: "v1alpha1",
|
||||||
fileDoc: v1alpha1.GetFileDoc(),
|
fileDoc: v1alpha1.GetFileDoc(),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "extensions",
|
||||||
|
fileDoc: extensions.GetFileDoc(),
|
||||||
|
},
|
||||||
} {
|
} {
|
||||||
path := filepath.Join(dir, pkg.name)
|
path := filepath.Join(dir, pkg.name)
|
||||||
|
|
||||||
|
|||||||
@ -80,19 +80,22 @@ Talos Linux now supports OpenNebula platform.
|
|||||||
[notes.extensions]
|
[notes.extensions]
|
||||||
title = "Extension Services Config"
|
title = "Extension Services Config"
|
||||||
description = """\
|
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:
|
The extension service configuration is a separate config document. An example is shown below:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
apiVersion: v1alpha1
|
apiVersion: v1alpha1
|
||||||
kind: ExtensionServicesConfig
|
kind: ExtensionServiceConfig
|
||||||
config:
|
name: nut-client
|
||||||
- name: nut-client
|
configFiles:
|
||||||
configFiles:
|
- content: MONITOR ${upsmonHost} 1 remote pass password
|
||||||
- content: MONITOR ${upsmonHost} 1 remote pass password
|
mountPath: /usr/local/etc/nut/upsmon.conf
|
||||||
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]
|
[notes.k8supgrade]
|
||||||
|
|||||||
@ -47,7 +47,7 @@ func (ctrl *ExtensionServiceController) Inputs() []controller.Input {
|
|||||||
return []controller.Input{
|
return []controller.Input{
|
||||||
{
|
{
|
||||||
Namespace: runtime.NamespaceName,
|
Namespace: runtime.NamespaceName,
|
||||||
Type: runtime.ExtensionServicesConfigStatusType,
|
Type: runtime.ExtensionServiceConfigStatusType,
|
||||||
Kind: controller.InputStrong,
|
Kind: controller.InputStrong,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -84,7 +84,7 @@ func (ctrl *ExtensionServiceController) Run(ctx context.Context, r controller.Ru
|
|||||||
|
|
||||||
// load initial state of configStatuses
|
// load initial state of configStatuses
|
||||||
if ctrl.configStatusCache == nil {
|
if ctrl.configStatusCache == nil {
|
||||||
configStatuses, err := safe.ReaderListAll[*runtime.ExtensionServicesConfigStatus](ctx, r)
|
configStatuses, err := safe.ReaderListAll[*runtime.ExtensionServiceConfigStatus](ctx, r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error listing extension services config: %w", err)
|
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():
|
case <-r.EventCh():
|
||||||
}
|
}
|
||||||
|
|
||||||
configStatuses, err := safe.ReaderListAll[*runtime.ExtensionServicesConfigStatus](ctx, r)
|
configStatuses, err := safe.ReaderListAll[*runtime.ExtensionServiceConfigStatus](ctx, r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error listing extension services config: %w", err)
|
return fmt.Errorf("error listing extension services config: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,16 +20,16 @@ import (
|
|||||||
"github.com/siderolabs/talos/pkg/machinery/resources/runtime"
|
"github.com/siderolabs/talos/pkg/machinery/resources/runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ExtensionServicesConfigController watches v1alpha1.Config, creates/updates/deletes extension services config.
|
// ExtensionServiceConfigController watches v1alpha1.Config, creates/updates/deletes extension services config.
|
||||||
type ExtensionServicesConfigController struct{}
|
type ExtensionServiceConfigController struct{}
|
||||||
|
|
||||||
// Name implements controller.Controller interface.
|
// Name implements controller.Controller interface.
|
||||||
func (ctrl *ExtensionServicesConfigController) Name() string {
|
func (ctrl *ExtensionServiceConfigController) Name() string {
|
||||||
return "runtime.ExtensionServicesConfigController"
|
return "runtime.ExtensionServiceConfigController"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inputs implements controller.Controller interface.
|
// Inputs implements controller.Controller interface.
|
||||||
func (ctrl *ExtensionServicesConfigController) Inputs() []controller.Input {
|
func (ctrl *ExtensionServiceConfigController) Inputs() []controller.Input {
|
||||||
return []controller.Input{
|
return []controller.Input{
|
||||||
{
|
{
|
||||||
Namespace: config.NamespaceName,
|
Namespace: config.NamespaceName,
|
||||||
@ -41,10 +41,10 @@ func (ctrl *ExtensionServicesConfigController) Inputs() []controller.Input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Outputs implements controller.Controller interface.
|
// Outputs implements controller.Controller interface.
|
||||||
func (ctrl *ExtensionServicesConfigController) Outputs() []controller.Output {
|
func (ctrl *ExtensionServiceConfigController) Outputs() []controller.Output {
|
||||||
return []controller.Output{
|
return []controller.Output{
|
||||||
{
|
{
|
||||||
Type: runtime.ExtensionServicesConfigType,
|
Type: runtime.ExtensionServiceConfigType,
|
||||||
Kind: controller.OutputExclusive,
|
Kind: controller.OutputExclusive,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -53,7 +53,7 @@ func (ctrl *ExtensionServicesConfigController) Outputs() []controller.Output {
|
|||||||
// Run implements controller.Controller interface.
|
// Run implements controller.Controller interface.
|
||||||
//
|
//
|
||||||
//nolint:gocyclo
|
//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 {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
@ -68,16 +68,18 @@ func (ctrl *ExtensionServicesConfigController) Run(ctx context.Context, r contro
|
|||||||
|
|
||||||
r.StartTrackingOutputs()
|
r.StartTrackingOutputs()
|
||||||
|
|
||||||
if cfg != nil && cfg.Config() != nil && cfg.Config().ExtensionServicesConfig() != nil {
|
if cfg != nil && cfg.Config() != nil {
|
||||||
for _, ext := range cfg.Config().ExtensionServicesConfig().ConfigData() {
|
for _, extConfig := range cfg.Config().ExtensionServiceConfigs() {
|
||||||
if err = safe.WriterModify(ctx, r, runtime.NewExtensionServicesConfigSpec(runtime.NamespaceName, ext.Name()), func(spec *runtime.ExtensionServicesConfig) error {
|
if err = safe.WriterModify(ctx, r, runtime.NewExtensionServiceConfigSpec(runtime.NamespaceName, extConfig.Name()), func(spec *runtime.ExtensionServiceConfig) error {
|
||||||
spec.TypedSpec().Files = xslices.Map(ext.ConfigFiles(), func(c extconfig.ExtensionServicesConfigFile) runtime.ExtensionServicesConfigFile {
|
spec.TypedSpec().Files = xslices.Map(extConfig.ConfigFiles(), func(c extconfig.ExtensionServiceConfigFile) runtime.ExtensionServiceConfigFile {
|
||||||
return runtime.ExtensionServicesConfigFile{
|
return runtime.ExtensionServiceConfigFile{
|
||||||
Content: c.Content(),
|
Content: c.Content(),
|
||||||
MountPath: c.Path(),
|
MountPath: c.MountPath(),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
spec.TypedSpec().Environment = extConfig.Environment()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return err
|
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
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -20,33 +20,33 @@ import (
|
|||||||
"github.com/siderolabs/talos/pkg/machinery/resources/runtime"
|
"github.com/siderolabs/talos/pkg/machinery/resources/runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ExtensionServicesConfigFilesController writes down the config files for extension services.
|
// ExtensionServiceConfigFilesController writes down the config files for extension services.
|
||||||
type ExtensionServicesConfigFilesController struct {
|
type ExtensionServiceConfigFilesController struct {
|
||||||
V1Alpha1Mode v1alpha1runtime.Mode
|
V1Alpha1Mode v1alpha1runtime.Mode
|
||||||
ExtensionsConfigBaseDir string
|
ExtensionsConfigBaseDir string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Name implements controller.Controller interface.
|
// Name implements controller.Controller interface.
|
||||||
func (ctrl *ExtensionServicesConfigFilesController) Name() string {
|
func (ctrl *ExtensionServiceConfigFilesController) Name() string {
|
||||||
return "runtime.ExtensionServicesConfigFilesController"
|
return "runtime.ExtensionServiceConfigFilesController"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inputs implements controller.Controller interface.
|
// Inputs implements controller.Controller interface.
|
||||||
func (ctrl *ExtensionServicesConfigFilesController) Inputs() []controller.Input {
|
func (ctrl *ExtensionServiceConfigFilesController) Inputs() []controller.Input {
|
||||||
return []controller.Input{
|
return []controller.Input{
|
||||||
{
|
{
|
||||||
Namespace: runtime.NamespaceName,
|
Namespace: runtime.NamespaceName,
|
||||||
Type: runtime.ExtensionServicesConfigType,
|
Type: runtime.ExtensionServiceConfigType,
|
||||||
Kind: controller.InputStrong,
|
Kind: controller.InputStrong,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Outputs implements controller.Controller interface.
|
// Outputs implements controller.Controller interface.
|
||||||
func (ctrl *ExtensionServicesConfigFilesController) Outputs() []controller.Output {
|
func (ctrl *ExtensionServiceConfigFilesController) Outputs() []controller.Output {
|
||||||
return []controller.Output{
|
return []controller.Output{
|
||||||
{
|
{
|
||||||
Type: runtime.ExtensionServicesConfigStatusType,
|
Type: runtime.ExtensionServiceConfigStatusType,
|
||||||
Kind: controller.OutputExclusive,
|
Kind: controller.OutputExclusive,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -55,7 +55,7 @@ func (ctrl *ExtensionServicesConfigFilesController) Outputs() []controller.Outpu
|
|||||||
// Run implements controller.Controller interface.
|
// Run implements controller.Controller interface.
|
||||||
//
|
//
|
||||||
//nolint:gocyclo
|
//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 {
|
if ctrl.V1Alpha1Mode == v1alpha1runtime.ModeContainer {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -67,7 +67,7 @@ func (ctrl *ExtensionServicesConfigFilesController) Run(ctx context.Context, r c
|
|||||||
case <-r.EventCh():
|
case <-r.EventCh():
|
||||||
}
|
}
|
||||||
|
|
||||||
list, err := safe.ReaderListAll[*runtime.ExtensionServicesConfig](ctx, r)
|
list, err := safe.ReaderListAll[*runtime.ExtensionServiceConfig](ctx, r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error listing extension services config: %w", err)
|
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{}{}
|
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()
|
spec.TypedSpec().SpecVersion = iter.Value().Metadata().Version().String()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@ -117,7 +117,7 @@ func (ctrl *ExtensionServicesConfigFilesController) Run(ctx context.Context, r c
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = safe.CleanupOutputs[*runtime.ExtensionServicesConfigStatus](ctx, r); err != nil {
|
if err = safe.CleanupOutputs[*runtime.ExtensionServiceConfigStatus](ctx, r); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -18,18 +18,18 @@ import (
|
|||||||
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
|
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ExtensionServicesConfigFilesSuite struct {
|
type ExtensionServiceConfigFilesSuite struct {
|
||||||
ctest.DefaultSuite
|
ctest.DefaultSuite
|
||||||
extensionsConfigDir string
|
extensionsConfigDir string
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestExtensionServicesConfigFilesSuite(t *testing.T) {
|
func TestExtensionServiceConfigFilesSuite(t *testing.T) {
|
||||||
extensionsConfigDir := t.TempDir()
|
extensionsConfigDir := t.TempDir()
|
||||||
|
|
||||||
suite.Run(t, &ExtensionServicesConfigFilesSuite{
|
suite.Run(t, &ExtensionServiceConfigFilesSuite{
|
||||||
DefaultSuite: ctest.DefaultSuite{
|
DefaultSuite: ctest.DefaultSuite{
|
||||||
AfterSetup: func(suite *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,
|
ExtensionsConfigBaseDir: extensionsConfigDir,
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
@ -38,7 +38,7 @@ func TestExtensionServicesConfigFilesSuite(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *ExtensionServicesConfigFilesSuite) TestReconcileExtensionServicesConfigFiles() {
|
func (suite *ExtensionServiceConfigFilesSuite) TestReconcileExtensionServiceConfigFiles() {
|
||||||
for _, tt := range []struct {
|
for _, tt := range []struct {
|
||||||
extensionName string
|
extensionName string
|
||||||
configFiles []struct {
|
configFiles []struct {
|
||||||
@ -75,23 +75,23 @@ func (suite *ExtensionServicesConfigFilesSuite) TestReconcileExtensionServicesCo
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
} {
|
} {
|
||||||
extensionServicesConfigFiles := runtimeres.NewExtensionServicesConfigSpec(runtimeres.NamespaceName, tt.extensionName)
|
extensionServiceConfigFiles := runtimeres.NewExtensionServiceConfigSpec(runtimeres.NamespaceName, tt.extensionName)
|
||||||
extensionServicesConfigFiles.TypedSpec().Files = xslices.Map(tt.configFiles, func(config struct {
|
extensionServiceConfigFiles.TypedSpec().Files = xslices.Map(tt.configFiles, func(config struct {
|
||||||
content string
|
content string
|
||||||
mountPath string
|
mountPath string
|
||||||
},
|
},
|
||||||
) runtimeres.ExtensionServicesConfigFile {
|
) runtimeres.ExtensionServiceConfigFile {
|
||||||
return runtimeres.ExtensionServicesConfigFile{
|
return runtimeres.ExtensionServiceConfigFile{
|
||||||
Content: config.content,
|
Content: config.content,
|
||||||
MountPath: config.mountPath,
|
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,
|
ctest.AssertResource(suite, tt.extensionName,
|
||||||
func(status *runtimeres.ExtensionServicesConfigStatus, asrt *assert.Assertions) {
|
func(status *runtimeres.ExtensionServiceConfigStatus, asrt *assert.Assertions) {
|
||||||
asrt.Equal(extensionServicesConfigFiles.Metadata().Version().String(), status.TypedSpec().SpecVersion)
|
asrt.Equal(extensionServiceConfigFiles.Metadata().Version().String(), status.TypedSpec().SpecVersion)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -113,8 +113,8 @@ func (suite *ExtensionServicesConfigFilesSuite) TestReconcileExtensionServicesCo
|
|||||||
suite.Assert().NoError(err)
|
suite.Assert().NoError(err)
|
||||||
|
|
||||||
// delete test-extension-b resource
|
// delete test-extension-b resource
|
||||||
suite.Assert().NoError(suite.State().Destroy(suite.Ctx(), runtimeres.NewExtensionServicesConfigSpec(runtimeres.NamespaceName, "test-extension-b").Metadata()))
|
suite.Assert().NoError(suite.State().Destroy(suite.Ctx(), runtimeres.NewExtensionServiceConfigSpec(runtimeres.NamespaceName, "test-extension-b").Metadata()))
|
||||||
ctest.AssertNoResource[*runtimeres.ExtensionServicesConfigStatus](suite, "test-extension-b")
|
ctest.AssertNoResource[*runtimeres.ExtensionServiceConfigStatus](suite, "test-extension-b")
|
||||||
|
|
||||||
suite.Assert().NoFileExists(filepath.Join(suite.extensionsConfigDir, "test", "testdata"))
|
suite.Assert().NoFileExists(filepath.Join(suite.extensionsConfigDir, "test", "testdata"))
|
||||||
suite.Assert().NoDirExists(filepath.Join(suite.extensionsConfigDir, "test"))
|
suite.Assert().NoDirExists(filepath.Join(suite.extensionsConfigDir, "test"))
|
||||||
@ -13,65 +13,35 @@ import (
|
|||||||
|
|
||||||
"github.com/siderolabs/talos/internal/app/machined/pkg/controllers/ctest"
|
"github.com/siderolabs/talos/internal/app/machined/pkg/controllers/ctest"
|
||||||
"github.com/siderolabs/talos/internal/app/machined/pkg/controllers/runtime"
|
"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/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"
|
"github.com/siderolabs/talos/pkg/machinery/resources/config"
|
||||||
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
|
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ExtensionServicesConfigSuite struct {
|
type ExtensionServiceConfigSuite struct {
|
||||||
ctest.DefaultSuite
|
ctest.DefaultSuite
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestExtensionServicesConfigSuite(t *testing.T) {
|
func TestExtensionServiceConfigSuite(t *testing.T) {
|
||||||
suite.Run(t, &ExtensionServicesConfigSuite{
|
suite.Run(t, &ExtensionServiceConfigSuite{
|
||||||
DefaultSuite: ctest.DefaultSuite{
|
DefaultSuite: ctest.DefaultSuite{
|
||||||
AfterSetup: func(suite *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() {
|
func (suite *ExtensionServiceConfigSuite) TestReconcileExtensionServiceConfig() {
|
||||||
extensionsServiceConfigDoc := extensionservicesconfig.NewExtensionServicesConfigV1Alpha1()
|
extensionServiceConfigs := []struct {
|
||||||
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 {
|
|
||||||
extensionName string
|
extensionName string
|
||||||
configFiles []struct {
|
configFiles []struct {
|
||||||
content string
|
content string
|
||||||
mountPath string
|
mountPath string
|
||||||
}
|
}
|
||||||
|
environment []string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
extensionName: "test-extension-a",
|
extensionName: "test-extension-a",
|
||||||
@ -100,34 +70,72 @@ func (suite *ExtensionServicesConfigSuite) TestReconcileExtensionServicesConfig(
|
|||||||
mountPath: "/var/etc/foo",
|
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()
|
spec := config.TypedSpec()
|
||||||
|
|
||||||
configFileData := xslices.Map(tt.configFiles, func(config struct {
|
configFileData := xslices.Map(tt.configFiles, func(config struct {
|
||||||
content string
|
content string
|
||||||
mountPath string
|
mountPath string
|
||||||
},
|
},
|
||||||
) runtimeres.ExtensionServicesConfigFile {
|
) runtimeres.ExtensionServiceConfigFile {
|
||||||
return runtimeres.ExtensionServicesConfigFile{
|
return runtimeres.ExtensionServiceConfigFile{
|
||||||
Content: config.content,
|
Content: config.content,
|
||||||
MountPath: config.mountPath,
|
MountPath: config.mountPath,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
suite.Assert().Equal(configFileData, spec.Files)
|
suite.Assert().Equal(configFileData, spec.Files)
|
||||||
|
suite.Assert().Equal(tt.environment, spec.Environment)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// test deletion
|
// test deletion
|
||||||
extensionsServiceConfigDoc.Config = extensionsServiceConfigDoc.Config[1:] // remove first extension service config
|
cfg := extensions.NewServicesConfigV1Alpha1()
|
||||||
cntr, err = container.New(extensionsServiceConfigDoc)
|
cfg.ServiceName = "test-extension-a"
|
||||||
|
cntr, err = container.New(cfg)
|
||||||
suite.Require().NoError(err)
|
suite.Require().NoError(err)
|
||||||
|
|
||||||
newCfg := config.NewMachineConfig(cntr)
|
machineConfig = config.NewMachineConfig(cntr)
|
||||||
newCfg.Metadata().SetVersion(cfg.Metadata().Version())
|
suite.Require().NoError(suite.State().Destroy(suite.Ctx(), machineConfig.Metadata()))
|
||||||
suite.Require().NoError(suite.State().Update(suite.Ctx(), cfg))
|
|
||||||
|
|
||||||
ctest.AssertNoResource[*runtimeres.ExtensionServicesConfig](suite, "test-extension-a")
|
ctest.AssertNoResource[*runtimeres.ExtensionServiceConfig](suite, "test-extension-a")
|
||||||
}
|
}
|
||||||
@ -172,7 +172,7 @@ func (suite *ExtensionServiceSuite) TestReconcile() {
|
|||||||
svcMock.getTimesStartedStopped(),
|
svcMock.getTimesStartedStopped(),
|
||||||
)
|
)
|
||||||
|
|
||||||
helloConfig := runtime.NewExtensionServicesConfigStatusSpec(runtime.NamespaceName, "hello-world")
|
helloConfig := runtime.NewExtensionServiceConfigStatusSpec(runtime.NamespaceName, "hello-world")
|
||||||
helloConfig.TypedSpec().SpecVersion = "1"
|
helloConfig.TypedSpec().SpecVersion = "1"
|
||||||
suite.Require().NoError(suite.state.Create(suite.ctx, helloConfig))
|
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"
|
unexpectedConfig.TypedSpec().SpecVersion = "1"
|
||||||
suite.Require().NoError(suite.state.Create(suite.ctx, unexpectedConfig))
|
suite.Require().NoError(suite.state.Create(suite.ctx, unexpectedConfig))
|
||||||
|
|
||||||
|
|||||||
@ -255,10 +255,10 @@ func (ctrl *Controller) Run(ctx context.Context, drainer *runtime.Drainer) error
|
|||||||
&runtimecontrollers.DropUpgradeFallbackController{
|
&runtimecontrollers.DropUpgradeFallbackController{
|
||||||
MetaProvider: ctrl.v1alpha1Runtime.State().Machine(),
|
MetaProvider: ctrl.v1alpha1Runtime.State().Machine(),
|
||||||
},
|
},
|
||||||
&runtimecontrollers.ExtensionServicesConfigController{},
|
&runtimecontrollers.ExtensionServiceConfigController{},
|
||||||
&runtimecontrollers.ExtensionServicesConfigFilesController{
|
&runtimecontrollers.ExtensionServiceConfigFilesController{
|
||||||
V1Alpha1Mode: ctrl.v1alpha1Runtime.State().Platform().Mode(),
|
V1Alpha1Mode: ctrl.v1alpha1Runtime.State().Platform().Mode(),
|
||||||
ExtensionsConfigBaseDir: constants.ExtensionServicesUserConfigPath,
|
ExtensionsConfigBaseDir: constants.ExtensionServiceUserConfigPath,
|
||||||
},
|
},
|
||||||
&runtimecontrollers.EventsSinkConfigController{
|
&runtimecontrollers.EventsSinkConfigController{
|
||||||
Cmdline: procfs.ProcCmdline(),
|
Cmdline: procfs.ProcCmdline(),
|
||||||
@ -270,7 +270,7 @@ func (ctrl *Controller) Run(ctx context.Context, drainer *runtime.Drainer) error
|
|||||||
},
|
},
|
||||||
&runtimecontrollers.ExtensionServiceController{
|
&runtimecontrollers.ExtensionServiceController{
|
||||||
V1Alpha1Services: system.Services(ctrl.v1alpha1Runtime),
|
V1Alpha1Services: system.Services(ctrl.v1alpha1Runtime),
|
||||||
ConfigPath: constants.ExtensionServicesConfigPath,
|
ConfigPath: constants.ExtensionServiceConfigPath,
|
||||||
},
|
},
|
||||||
&runtimecontrollers.ExtensionStatusController{},
|
&runtimecontrollers.ExtensionStatusController{},
|
||||||
&runtimecontrollers.KernelModuleConfigController{},
|
&runtimecontrollers.KernelModuleConfigController{},
|
||||||
|
|||||||
@ -173,8 +173,8 @@ func NewState() (*State, error) {
|
|||||||
&perf.Memory{},
|
&perf.Memory{},
|
||||||
&runtime.DevicesStatus{},
|
&runtime.DevicesStatus{},
|
||||||
&runtime.EventSinkConfig{},
|
&runtime.EventSinkConfig{},
|
||||||
&runtime.ExtensionServicesConfig{},
|
&runtime.ExtensionServiceConfig{},
|
||||||
&runtime.ExtensionServicesConfigStatus{},
|
&runtime.ExtensionServiceConfigStatus{},
|
||||||
&runtime.ExtensionStatus{},
|
&runtime.ExtensionStatus{},
|
||||||
&runtime.KernelModuleSpec{},
|
&runtime.KernelModuleSpec{},
|
||||||
&runtime.KernelParamSpec{},
|
&runtime.KernelParamSpec{},
|
||||||
|
|||||||
@ -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.
|
// re-mount service rootfs as overlay rw mount to allow containerd to mount there /dev, /proc, etc.
|
||||||
svc.overlay = mount.NewMountPoint(
|
svc.overlay = mount.NewMountPoint(
|
||||||
"",
|
"",
|
||||||
filepath.Join(constants.ExtensionServicesRootfsPath, svc.Spec.Name),
|
filepath.Join(constants.ExtensionServiceRootfsPath, svc.Spec.Name),
|
||||||
"",
|
"",
|
||||||
0,
|
0,
|
||||||
"",
|
"",
|
||||||
@ -111,7 +111,7 @@ func (svc *Extension) DependsOn(r runtime.Runtime) []string {
|
|||||||
|
|
||||||
func (svc *Extension) getOCIOptions(envVars []string, mounts []specs.Mount) []oci.SpecOpts {
|
func (svc *Extension) getOCIOptions(envVars []string, mounts []specs.Mount) []oci.SpecOpts {
|
||||||
ociOpts := []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),
|
containerd.WithRootfsPropagation(svc.Spec.Container.Security.RootfsPropagation),
|
||||||
oci.WithCgroup(filepath.Join(constants.CgroupExtensions, svc.Spec.Name)),
|
oci.WithCgroup(filepath.Join(constants.CgroupExtensions, svc.Spec.Name)),
|
||||||
oci.WithMounts(mounts),
|
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...)
|
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 {
|
if err == nil {
|
||||||
spec := configSpec.TypedSpec()
|
spec := configSpec.TypedSpec()
|
||||||
|
|
||||||
for _, ext := range spec.Files {
|
for _, ext := range spec.Files {
|
||||||
mounts = append(mounts, specs.Mount{
|
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,
|
Destination: ext.MountPath,
|
||||||
Type: "bind",
|
Type: "bind",
|
||||||
Options: []string{"ro", "bind"},
|
Options: []string{"ro", "bind"},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
envVars = append(envVars, spec.Environment...)
|
||||||
} else if !state.IsNotFoundError(err) {
|
} else if !state.IsNotFoundError(err) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -193,11 +200,6 @@ func (svc *Extension) Runner(r runtime.Runtime) (runner.Runner, error) {
|
|||||||
restartType = restart.UntilSuccess
|
restartType = restart.UntilSuccess
|
||||||
}
|
}
|
||||||
|
|
||||||
envVars, err := svc.parseEnvironment()
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
ociSpecOpts := svc.getOCIOptions(envVars, mounts)
|
ociSpecOpts := svc.getOCIOptions(envVars, mounts)
|
||||||
|
|
||||||
debug := false
|
debug := false
|
||||||
|
|||||||
@ -120,8 +120,8 @@ func (x *EventSinkConfigSpec) GetEndpoint() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExtensionServicesConfigFile describes extensions service config files.
|
// ExtensionServiceConfigFile describes extensions service config files.
|
||||||
type ExtensionServicesConfigFile struct {
|
type ExtensionServiceConfigFile struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
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"`
|
MountPath string `protobuf:"bytes,2,opt,name=mount_path,json=mountPath,proto3" json:"mount_path,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ExtensionServicesConfigFile) Reset() {
|
func (x *ExtensionServiceConfigFile) Reset() {
|
||||||
*x = ExtensionServicesConfigFile{}
|
*x = ExtensionServiceConfigFile{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[2]
|
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[2]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
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)
|
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]
|
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[2]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
@ -157,36 +157,37 @@ func (x *ExtensionServicesConfigFile) ProtoReflect() protoreflect.Message {
|
|||||||
return mi.MessageOf(x)
|
return mi.MessageOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: Use ExtensionServicesConfigFile.ProtoReflect.Descriptor instead.
|
// Deprecated: Use ExtensionServiceConfigFile.ProtoReflect.Descriptor instead.
|
||||||
func (*ExtensionServicesConfigFile) Descriptor() ([]byte, []int) {
|
func (*ExtensionServiceConfigFile) Descriptor() ([]byte, []int) {
|
||||||
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{2}
|
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{2}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ExtensionServicesConfigFile) GetContent() string {
|
func (x *ExtensionServiceConfigFile) GetContent() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Content
|
return x.Content
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ExtensionServicesConfigFile) GetMountPath() string {
|
func (x *ExtensionServiceConfigFile) GetMountPath() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.MountPath
|
return x.MountPath
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExtensionServicesConfigSpec describes status of rendered extensions service config files.
|
// ExtensionServiceConfigSpec describes status of rendered extensions service config files.
|
||||||
type ExtensionServicesConfigSpec struct {
|
type ExtensionServiceConfigSpec struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
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() {
|
func (x *ExtensionServiceConfigSpec) Reset() {
|
||||||
*x = ExtensionServicesConfigSpec{}
|
*x = ExtensionServiceConfigSpec{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[3]
|
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[3]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
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)
|
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]
|
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[3]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
@ -212,20 +213,27 @@ func (x *ExtensionServicesConfigSpec) ProtoReflect() protoreflect.Message {
|
|||||||
return mi.MessageOf(x)
|
return mi.MessageOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: Use ExtensionServicesConfigSpec.ProtoReflect.Descriptor instead.
|
// Deprecated: Use ExtensionServiceConfigSpec.ProtoReflect.Descriptor instead.
|
||||||
func (*ExtensionServicesConfigSpec) Descriptor() ([]byte, []int) {
|
func (*ExtensionServiceConfigSpec) Descriptor() ([]byte, []int) {
|
||||||
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{3}
|
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{3}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ExtensionServicesConfigSpec) GetFiles() []*ExtensionServicesConfigFile {
|
func (x *ExtensionServiceConfigSpec) GetFiles() []*ExtensionServiceConfigFile {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Files
|
return x.Files
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExtensionServicesConfigStatusSpec describes status of rendered extensions service config files.
|
func (x *ExtensionServiceConfigSpec) GetEnvironment() []string {
|
||||||
type ExtensionServicesConfigStatusSpec struct {
|
if x != nil {
|
||||||
|
return x.Environment
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ExtensionServiceConfigStatusSpec describes status of rendered extensions service config files.
|
||||||
|
type ExtensionServiceConfigStatusSpec struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
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"`
|
SpecVersion string `protobuf:"bytes,1,opt,name=spec_version,json=specVersion,proto3" json:"spec_version,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ExtensionServicesConfigStatusSpec) Reset() {
|
func (x *ExtensionServiceConfigStatusSpec) Reset() {
|
||||||
*x = ExtensionServicesConfigStatusSpec{}
|
*x = ExtensionServiceConfigStatusSpec{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[4]
|
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[4]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
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)
|
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]
|
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[4]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
@ -260,12 +268,12 @@ func (x *ExtensionServicesConfigStatusSpec) ProtoReflect() protoreflect.Message
|
|||||||
return mi.MessageOf(x)
|
return mi.MessageOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: Use ExtensionServicesConfigStatusSpec.ProtoReflect.Descriptor instead.
|
// Deprecated: Use ExtensionServiceConfigStatusSpec.ProtoReflect.Descriptor instead.
|
||||||
func (*ExtensionServicesConfigStatusSpec) Descriptor() ([]byte, []int) {
|
func (*ExtensionServiceConfigStatusSpec) Descriptor() ([]byte, []int) {
|
||||||
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{4}
|
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{4}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ExtensionServicesConfigStatusSpec) GetSpecVersion() string {
|
func (x *ExtensionServiceConfigStatusSpec) GetSpecVersion() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.SpecVersion
|
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,
|
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,
|
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,
|
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,
|
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, 0x73,
|
0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43,
|
||||||
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f,
|
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e,
|
||||||
0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e,
|
0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74,
|
||||||
0x74, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x61,
|
0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x61, 0x74,
|
||||||
0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x50,
|
0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x61,
|
||||||
0x61, 0x74, 0x68, 0x22, 0x74, 0x0a, 0x1b, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
|
0x74, 0x68, 0x22, 0x94, 0x01, 0x0a, 0x1a, 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,
|
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x70, 0x65,
|
||||||
0x65, 0x63, 0x12, 0x55, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,
|
0x63, 0x12, 0x54, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
|
||||||
0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
|
0x32, 0x3e, 0x2e, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
|
||||||
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,
|
|
||||||
0x65, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x72, 0x75,
|
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,
|
0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x53,
|
||||||
0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x75, 0x6e, 0x6d, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69,
|
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x46, 0x69, 0x6c, 0x65,
|
||||||
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x1c, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x65,
|
0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72,
|
||||||
0x6e, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66,
|
0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x6e,
|
||||||
0x69, 0x67, 0x53, 0x70, 0x65, 0x63, 0x12, 0x25, 0x0a, 0x0e, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e,
|
0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x45, 0x0a, 0x20, 0x45, 0x78, 0x74,
|
||||||
0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d,
|
0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e,
|
||||||
0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3e, 0x0a,
|
0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x21, 0x0a,
|
||||||
0x13, 0x72, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65,
|
0x0c, 0x73, 0x70, 0x65, 0x63, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20,
|
||||||
0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x63, 0x6f, 0x6d,
|
0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x70, 0x65, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
|
||||||
0x6d, 0x6f, 0x6e, 0x2e, 0x4e, 0x65, 0x74, 0x49, 0x50, 0x52, 0x12, 0x72, 0x65, 0x61, 0x63, 0x68,
|
0x22, 0x4a, 0x0a, 0x14, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
|
||||||
0x61, 0x62, 0x6c, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0x23, 0x0a,
|
0x53, 0x70, 0x65, 0x63, 0x53, 0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
|
||||||
0x0b, 0x4d, 0x65, 0x74, 0x61, 0x4b, 0x65, 0x79, 0x53, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05,
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a,
|
||||||
0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c,
|
0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09,
|
||||||
0x75, 0x65, 0x22, 0x24, 0x0a, 0x0e, 0x4d, 0x65, 0x74, 0x61, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x64,
|
0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x22, 0x50, 0x0a, 0x13,
|
||||||
0x53, 0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01,
|
0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x53, 0x70, 0x65, 0x63, 0x53,
|
||||||
0x28, 0x08, 0x52, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x22, 0xd5, 0x01, 0x0a, 0x0f, 0x4d, 0x6f, 0x75,
|
0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01,
|
||||||
0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x16, 0x0a, 0x06,
|
0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x67, 0x6e,
|
||||||
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f,
|
0x6f, 0x72, 0x65, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08,
|
||||||
0x75, 0x72, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02,
|
0x52, 0x0c, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x22, 0x6d,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x0f,
|
0x0a, 0x15, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x53, 0x74, 0x61,
|
||||||
0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18,
|
0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x75, 0x72, 0x72, 0x65,
|
||||||
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65,
|
0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e,
|
||||||
0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
0x74, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12,
|
0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x75,
|
||||||
0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01,
|
0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08,
|
||||||
0x28, 0x08, 0x52, 0x09, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x12, 0x31, 0x0a,
|
0x52, 0x0b, 0x75, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x22, 0x44, 0x0a,
|
||||||
0x14, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x76,
|
0x11, 0x4b, 0x6d, 0x73, 0x67, 0x4c, 0x6f, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x70,
|
||||||
0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x65, 0x6e, 0x63,
|
0x65, 0x63, 0x12, 0x2f, 0x0a, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f,
|
||||||
0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73,
|
0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
|
||||||
0x22, 0xf5, 0x01, 0x0a, 0x14, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4d, 0x65, 0x74,
|
0x6e, 0x2e, 0x55, 0x52, 0x4c, 0x52, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69,
|
||||||
0x61, 0x64, 0x61, 0x74, 0x61, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61,
|
0x6f, 0x6e, 0x73, 0x22, 0xb1, 0x01, 0x0a, 0x11, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53,
|
||||||
0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61,
|
0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x4b, 0x0a, 0x05, 0x73, 0x74, 0x61,
|
||||||
0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d,
|
0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x74, 0x61, 0x6c, 0x6f, 0x73,
|
||||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d,
|
0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69,
|
||||||
0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28,
|
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x52, 0x75, 0x6e, 0x74,
|
||||||
0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x7a, 0x6f, 0x6e,
|
0x69, 0x6d, 0x65, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x67, 0x65, 0x52,
|
||||||
0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x7a, 0x6f, 0x6e, 0x65, 0x12, 0x23, 0x0a,
|
0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x12, 0x4f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
|
||||||
0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05,
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x2e, 0x72,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x79,
|
0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69,
|
||||||
0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69,
|
0x6f, 0x6e, 0x73, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x4d, 0x61, 0x63, 0x68,
|
||||||
0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63,
|
0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52,
|
||||||
0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f,
|
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x8a, 0x01, 0x0a, 0x13, 0x4d, 0x61, 0x63, 0x68,
|
||||||
0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64,
|
0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12,
|
||||||
0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x6f, 0x74, 0x18, 0x08, 0x20, 0x01,
|
0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05,
|
||||||
0x28, 0x08, 0x52, 0x04, 0x73, 0x70, 0x6f, 0x74, 0x22, 0xb2, 0x01, 0x0a, 0x11, 0x53, 0x65, 0x63,
|
0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x5d, 0x0a, 0x10, 0x75, 0x6e, 0x6d, 0x65, 0x74, 0x5f, 0x63,
|
||||||
0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1f,
|
0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
||||||
0x0a, 0x0b, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20,
|
0x32, 0x2e, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
|
||||||
0x01, 0x28, 0x08, 0x52, 0x0a, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x42, 0x6f, 0x6f, 0x74, 0x12,
|
0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x72, 0x75, 0x6e,
|
||||||
0x3d, 0x0a, 0x1b, 0x75, 0x6b, 0x69, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x6b,
|
0x74, 0x69, 0x6d, 0x65, 0x2e, 0x55, 0x6e, 0x6d, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74,
|
||||||
0x65, 0x79, 0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x02,
|
0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x75, 0x6e, 0x6d, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x18, 0x75, 0x6b, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67,
|
0x69, 0x6f, 0x6e, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x1c, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x6e,
|
||||||
0x4b, 0x65, 0x79, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x12, 0x3d,
|
0x61, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69,
|
||||||
0x0a, 0x1b, 0x70, 0x63, 0x72, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x6b, 0x65,
|
0x67, 0x53, 0x70, 0x65, 0x63, 0x12, 0x25, 0x0a, 0x0e, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x5f,
|
||||||
0x79, 0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20,
|
0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6c,
|
||||||
0x01, 0x28, 0x09, 0x52, 0x18, 0x70, 0x63, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x4b,
|
0x69, 0x73, 0x74, 0x65, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3e, 0x0a, 0x13,
|
||||||
0x65, 0x79, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x22, 0x2e, 0x0a,
|
0x72, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73,
|
||||||
0x16, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x54, 0x6f,
|
0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
|
||||||
0x6b, 0x65, 0x6e, 0x53, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e,
|
0x6f, 0x6e, 0x2e, 0x4e, 0x65, 0x74, 0x49, 0x50, 0x52, 0x12, 0x72, 0x65, 0x61, 0x63, 0x68, 0x61,
|
||||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x3c, 0x0a,
|
0x62, 0x6c, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0x23, 0x0a, 0x0b,
|
||||||
0x0e, 0x55, 0x6e, 0x6d, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12,
|
0x4d, 0x65, 0x74, 0x61, 0x4b, 0x65, 0x79, 0x53, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x76,
|
||||||
0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
|
0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
|
||||||
0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20,
|
0x65, 0x22, 0x24, 0x0a, 0x0e, 0x4d, 0x65, 0x74, 0x61, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x53,
|
||||||
0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x42, 0x4c, 0x5a, 0x4a, 0x67,
|
0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x69, 0x64, 0x65, 0x72, 0x6f,
|
0x08, 0x52, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x22, 0xd5, 0x01, 0x0a, 0x0f, 0x4d, 0x6f, 0x75, 0x6e,
|
||||||
0x6c, 0x61, 0x62, 0x73, 0x2f, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6d,
|
0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x73,
|
||||||
0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x72, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73,
|
0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75,
|
||||||
0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e,
|
0x72, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20,
|
||||||
0x73, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x66,
|
||||||
0x33,
|
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 (
|
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_msgTypes = make([]protoimpl.MessageInfo, 19)
|
||||||
var file_resource_definitions_runtime_runtime_proto_goTypes = []interface{}{
|
var file_resource_definitions_runtime_runtime_proto_goTypes = []interface{}{
|
||||||
(*DevicesStatusSpec)(nil), // 0: talos.resource.definitions.runtime.DevicesStatusSpec
|
(*DevicesStatusSpec)(nil), // 0: talos.resource.definitions.runtime.DevicesStatusSpec
|
||||||
(*EventSinkConfigSpec)(nil), // 1: talos.resource.definitions.runtime.EventSinkConfigSpec
|
(*EventSinkConfigSpec)(nil), // 1: talos.resource.definitions.runtime.EventSinkConfigSpec
|
||||||
(*ExtensionServicesConfigFile)(nil), // 2: talos.resource.definitions.runtime.ExtensionServicesConfigFile
|
(*ExtensionServiceConfigFile)(nil), // 2: talos.resource.definitions.runtime.ExtensionServiceConfigFile
|
||||||
(*ExtensionServicesConfigSpec)(nil), // 3: talos.resource.definitions.runtime.ExtensionServicesConfigSpec
|
(*ExtensionServiceConfigSpec)(nil), // 3: talos.resource.definitions.runtime.ExtensionServiceConfigSpec
|
||||||
(*ExtensionServicesConfigStatusSpec)(nil), // 4: talos.resource.definitions.runtime.ExtensionServicesConfigStatusSpec
|
(*ExtensionServiceConfigStatusSpec)(nil), // 4: talos.resource.definitions.runtime.ExtensionServiceConfigStatusSpec
|
||||||
(*KernelModuleSpecSpec)(nil), // 5: talos.resource.definitions.runtime.KernelModuleSpecSpec
|
(*KernelModuleSpecSpec)(nil), // 5: talos.resource.definitions.runtime.KernelModuleSpecSpec
|
||||||
(*KernelParamSpecSpec)(nil), // 6: talos.resource.definitions.runtime.KernelParamSpecSpec
|
(*KernelParamSpecSpec)(nil), // 6: talos.resource.definitions.runtime.KernelParamSpecSpec
|
||||||
(*KernelParamStatusSpec)(nil), // 7: talos.resource.definitions.runtime.KernelParamStatusSpec
|
(*KernelParamStatusSpec)(nil), // 7: talos.resource.definitions.runtime.KernelParamStatusSpec
|
||||||
(*KmsgLogConfigSpec)(nil), // 8: talos.resource.definitions.runtime.KmsgLogConfigSpec
|
(*KmsgLogConfigSpec)(nil), // 8: talos.resource.definitions.runtime.KmsgLogConfigSpec
|
||||||
(*MachineStatusSpec)(nil), // 9: talos.resource.definitions.runtime.MachineStatusSpec
|
(*MachineStatusSpec)(nil), // 9: talos.resource.definitions.runtime.MachineStatusSpec
|
||||||
(*MachineStatusStatus)(nil), // 10: talos.resource.definitions.runtime.MachineStatusStatus
|
(*MachineStatusStatus)(nil), // 10: talos.resource.definitions.runtime.MachineStatusStatus
|
||||||
(*MaintenanceServiceConfigSpec)(nil), // 11: talos.resource.definitions.runtime.MaintenanceServiceConfigSpec
|
(*MaintenanceServiceConfigSpec)(nil), // 11: talos.resource.definitions.runtime.MaintenanceServiceConfigSpec
|
||||||
(*MetaKeySpec)(nil), // 12: talos.resource.definitions.runtime.MetaKeySpec
|
(*MetaKeySpec)(nil), // 12: talos.resource.definitions.runtime.MetaKeySpec
|
||||||
(*MetaLoadedSpec)(nil), // 13: talos.resource.definitions.runtime.MetaLoadedSpec
|
(*MetaLoadedSpec)(nil), // 13: talos.resource.definitions.runtime.MetaLoadedSpec
|
||||||
(*MountStatusSpec)(nil), // 14: talos.resource.definitions.runtime.MountStatusSpec
|
(*MountStatusSpec)(nil), // 14: talos.resource.definitions.runtime.MountStatusSpec
|
||||||
(*PlatformMetadataSpec)(nil), // 15: talos.resource.definitions.runtime.PlatformMetadataSpec
|
(*PlatformMetadataSpec)(nil), // 15: talos.resource.definitions.runtime.PlatformMetadataSpec
|
||||||
(*SecurityStateSpec)(nil), // 16: talos.resource.definitions.runtime.SecurityStateSpec
|
(*SecurityStateSpec)(nil), // 16: talos.resource.definitions.runtime.SecurityStateSpec
|
||||||
(*UniqueMachineTokenSpec)(nil), // 17: talos.resource.definitions.runtime.UniqueMachineTokenSpec
|
(*UniqueMachineTokenSpec)(nil), // 17: talos.resource.definitions.runtime.UniqueMachineTokenSpec
|
||||||
(*UnmetCondition)(nil), // 18: talos.resource.definitions.runtime.UnmetCondition
|
(*UnmetCondition)(nil), // 18: talos.resource.definitions.runtime.UnmetCondition
|
||||||
(*common.URL)(nil), // 19: common.URL
|
(*common.URL)(nil), // 19: common.URL
|
||||||
(enums.RuntimeMachineStage)(0), // 20: talos.resource.definitions.enums.RuntimeMachineStage
|
(enums.RuntimeMachineStage)(0), // 20: talos.resource.definitions.enums.RuntimeMachineStage
|
||||||
(*common.NetIP)(nil), // 21: common.NetIP
|
(*common.NetIP)(nil), // 21: common.NetIP
|
||||||
}
|
}
|
||||||
var file_resource_definitions_runtime_runtime_proto_depIdxs = []int32{
|
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
|
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
|
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
|
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{} {
|
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:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
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{} {
|
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:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
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{} {
|
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:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
|
|||||||
@ -106,7 +106,7 @@ func (m *EventSinkConfigSpec) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
|
|||||||
return len(dAtA) - i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ExtensionServicesConfigFile) MarshalVT() (dAtA []byte, err error) {
|
func (m *ExtensionServiceConfigFile) MarshalVT() (dAtA []byte, err error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@ -119,12 +119,12 @@ func (m *ExtensionServicesConfigFile) MarshalVT() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
return dAtA[:n], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ExtensionServicesConfigFile) MarshalToVT(dAtA []byte) (int, error) {
|
func (m *ExtensionServiceConfigFile) MarshalToVT(dAtA []byte) (int, error) {
|
||||||
size := m.SizeVT()
|
size := m.SizeVT()
|
||||||
return m.MarshalToSizedBufferVT(dAtA[:size])
|
return m.MarshalToSizedBufferVT(dAtA[:size])
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ExtensionServicesConfigFile) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
|
func (m *ExtensionServiceConfigFile) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0, nil
|
return 0, nil
|
||||||
}
|
}
|
||||||
@ -153,7 +153,7 @@ func (m *ExtensionServicesConfigFile) MarshalToSizedBufferVT(dAtA []byte) (int,
|
|||||||
return len(dAtA) - i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ExtensionServicesConfigSpec) MarshalVT() (dAtA []byte, err error) {
|
func (m *ExtensionServiceConfigSpec) MarshalVT() (dAtA []byte, err error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@ -166,12 +166,12 @@ func (m *ExtensionServicesConfigSpec) MarshalVT() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
return dAtA[:n], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ExtensionServicesConfigSpec) MarshalToVT(dAtA []byte) (int, error) {
|
func (m *ExtensionServiceConfigSpec) MarshalToVT(dAtA []byte) (int, error) {
|
||||||
size := m.SizeVT()
|
size := m.SizeVT()
|
||||||
return m.MarshalToSizedBufferVT(dAtA[:size])
|
return m.MarshalToSizedBufferVT(dAtA[:size])
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ExtensionServicesConfigSpec) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
|
func (m *ExtensionServiceConfigSpec) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0, nil
|
return 0, nil
|
||||||
}
|
}
|
||||||
@ -183,6 +183,15 @@ func (m *ExtensionServicesConfigSpec) MarshalToSizedBufferVT(dAtA []byte) (int,
|
|||||||
i -= len(m.unknownFields)
|
i -= len(m.unknownFields)
|
||||||
copy(dAtA[i:], 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 {
|
if len(m.Files) > 0 {
|
||||||
for iNdEx := len(m.Files) - 1; iNdEx >= 0; iNdEx-- {
|
for iNdEx := len(m.Files) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
size, err := m.Files[iNdEx].MarshalToSizedBufferVT(dAtA[:i])
|
size, err := m.Files[iNdEx].MarshalToSizedBufferVT(dAtA[:i])
|
||||||
@ -192,13 +201,13 @@ func (m *ExtensionServicesConfigSpec) MarshalToSizedBufferVT(dAtA []byte) (int,
|
|||||||
i -= size
|
i -= size
|
||||||
i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
|
i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x12
|
dAtA[i] = 0xa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return len(dAtA) - i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ExtensionServicesConfigStatusSpec) MarshalVT() (dAtA []byte, err error) {
|
func (m *ExtensionServiceConfigStatusSpec) MarshalVT() (dAtA []byte, err error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@ -211,12 +220,12 @@ func (m *ExtensionServicesConfigStatusSpec) MarshalVT() (dAtA []byte, err error)
|
|||||||
return dAtA[:n], nil
|
return dAtA[:n], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ExtensionServicesConfigStatusSpec) MarshalToVT(dAtA []byte) (int, error) {
|
func (m *ExtensionServiceConfigStatusSpec) MarshalToVT(dAtA []byte) (int, error) {
|
||||||
size := m.SizeVT()
|
size := m.SizeVT()
|
||||||
return m.MarshalToSizedBufferVT(dAtA[:size])
|
return m.MarshalToSizedBufferVT(dAtA[:size])
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ExtensionServicesConfigStatusSpec) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
|
func (m *ExtensionServiceConfigStatusSpec) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0, nil
|
return 0, nil
|
||||||
}
|
}
|
||||||
@ -1046,7 +1055,7 @@ func (m *EventSinkConfigSpec) SizeVT() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ExtensionServicesConfigFile) SizeVT() (n int) {
|
func (m *ExtensionServiceConfigFile) SizeVT() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -1064,7 +1073,7 @@ func (m *ExtensionServicesConfigFile) SizeVT() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ExtensionServicesConfigSpec) SizeVT() (n int) {
|
func (m *ExtensionServiceConfigSpec) SizeVT() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -1076,11 +1085,17 @@ func (m *ExtensionServicesConfigSpec) SizeVT() (n int) {
|
|||||||
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
|
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)
|
n += len(m.unknownFields)
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ExtensionServicesConfigStatusSpec) SizeVT() (n int) {
|
func (m *ExtensionServiceConfigStatusSpec) SizeVT() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -1548,7 +1563,7 @@ func (m *EventSinkConfigSpec) UnmarshalVT(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *ExtensionServicesConfigFile) UnmarshalVT(dAtA []byte) error {
|
func (m *ExtensionServiceConfigFile) UnmarshalVT(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -1571,10 +1586,10 @@ func (m *ExtensionServicesConfigFile) UnmarshalVT(dAtA []byte) error {
|
|||||||
fieldNum := int32(wire >> 3)
|
fieldNum := int32(wire >> 3)
|
||||||
wireType := int(wire & 0x7)
|
wireType := int(wire & 0x7)
|
||||||
if wireType == 4 {
|
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 {
|
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 {
|
switch fieldNum {
|
||||||
case 1:
|
case 1:
|
||||||
@ -1663,7 +1678,7 @@ func (m *ExtensionServicesConfigFile) UnmarshalVT(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *ExtensionServicesConfigSpec) UnmarshalVT(dAtA []byte) error {
|
func (m *ExtensionServiceConfigSpec) UnmarshalVT(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -1686,13 +1701,13 @@ func (m *ExtensionServicesConfigSpec) UnmarshalVT(dAtA []byte) error {
|
|||||||
fieldNum := int32(wire >> 3)
|
fieldNum := int32(wire >> 3)
|
||||||
wireType := int(wire & 0x7)
|
wireType := int(wire & 0x7)
|
||||||
if wireType == 4 {
|
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 {
|
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 {
|
switch fieldNum {
|
||||||
case 2:
|
case 1:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Files", wireType)
|
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 {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
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 {
|
if err := m.Files[len(m.Files)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
iNdEx = postIndex
|
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:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := protohelpers.Skip(dAtA[iNdEx:])
|
skippy, err := protohelpers.Skip(dAtA[iNdEx:])
|
||||||
@ -1748,7 +1795,7 @@ func (m *ExtensionServicesConfigSpec) UnmarshalVT(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *ExtensionServicesConfigStatusSpec) UnmarshalVT(dAtA []byte) error {
|
func (m *ExtensionServiceConfigStatusSpec) UnmarshalVT(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -1771,10 +1818,10 @@ func (m *ExtensionServicesConfigStatusSpec) UnmarshalVT(dAtA []byte) error {
|
|||||||
fieldNum := int32(wire >> 3)
|
fieldNum := int32(wire >> 3)
|
||||||
wireType := int(wire & 0x7)
|
wireType := int(wire & 0x7)
|
||||||
if wireType == 4 {
|
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 {
|
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 {
|
switch fieldNum {
|
||||||
case 1:
|
case 1:
|
||||||
|
|||||||
@ -11,7 +11,7 @@ type Config interface {
|
|||||||
Machine() MachineConfig
|
Machine() MachineConfig
|
||||||
Cluster() ClusterConfig
|
Cluster() ClusterConfig
|
||||||
SideroLink() SideroLinkConfig
|
SideroLink() SideroLinkConfig
|
||||||
ExtensionServicesConfig() ExtensionServicesConfigConfig
|
ExtensionServiceConfigs() []ExtensionServiceConfig
|
||||||
Runtime() RuntimeConfig
|
Runtime() RuntimeConfig
|
||||||
NetworkRules() NetworkRuleConfig
|
NetworkRules() NetworkRuleConfig
|
||||||
}
|
}
|
||||||
|
|||||||
18
pkg/machinery/config/config/extension_service_config.go
Normal file
18
pkg/machinery/config/config/extension_service_config.go
Normal 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
|
||||||
|
}
|
||||||
@ -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
|
|
||||||
}
|
|
||||||
@ -293,14 +293,14 @@ omit: false
|
|||||||
name: "misspelled apiVersion",
|
name: "misspelled apiVersion",
|
||||||
source: []byte(`---
|
source: []byte(`---
|
||||||
apiversion: v1alpha1
|
apiversion: v1alpha1
|
||||||
kind: ExtensionServicesConfig
|
kind: ExtensionServiceConfig
|
||||||
config:
|
config:
|
||||||
- name: nut-client
|
- name: nut-client
|
||||||
configFiles:
|
configFiles:
|
||||||
- content: MONITOR ${upsmonHost} 1 remote pass foo
|
- content: MONITOR ${upsmonHost} 1 remote pass foo
|
||||||
mountPath: /usr/local/etc/nut/upsmon.conf
|
mountPath: /usr/local/etc/nut/upsmon.conf
|
||||||
`),
|
`),
|
||||||
expectedErr: "\"ExtensionServicesConfig\" \"\": not registered",
|
expectedErr: "\"ExtensionServiceConfig\" \"\": not registered",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
apiVersion: v1alpha1
|
apiVersion: v1alpha1
|
||||||
kind: ExtensionServicesConfig
|
kind: ExtensionServiceConfig
|
||||||
config:
|
name: foo
|
||||||
- name: foo
|
configFiles:
|
||||||
configFiles:
|
- content: hello
|
||||||
- content: hello
|
mountPath: /etc/foo
|
||||||
mountPath: /etc/foo
|
|
||||||
|
|||||||
@ -151,14 +151,9 @@ func (container *Container) SideroLink() config.SideroLinkConfig {
|
|||||||
return matching[0]
|
return matching[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExtensionServicesConfig implements config.Config interface.
|
// ExtensionServiceConfigs implements config.Config interface.
|
||||||
func (container *Container) ExtensionServicesConfig() config.ExtensionServicesConfigConfig {
|
func (container *Container) ExtensionServiceConfigs() []config.ExtensionServiceConfig {
|
||||||
matching := findMatchingDocs[config.ExtensionServicesConfigConfig](container.documents)
|
return findMatchingDocs[config.ExtensionServiceConfig](container.documents)
|
||||||
if len(matching) == 0 {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return matching[0]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Runtime implements config.Config interface.
|
// Runtime implements config.Config interface.
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import (
|
|||||||
"github.com/siderolabs/talos/pkg/machinery/config/config"
|
"github.com/siderolabs/talos/pkg/machinery/config/config"
|
||||||
"github.com/siderolabs/talos/pkg/machinery/config/configloader"
|
"github.com/siderolabs/talos/pkg/machinery/config/configloader"
|
||||||
"github.com/siderolabs/talos/pkg/machinery/config/container"
|
"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/siderolink"
|
||||||
"github.com/siderolabs/talos/pkg/machinery/config/types/v1alpha1"
|
"github.com/siderolabs/talos/pkg/machinery/config/types/v1alpha1"
|
||||||
)
|
)
|
||||||
@ -38,16 +38,12 @@ func TestNew(t *testing.T) {
|
|||||||
sideroLinkCfg := siderolink.NewConfigV1Alpha1()
|
sideroLinkCfg := siderolink.NewConfigV1Alpha1()
|
||||||
sideroLinkCfg.APIUrlConfig.URL = must.Value(url.Parse("https://siderolink.api/join?jointoken=secret&user=alice"))(t)
|
sideroLinkCfg.APIUrlConfig.URL = must.Value(url.Parse("https://siderolink.api/join?jointoken=secret&user=alice"))(t)
|
||||||
|
|
||||||
extensionsCfg := extensionservicesconfig.NewExtensionServicesConfigV1Alpha1()
|
extensionsCfg := extensions.NewServicesConfigV1Alpha1()
|
||||||
extensionsCfg.Config = []extensionservicesconfig.ExtensionServiceConfig{
|
extensionsCfg.ServiceName = "test-extension"
|
||||||
|
extensionsCfg.ServiceConfigFiles = []extensions.ConfigFile{
|
||||||
{
|
{
|
||||||
ExtensionName: "test-extension",
|
ConfigFileContent: "test",
|
||||||
ExtensionServiceConfigFiles: []extensionservicesconfig.ExtensionServiceConfigFile{
|
ConfigFileMountPath: "/etc/test",
|
||||||
{
|
|
||||||
ExtensionContent: "test",
|
|
||||||
ExtensionMountPath: "/etc/test",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +55,7 @@ func TestNew(t *testing.T) {
|
|||||||
assert.True(t, cfg.Machine().Features().RBACEnabled())
|
assert.True(t, cfg.Machine().Features().RBACEnabled())
|
||||||
assert.Equal(t, "topsecret", cfg.Cluster().Secret())
|
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, "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.Same(t, v1alpha1Cfg, cfg.RawV1Alpha1())
|
||||||
assert.Equal(t, []config.Document{v1alpha1Cfg, sideroLinkCfg, extensionsCfg}, cfg.Documents())
|
assert.Equal(t, []config.Document{v1alpha1Cfg, sideroLinkCfg, extensionsCfg}, cfg.Documents())
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,82 @@
|
|||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
"$id": "https://talos.dev/v1.7/schemas/config.schema.json",
|
"$id": "https://talos.dev/v1.7/schemas/config.schema.json",
|
||||||
"$defs": {
|
"$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": {
|
"network.DefaultActionConfigV1Alpha1": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"apiVersion": {
|
"apiVersion": {
|
||||||
@ -3204,6 +3280,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"oneOf": [
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/$defs/extensions.ServiceConfigV1Alpha1"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"$ref": "#/$defs/network.DefaultActionConfigV1Alpha1"
|
"$ref": "#/$defs/network.DefaultActionConfigV1Alpha1"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -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
|
|
||||||
}
|
|
||||||
@ -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
|
|
||||||
}
|
|
||||||
@ -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)
|
|
||||||
}
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
apiVersion: v1alpha1
|
|
||||||
kind: ExtensionServicesConfig
|
|
||||||
config:
|
|
||||||
- name: foo
|
|
||||||
configFiles:
|
|
||||||
- content: hello
|
|
||||||
mountPath: /etc/foo
|
|
||||||
@ -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
|
||||||
|
}
|
||||||
10
pkg/machinery/config/types/runtime/extensions/extensions.go
Normal file
10
pkg/machinery/config/types/runtime/extensions/extensions.go
Normal 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 .
|
||||||
@ -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(),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
155
pkg/machinery/config/types/runtime/extensions/service_config.go
Normal file
155
pkg/machinery/config/types/runtime/extensions/service_config.go
Normal 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
|
||||||
|
}
|
||||||
@ -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)
|
||||||
|
}
|
||||||
8
pkg/machinery/config/types/runtime/extensions/testdata/extension_service_config.yaml
vendored
Normal file
8
pkg/machinery/config/types/runtime/extensions/testdata/extension_service_config.yaml
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
apiVersion: v1alpha1
|
||||||
|
kind: ExtensionServiceConfig
|
||||||
|
name: foo
|
||||||
|
configFiles:
|
||||||
|
- content: hello
|
||||||
|
mountPath: /etc/foo
|
||||||
|
environment:
|
||||||
|
- FOO=BAR
|
||||||
@ -6,9 +6,9 @@
|
|||||||
package types
|
package types
|
||||||
|
|
||||||
import (
|
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/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" // 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/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/v1alpha1" // import config types to register them
|
||||||
)
|
)
|
||||||
|
|||||||
@ -850,16 +850,16 @@ const (
|
|||||||
// FirmwarePath is the path to the standard Linux firmware location.
|
// FirmwarePath is the path to the standard Linux firmware location.
|
||||||
FirmwarePath = "/lib/firmware"
|
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.
|
// 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.
|
// ExtensionServiceRootfsPath is the path to the extracted rootfs files of extension services.
|
||||||
ExtensionServicesRootfsPath = "/usr/local/lib/containers"
|
ExtensionServiceRootfsPath = "/usr/local/lib/containers"
|
||||||
|
|
||||||
// ExtensionServicesUserConfigPath is the path to the user provider extension services config directory.
|
// ExtensionServiceUserConfigPath is the path to the user provided extension services config directory.
|
||||||
ExtensionServicesUserConfigPath = SystemOverlaysPath + "/extensions"
|
ExtensionServiceUserConfigPath = SystemOverlaysPath + "/extensions"
|
||||||
|
|
||||||
// DBusServiceSocketPath is the path to the D-Bus socket for the logind mock to connect to.
|
// DBusServiceSocketPath is the path to the D-Bus socket for the logind mock to connect to.
|
||||||
DBusServiceSocketPath = SystemRunPath + "/dbus/service.socket"
|
DBusServiceSocketPath = SystemRunPath + "/dbus/service.socket"
|
||||||
|
|||||||
@ -80,7 +80,7 @@ func (condition *ExtensionServiceConfigStatusCondition) String() string {
|
|||||||
func (condition *ExtensionServiceConfigStatusCondition) Wait(ctx context.Context) error {
|
func (condition *ExtensionServiceConfigStatusCondition) Wait(ctx context.Context) error {
|
||||||
_, err := condition.state.WatchFor(
|
_, err := condition.state.WatchFor(
|
||||||
ctx,
|
ctx,
|
||||||
resource.NewMetadata(NamespaceName, ExtensionServicesConfigStatusType, condition.serviceName, resource.VersionUndefined),
|
resource.NewMetadata(NamespaceName, ExtensionServiceConfigStatusType, condition.serviceName, resource.VersionUndefined),
|
||||||
state.WithEventTypes(state.Created, state.Updated),
|
state.WithEventTypes(state.Created, state.Updated),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// 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/.
|
// 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
|
package runtime
|
||||||
|
|
||||||
@ -23,19 +23,23 @@ func (o EventSinkConfigSpec) DeepCopy() EventSinkConfigSpec {
|
|||||||
return cp
|
return cp
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeepCopy generates a deep copy of ExtensionServicesConfigSpec.
|
// DeepCopy generates a deep copy of ExtensionServiceConfigSpec.
|
||||||
func (o ExtensionServicesConfigSpec) DeepCopy() ExtensionServicesConfigSpec {
|
func (o ExtensionServiceConfigSpec) DeepCopy() ExtensionServiceConfigSpec {
|
||||||
var cp ExtensionServicesConfigSpec = o
|
var cp ExtensionServiceConfigSpec = o
|
||||||
if o.Files != nil {
|
if o.Files != nil {
|
||||||
cp.Files = make([]ExtensionServicesConfigFile, len(o.Files))
|
cp.Files = make([]ExtensionServiceConfigFile, len(o.Files))
|
||||||
copy(cp.Files, 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
|
return cp
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeepCopy generates a deep copy of ExtensionServicesConfigStatusSpec.
|
// DeepCopy generates a deep copy of ExtensionServiceConfigStatusSpec.
|
||||||
func (o ExtensionServicesConfigStatusSpec) DeepCopy() ExtensionServicesConfigStatusSpec {
|
func (o ExtensionServiceConfigStatusSpec) DeepCopy() ExtensionServiceConfigStatusSpec {
|
||||||
var cp ExtensionServicesConfigStatusSpec = o
|
var cp ExtensionServiceConfigStatusSpec = o
|
||||||
return cp
|
return cp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,42 +13,43 @@ import (
|
|||||||
"github.com/siderolabs/talos/pkg/machinery/proto"
|
"github.com/siderolabs/talos/pkg/machinery/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ExtensionServicesConfigType is a type of ExtensionServicesConfig.
|
// ExtensionServiceConfigType is a type of ExtensionServiceConfig.
|
||||||
const ExtensionServicesConfigType = resource.Type("ExtensionServicesConfigs.runtime.talos.dev")
|
const ExtensionServiceConfigType = resource.Type("ExtensionServiceConfigs.runtime.talos.dev")
|
||||||
|
|
||||||
// ExtensionServicesConfig represents a resource that describes status of rendered extensions service config files.
|
// ExtensionServiceConfig represents a resource that describes status of rendered extensions service config files.
|
||||||
type ExtensionServicesConfig = typed.Resource[ExtensionServicesConfigSpec, ExtensionServicesConfigExtension]
|
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
|
//gotagsrewrite:gen
|
||||||
type ExtensionServicesConfigSpec struct {
|
type ExtensionServiceConfigSpec struct {
|
||||||
Files []ExtensionServicesConfigFile `yaml:"files" protobuf:"2"`
|
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
|
//gotagsrewrite:gen
|
||||||
type ExtensionServicesConfigFile struct {
|
type ExtensionServiceConfigFile struct {
|
||||||
Content string `yaml:"content" protobuf:"1"`
|
Content string `yaml:"content" protobuf:"1"`
|
||||||
MountPath string `yaml:"mountPath" protobuf:"2"`
|
MountPath string `yaml:"mountPath" protobuf:"2"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewExtensionServicesConfigSpec initializes a new ExtensionServiceConfigSpec.
|
// NewExtensionServiceConfigSpec initializes a new ExtensionServiceConfigSpec.
|
||||||
func NewExtensionServicesConfigSpec(namespace resource.Namespace, id resource.ID) *ExtensionServicesConfig {
|
func NewExtensionServiceConfigSpec(namespace resource.Namespace, id resource.ID) *ExtensionServiceConfig {
|
||||||
return typed.NewResource[ExtensionServicesConfigSpec, ExtensionServicesConfigExtension](
|
return typed.NewResource[ExtensionServiceConfigSpec, ExtensionServiceConfigExtension](
|
||||||
resource.NewMetadata(namespace, ExtensionServicesConfigType, id, resource.VersionUndefined),
|
resource.NewMetadata(namespace, ExtensionServiceConfigType, id, resource.VersionUndefined),
|
||||||
ExtensionServicesConfigSpec{},
|
ExtensionServiceConfigSpec{},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExtensionServicesConfigExtension provides auxiliary methods for ExtensionServiceConfig.
|
// ExtensionServiceConfigExtension provides auxiliary methods for ExtensionServiceConfig.
|
||||||
type ExtensionServicesConfigExtension struct{}
|
type ExtensionServiceConfigExtension struct{}
|
||||||
|
|
||||||
// ResourceDefinition implements meta.ResourceDefinitionProvider interface.
|
// ResourceDefinition implements meta.ResourceDefinitionProvider interface.
|
||||||
func (ExtensionServicesConfigExtension) ResourceDefinition() meta.ResourceDefinitionSpec {
|
func (ExtensionServiceConfigExtension) ResourceDefinition() meta.ResourceDefinitionSpec {
|
||||||
return meta.ResourceDefinitionSpec{
|
return meta.ResourceDefinitionSpec{
|
||||||
Type: ExtensionServicesConfigType,
|
Type: ExtensionServiceConfigType,
|
||||||
Aliases: []resource.Type{},
|
Aliases: []resource.Type{},
|
||||||
DefaultNamespace: NamespaceName,
|
DefaultNamespace: NamespaceName,
|
||||||
PrintColumns: []meta.PrintColumn{},
|
PrintColumns: []meta.PrintColumn{},
|
||||||
@ -58,7 +59,7 @@ func (ExtensionServicesConfigExtension) ResourceDefinition() meta.ResourceDefini
|
|||||||
func init() {
|
func init() {
|
||||||
proto.RegisterDefaultTypes()
|
proto.RegisterDefaultTypes()
|
||||||
|
|
||||||
err := protobuf.RegisterDynamic[ExtensionServicesConfigSpec](ExtensionServicesConfigType, &ExtensionServicesConfig{})
|
err := protobuf.RegisterDynamic[ExtensionServiceConfigSpec](ExtensionServiceConfigType, &ExtensionServiceConfig{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,34 +13,34 @@ import (
|
|||||||
"github.com/siderolabs/talos/pkg/machinery/proto"
|
"github.com/siderolabs/talos/pkg/machinery/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ExtensionServicesConfigStatusType is a type of ExtensionServicesConfig.
|
// ExtensionServiceConfigStatusType is a type of ExtensionServiceConfig.
|
||||||
const ExtensionServicesConfigStatusType = resource.Type("ExtensionServicesConfigStatuses.runtime.talos.dev")
|
const ExtensionServiceConfigStatusType = resource.Type("ExtensionServiceConfigStatuses.runtime.talos.dev")
|
||||||
|
|
||||||
// ExtensionServicesConfigStatus represents a resource that describes status of rendered extensions service config files.
|
// ExtensionServiceConfigStatus represents a resource that describes status of rendered extensions service config files.
|
||||||
type ExtensionServicesConfigStatus = typed.Resource[ExtensionServicesConfigStatusSpec, ExtensionServicesConfigStatusExtension]
|
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
|
//gotagsrewrite:gen
|
||||||
type ExtensionServicesConfigStatusSpec struct {
|
type ExtensionServiceConfigStatusSpec struct {
|
||||||
SpecVersion string `yaml:"specVersion" protobuf:"1"`
|
SpecVersion string `yaml:"specVersion" protobuf:"1"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewExtensionServicesConfigStatusSpec initializes a new ExtensionServicesConfigStatusSpec.
|
// NewExtensionServiceConfigStatusSpec initializes a new ExtensionServiceConfigStatusSpec.
|
||||||
func NewExtensionServicesConfigStatusSpec(namespace resource.Namespace, id resource.ID) *ExtensionServicesConfigStatus {
|
func NewExtensionServiceConfigStatusSpec(namespace resource.Namespace, id resource.ID) *ExtensionServiceConfigStatus {
|
||||||
return typed.NewResource[ExtensionServicesConfigStatusSpec, ExtensionServicesConfigStatusExtension](
|
return typed.NewResource[ExtensionServiceConfigStatusSpec, ExtensionServiceConfigStatusExtension](
|
||||||
resource.NewMetadata(namespace, ExtensionServicesConfigStatusType, id, resource.VersionUndefined),
|
resource.NewMetadata(namespace, ExtensionServiceConfigStatusType, id, resource.VersionUndefined),
|
||||||
ExtensionServicesConfigStatusSpec{},
|
ExtensionServiceConfigStatusSpec{},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExtensionServicesConfigStatusExtension provides auxiliary methods for ExtensionServiceConfig.
|
// ExtensionServiceConfigStatusExtension provides auxiliary methods for ExtensionServiceConfig.
|
||||||
type ExtensionServicesConfigStatusExtension struct{}
|
type ExtensionServiceConfigStatusExtension struct{}
|
||||||
|
|
||||||
// ResourceDefinition implements meta.ResourceDefinitionProvider interface.
|
// ResourceDefinition implements meta.ResourceDefinitionProvider interface.
|
||||||
func (ExtensionServicesConfigStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec {
|
func (ExtensionServiceConfigStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec {
|
||||||
return meta.ResourceDefinitionSpec{
|
return meta.ResourceDefinitionSpec{
|
||||||
Type: ExtensionServicesConfigStatusType,
|
Type: ExtensionServiceConfigStatusType,
|
||||||
Aliases: []resource.Type{},
|
Aliases: []resource.Type{},
|
||||||
DefaultNamespace: NamespaceName,
|
DefaultNamespace: NamespaceName,
|
||||||
PrintColumns: []meta.PrintColumn{},
|
PrintColumns: []meta.PrintColumn{},
|
||||||
@ -50,7 +50,7 @@ func (ExtensionServicesConfigStatusExtension) ResourceDefinition() meta.Resource
|
|||||||
func init() {
|
func init() {
|
||||||
proto.RegisterDefaultTypes()
|
proto.RegisterDefaultTypes()
|
||||||
|
|
||||||
err := protobuf.RegisterDynamic[ExtensionServicesConfigStatusSpec](ExtensionServicesConfigStatusType, &ExtensionServicesConfigStatus{})
|
err := protobuf.RegisterDynamic[ExtensionServiceConfigStatusSpec](ExtensionServiceConfigStatusType, &ExtensionServiceConfigStatus{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,4 +4,4 @@
|
|||||||
|
|
||||||
package runtime
|
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 .
|
||||||
|
|||||||
@ -128,8 +128,8 @@ Available dependencies:
|
|||||||
* `path: <path>`: wait for the `<path>` to exist
|
* `path: <path>`: wait for the `<path>` to exist
|
||||||
* `network: [addresses, connectivity, hostname, etcfiles]`: wait for the specified network readiness checks to succeed
|
* `network: [addresses, connectivity, hostname, etcfiles]`: wait for the specified network readiness checks to succeed
|
||||||
* `time: true`: wait for the NTP time sync
|
* `time: true`: wait for the NTP time sync
|
||||||
* `configuration: true`: wait for `ExtensionServicesConfig` resource with a name matching the extension name to be available.
|
* `configuration: true`: wait for `ExtensionServiceConfig` 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.
|
The mounts specified in the `ExtensionServiceConfig` will be added as extra mounts to the extension service.
|
||||||
|
|
||||||
### `restart`
|
### `restart`
|
||||||
|
|
||||||
|
|||||||
@ -209,9 +209,9 @@ description: Talos gRPC API reference.
|
|||||||
- [resource/definitions/runtime/runtime.proto](#resource/definitions/runtime/runtime.proto)
|
- [resource/definitions/runtime/runtime.proto](#resource/definitions/runtime/runtime.proto)
|
||||||
- [DevicesStatusSpec](#talos.resource.definitions.runtime.DevicesStatusSpec)
|
- [DevicesStatusSpec](#talos.resource.definitions.runtime.DevicesStatusSpec)
|
||||||
- [EventSinkConfigSpec](#talos.resource.definitions.runtime.EventSinkConfigSpec)
|
- [EventSinkConfigSpec](#talos.resource.definitions.runtime.EventSinkConfigSpec)
|
||||||
- [ExtensionServicesConfigFile](#talos.resource.definitions.runtime.ExtensionServicesConfigFile)
|
- [ExtensionServiceConfigFile](#talos.resource.definitions.runtime.ExtensionServiceConfigFile)
|
||||||
- [ExtensionServicesConfigSpec](#talos.resource.definitions.runtime.ExtensionServicesConfigSpec)
|
- [ExtensionServiceConfigSpec](#talos.resource.definitions.runtime.ExtensionServiceConfigSpec)
|
||||||
- [ExtensionServicesConfigStatusSpec](#talos.resource.definitions.runtime.ExtensionServicesConfigStatusSpec)
|
- [ExtensionServiceConfigStatusSpec](#talos.resource.definitions.runtime.ExtensionServiceConfigStatusSpec)
|
||||||
- [KernelModuleSpecSpec](#talos.resource.definitions.runtime.KernelModuleSpecSpec)
|
- [KernelModuleSpecSpec](#talos.resource.definitions.runtime.KernelModuleSpecSpec)
|
||||||
- [KernelParamSpecSpec](#talos.resource.definitions.runtime.KernelParamSpecSpec)
|
- [KernelParamSpecSpec](#talos.resource.definitions.runtime.KernelParamSpecSpec)
|
||||||
- [KernelParamStatusSpec](#talos.resource.definitions.runtime.KernelParamStatusSpec)
|
- [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
|
### ExtensionServiceConfigFile
|
||||||
ExtensionServicesConfigFile describes extensions service config files.
|
ExtensionServiceConfigFile describes extensions service config files.
|
||||||
|
|
||||||
|
|
||||||
| Field | Type | Label | Description |
|
| 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
|
### ExtensionServiceConfigSpec
|
||||||
ExtensionServicesConfigSpec describes status of rendered extensions service config files.
|
ExtensionServiceConfigSpec describes status of rendered extensions service config files.
|
||||||
|
|
||||||
|
|
||||||
| Field | Type | Label | Description |
|
| 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
|
### ExtensionServiceConfigStatusSpec
|
||||||
ExtensionServicesConfigStatusSpec describes status of rendered extensions service config files.
|
ExtensionServiceConfigStatusSpec describes status of rendered extensions service config files.
|
||||||
|
|
||||||
|
|
||||||
| Field | Type | Label | Description |
|
| Field | Type | Label | Description |
|
||||||
|
|||||||
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
description: |
|
||||||
|
Package extensions provides extensions config documents.
|
||||||
|
title: extensions
|
||||||
|
---
|
||||||
|
|
||||||
|
<!-- markdownlint-disable -->
|
||||||
|
|
||||||
@ -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. | |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -2,6 +2,82 @@
|
|||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
"$id": "https://talos.dev/v1.7/schemas/config.schema.json",
|
"$id": "https://talos.dev/v1.7/schemas/config.schema.json",
|
||||||
"$defs": {
|
"$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": {
|
"network.DefaultActionConfigV1Alpha1": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"apiVersion": {
|
"apiVersion": {
|
||||||
@ -3204,6 +3280,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"oneOf": [
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/$defs/extensions.ServiceConfigV1Alpha1"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"$ref": "#/$defs/network.DefaultActionConfigV1Alpha1"
|
"$ref": "#/$defs/network.DefaultActionConfigV1Alpha1"
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user