export

package
v0.1.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PodKey        = "pod"
	NamespacesKey = "namespace"
)

Variables

View Source
var ExportCmd = &cobra.Command{
	Use:   "export",
	Short: "Export Otterize intents from the kafka mapper",
	Args:  cobra.NoArgs,
	RunE: func(cmd *cobra.Command, args []string) error {
		ctxTimeout, cancel := context.WithTimeout(context.Background(), config.DefaultTimeout)
		defer cancel()

		podName := viper.GetString(PodKey)
		namespace := viper.GetString(NamespacesKey)

		m, err := kafkamapper.NewMapper()
		if err != nil {
			return err
		}

		intents, err := m.LoadIntents(ctxTimeout, podName, namespace)
		if err != nil {
			return err
		}

		exporter, err := intentsexporter.NewExporter()
		if err != nil {
			return err
		}

		if err := exporter.ExportIntents(intents); err != nil {
			return err
		}

		return nil
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL