file_path stringlengths 3 280 | file_language stringclasses 66
values | content stringlengths 1 1.04M | repo_name stringlengths 5 92 | repo_stars int64 0 154k | repo_description stringlengths 0 402 | repo_primary_language stringclasses 108
values | developer_username stringlengths 1 25 | developer_name stringlengths 0 30 | developer_company stringlengths 0 82 |
|---|---|---|---|---|---|---|---|---|---|
pkg/cmd/get/inventory/datastores.go | Go | package inventory
import (
"context"
"fmt"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/util/output"
querypkg "github.com/yaacov/kubectl-mtv/pkg/util/query"
"github.com/yaacov/kubectl-mtv/pkg/util/watch"
)
// ListDatastoresWithInsecure queries the provider's datastore inventor... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/inventory/datavolumes.go | Go | package inventory
import (
"context"
"fmt"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/util/output"
querypkg "github.com/yaacov/kubectl-mtv/pkg/util/query"
"github.com/yaacov/kubectl-mtv/pkg/util/watch"
)
// ListDataVolumesWithInsecure queries the provider's data volume inven... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/inventory/disks.go | Go | package inventory
import (
"context"
"fmt"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/util/output"
querypkg "github.com/yaacov/kubectl-mtv/pkg/util/query"
"github.com/yaacov/kubectl-mtv/pkg/util/watch"
)
// ListDisksWithInsecure queries the provider's disk inventory with opt... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/inventory/ec2.go | Go | package inventory
import (
"context"
"fmt"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/util/output"
querypkg "github.com/yaacov/kubectl-mtv/pkg/util/query"
"github.com/yaacov/kubectl-mtv/pkg/util/watch"
)
// ListEC2InstancesWithInsecure queries the provider's EC2 instance inv... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/inventory/ec2_helpers.go | Go | package inventory
// ExtractEC2Objects processes EC2 inventory data by extracting the "object" field
// and discarding the envelope. This should be called immediately after fetching
// EC2 inventory data from the API server.
//
// The EC2 inventory server returns data in this format:
//
// {
// "id": "...",
// "na... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/inventory/folders.go | Go | package inventory
import (
"context"
"fmt"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/util/output"
querypkg "github.com/yaacov/kubectl-mtv/pkg/util/query"
"github.com/yaacov/kubectl-mtv/pkg/util/watch"
)
// ListFoldersWithInsecure queries the provider's folder inventory with... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/inventory/hosts.go | Go | package inventory
import (
"context"
"fmt"
"strings"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/util/output"
querypkg "github.com/yaacov/kubectl-mtv/pkg/util/query"
"github.com/yaacov/kubectl-mtv/pkg/util/watch"
)
// ListHostsWithInsecure queries the provider's host invento... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/inventory/inventory.go | Go | package inventory
import (
"context"
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/util/client"
)
// GetProviderByName fetches a provider by name from the specified namespace... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/inventory/namespaces.go | Go | package inventory
import (
"context"
"fmt"
"strings"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/util/output"
querypkg "github.com/yaacov/kubectl-mtv/pkg/util/query"
"github.com/yaacov/kubectl-mtv/pkg/util/watch"
)
// ListNamespacesWithInsecure queries the provider's namespa... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/inventory/networks.go | Go | package inventory
import (
"context"
"fmt"
"strings"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/util/output"
querypkg "github.com/yaacov/kubectl-mtv/pkg/util/query"
"github.com/yaacov/kubectl-mtv/pkg/util/watch"
)
// countNetworkHosts calculates the number of hosts connecte... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/inventory/openstack.go | Go | package inventory
import (
"context"
"fmt"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/util/output"
querypkg "github.com/yaacov/kubectl-mtv/pkg/util/query"
"github.com/yaacov/kubectl-mtv/pkg/util/watch"
)
// ListInstancesWithInsecure queries the provider's instance inventory ... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/inventory/profiles.go | Go | package inventory
import (
"context"
"fmt"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/util/output"
querypkg "github.com/yaacov/kubectl-mtv/pkg/util/query"
"github.com/yaacov/kubectl-mtv/pkg/util/watch"
)
// ListDiskProfilesWithInsecure queries the provider's disk profile inv... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/inventory/providers.go | Go | package inventory
import (
"context"
"fmt"
"strings"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/util/client"
"github.com/yaacov/kubectl-mtv/pkg/util/output"
querypkg "github.com/yaacov/kubectl-mtv/pkg/util/query"
"github.com/yaacov/kubectl-mtv/pkg/util/watch"
)
// ListProv... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/inventory/pvcs.go | Go | package inventory
import (
"context"
"fmt"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/util/output"
querypkg "github.com/yaacov/kubectl-mtv/pkg/util/query"
"github.com/yaacov/kubectl-mtv/pkg/util/watch"
)
// ListPersistentVolumeClaimsWithInsecure queries the provider's persis... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/inventory/resource_pools.go | Go | package inventory
import (
"context"
"fmt"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/util/output"
querypkg "github.com/yaacov/kubectl-mtv/pkg/util/query"
"github.com/yaacov/kubectl-mtv/pkg/util/watch"
)
// ListResourcePoolsWithInsecure queries the provider's resource pool i... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/inventory/storage.go | Go | package inventory
import (
"context"
"fmt"
"strings"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/util/output"
querypkg "github.com/yaacov/kubectl-mtv/pkg/util/query"
"github.com/yaacov/kubectl-mtv/pkg/util/watch"
)
// ListStorageWithInsecure queries the provider's storage in... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/inventory/vms.go | Go | package inventory
import (
"context"
"fmt"
"strings"
"gopkg.in/yaml.v3"
"k8s.io/cli-runtime/pkg/genericclioptions"
planv1beta1 "github.com/kubev2v/forklift/pkg/apis/forklift/v1beta1/plan"
"github.com/yaacov/kubectl-mtv/pkg/util/output"
querypkg "github.com/yaacov/kubectl-mtv/pkg/util/query"
"github.com/yaac... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/mapping/list.go | Go | package mapping
import (
"context"
"fmt"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/client-go/dynamic"
"github.com/yaacov/kubectl-mtv/pkg/util/client"
"github.com/yaacov/kubectl-mtv/pkg/util/o... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/plan/helpers.go | Go | package plan
import (
"fmt"
"strings"
"time"
"unicode/utf8"
)
// FormatTime formats a timestamp string with optional UTC conversion
func FormatTime(timestamp string, useUTC bool) string {
if timestamp == "" {
return "N/A"
}
// Parse the timestamp
t, err := time.Parse(time.RFC3339, timestamp)
if err != nil... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/plan/list.go | Go | package plan
import (
"context"
"fmt"
"strings"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/client-go/dynamic"
"github.com/yaacov/kubectl-mtv/pkg/cmd/get/plan/status"
"github.com/yaacov/kubectl-m... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/plan/status/status.go | Go | package status
import (
"context"
"fmt"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/dynamic"
)
// Migration status constants
const (
StatusRunning = "Running"
StatusFailed = "Faile... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/plan/vms.go | Go | package plan
import (
"context"
"fmt"
"strings"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/cmd/get/plan/status"
"github.com/yaacov/kubectl-mtv/pkg/util/client"
"github... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/get/provider/list.go | Go | package provider
import (
"context"
"fmt"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/client-go/dynamic"
"k8s.io/klog/v2"
"github.com/yaacov/kubectl-mtv/pkg/cmd/create/provider/providerutil"
"... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/health/controller.go | Go | package health
import (
"context"
"strconv"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/util/client"
)
// Known FQIN fields in ForkliftController spec
var knownFQINFields = []str... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/health/health.go | Go | package health
import (
"context"
"fmt"
"k8s.io/cli-runtime/pkg/genericclioptions"
)
// RunHealthCheck performs all health checks and returns a complete health report
func RunHealthCheck(ctx context.Context, configFlags *genericclioptions.ConfigFlags, opts HealthCheckOptions) (*HealthReport, error) {
report := N... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/health/logs.go | Go | package health
import (
"bufio"
"context"
"fmt"
"regexp"
"strings"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/client-go/kubernetes"
"github.com/yaacov/kubectl-mtv/pkg/util/client"
)
// Log analysis patterns (pre-compiled for... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/health/operator.go | Go | package health
import (
"context"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/util/client"
)
// CheckOperatorHealth checks the health of the MTV operator
func CheckOperatorHealth(ctx context.Context, configFlags *genericclioptions.ConfigFlags) OperatorHealth {
health := Operato... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/health/plans.go | Go | package health
import (
"context"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/util/client"
)
// CheckPlansHealth checks the health of all migration plans
func CheckPlansHealth(ctx... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/health/pods.go | Go | package health
import (
"context"
"fmt"
"time"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/util/client"
)
// ForkliftPodLabelSelector is the label selector used to identify Forklift pods
const Forklift... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/health/providers.go | Go | package health
import (
"context"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/util/client"
)
// ProviderCheckResult contains the results of provider health checks
type ProviderChe... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/health/report.go | Go | package health
import (
"encoding/json"
"fmt"
"strings"
"gopkg.in/yaml.v3"
"github.com/yaacov/kubectl-mtv/pkg/util/output"
)
// FormatReport formats the health report in the specified output format
func FormatReport(report *HealthReport, outputFormat string) (string, error) {
switch strings.ToLower(outputForm... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/health/types.go | Go | package health
import (
"time"
)
// HealthStatus represents the overall health status
type HealthStatus string
const (
HealthStatusHealthy HealthStatus = "Healthy"
HealthStatusWarning HealthStatus = "Warning"
HealthStatusCritical HealthStatus = "Critical"
HealthStatusUnknown HealthStatus = "Unknown"
)
// Is... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/help/generator.go | Go | package help
import (
"regexp"
"strconv"
"strings"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
// SchemaVersion is the current version of the help schema format.
// Version 1.2 removes positional args, provider hints, migration hints, and LLM annotations.
const SchemaVersion = "1.2"
// EnumValuer is an... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/help/generator_test.go | Go | package help
import (
"testing"
"github.com/spf13/cobra"
)
// --- helpers ---
// testEnumFlag implements EnumValuer for testing enum detection.
type testEnumFlag struct {
val string
validValues []string
}
func (f *testEnumFlag) String() string { return f.val }
func (f *testEnumFlag) Set(v string) e... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/help/topics.go | Go | package help
import "strings"
// Topic represents a built-in help topic that provides reference documentation
// for a domain-specific language or concept used across multiple commands.
type Topic struct {
// Name is the topic identifier (e.g., "tsl", "karl")
Name string `json:"name" yaml:"name"`
// Short is a one... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/help/topics_test.go | Go | package help
import "testing"
func TestGetTopic_TSL(t *testing.T) {
topic := GetTopic("tsl")
if topic == nil {
t.Fatal("expected TSL topic, got nil")
return
}
if topic.Name != "tsl" {
t.Errorf("expected name 'tsl', got %q", topic.Name)
}
if topic.Short == "" {
t.Error("expected non-empty short descripti... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/help/types.go | Go | // Package help provides machine-readable help output for kubectl-mtv commands.
package help
// HelpSchema represents the complete CLI help information in a machine-readable format.
type HelpSchema struct {
// Version is the schema version (e.g., "1.0")
Version string `json:"version" yaml:"version"`
// CLIVersion i... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/patch/mapping/network.go | Go | package mapping
import (
"context"
"fmt"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/klog/v2"
"github.com/yaacov/kubectl-mtv/p... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/patch/mapping/patch.go | Go | package mapping
import (
"fmt"
"strings"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/cli-runtime/pkg/genericclioptions"
)
// PatchNetwork patches a network mapping
func PatchNetwork(configFlags *genericclioptions.ConfigFlags, name, namespace, addPairs, updatePairs, removePairs, inventoryURL strin... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/patch/mapping/storage.go | Go | package mapping
import (
"context"
"fmt"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/klog/v2"
"github.com/yaacov/kubectl-mtv/p... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/patch/plan/patch.go | Go | package plan
import (
"context"
"encoding/json"
"fmt"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/klog/v2"
"github.com/yaacov... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/patch/provider/patch.go | Go | package provider
import (
"context"
"fmt"
"strconv"
"strings"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/kl... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/settings/settings.go | Go | // Package settings provides functionality for managing ForkliftController settings.
package settings
import (
"context"
"encoding/json"
"fmt"
"sort"
"strconv"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/types"
"k8s.io/... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/settings/settings_test.go | Go | package settings
import (
"errors"
"strings"
"testing"
)
// --- FormatValue ---
func TestFormatValue_NotSet(t *testing.T) {
sv := SettingValue{IsSet: false}
if got := FormatValue(sv); got != "(not set)" {
t.Errorf("FormatValue(not set) = %q, want %q", got, "(not set)")
}
}
func TestFormatValue_NilValue(t *t... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/settings/types.go | Go | // Package settings provides types and utilities for managing ForkliftController settings.
package settings
import "sort"
// SettingType represents the data type of a setting.
type SettingType string
const (
// TypeString represents a string setting.
TypeString SettingType = "string"
// TypeBool represents a bool... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/settings/types_test.go | Go | package settings
import (
"sort"
"testing"
)
// --- GetAllSettings ---
func TestGetAllSettings_MergesMaps(t *testing.T) {
all := GetAllSettings()
// Must include entries from both SupportedSettings and ExtendedSettings
for name := range SupportedSettings {
if _, ok := all[name]; !ok {
t.Errorf("GetAllSett... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/start/plan/start.go | Go | package plan
import (
"context"
"encoding/json"
"fmt"
"os"
"time"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/cli-runtime/pkg/genericclioptions"
"sigs... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/version/format.go | Go | package version
import (
"encoding/json"
"fmt"
"gopkg.in/yaml.v3"
)
// FormatOutput formats the version information according to the specified format
func (info Info) FormatOutput(format string) (string, error) {
switch format {
case "json":
return info.formatJSON()
case "yaml":
return info.formatYAML()
d... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/cmd/version/version.go | Go | package version
import (
"context"
"github.com/yaacov/kubectl-mtv/pkg/util/client"
"github.com/yaacov/kubectl-mtv/pkg/util/config"
"k8s.io/cli-runtime/pkg/genericclioptions"
)
// Info holds all version-related information
type Info struct {
ClientVersion string `json:"clientVersion" yaml:"clientVersion"`
O... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/mcp/discovery/registry.go | Go | package discovery
import (
"context"
"encoding/json"
"fmt"
"os"
"os/exec"
"sort"
"strings"
"time"
)
// Registry holds discovered kubectl-mtv commands organized by read/write access.
type Registry struct {
// ReadOnly contains commands that don't modify cluster state
ReadOnly map[string]*Command
// ReadOnl... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/mcp/discovery/registry_test.go | Go | package discovery
import (
"encoding/json"
"os"
"path/filepath"
"runtime"
"strings"
"testing"
)
// testdataPath returns the path to the help_machine_output.json fixture
// located in the testdata/ directory alongside this test file.
func testdataPath() string {
_, thisFile, _, _ := runtime.Caller(0)
return fi... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/mcp/discovery/types.go | Go | // Package discovery provides dynamic command discovery from kubectl-mtv help output.
package discovery
import "strings"
// HelpSchema matches kubectl-mtv help --machine output
type HelpSchema struct {
Version string `json:"version"`
CLIVersion string `json:"cli_version"`
Name string ... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/mcp/tools/coerce.go | Go | package tools
import (
"context"
"encoding/json"
"fmt"
"reflect"
"strings"
"github.com/google/jsonschema-go/jsonschema"
"github.com/modelcontextprotocol/go-sdk/mcp"
"github.com/yaacov/kubectl-mtv/pkg/mcp/util"
)
// extractKubeCredsFromRequest extracts Kubernetes credentials from the request's
// Extra.Header... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/mcp/tools/coerce_test.go | Go | package tools
import (
"context"
"encoding/json"
"testing"
"github.com/modelcontextprotocol/go-sdk/mcp"
"github.com/yaacov/kubectl-mtv/pkg/mcp/util"
)
// --- CoerceBooleans tests ---
// testInput is a struct used for testing CoerceBooleans.
type testInput struct {
Command string `json:"command" ... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/mcp/tools/kubectl.go | Go | package tools
import (
"context"
"encoding/json"
"fmt"
"regexp"
"strconv"
"strings"
"github.com/modelcontextprotocol/go-sdk/mcp"
"github.com/yaacov/kubectl-mtv/pkg/mcp/util"
)
// KubectlLogsInput represents the input for the kubectl_logs tool.
// All parameters are passed via flags, consistent with mtv_read/... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/mcp/tools/kubectl_test.go | Go | package tools
import (
"context"
"strings"
"testing"
"github.com/modelcontextprotocol/go-sdk/mcp"
"github.com/yaacov/kubectl-mtv/pkg/mcp/util"
)
// --- Tool definition tests ---
func TestGetMinimalKubectlLogsTool(t *testing.T) {
tool := GetMinimalKubectlLogsTool()
if tool.Name != "kubectl_logs" {
t.Errorf... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/mcp/tools/mtv_help.go | Go | package tools
import (
"context"
"fmt"
"regexp"
"strings"
"github.com/modelcontextprotocol/go-sdk/mcp"
"github.com/yaacov/kubectl-mtv/pkg/mcp/util"
)
// MTVHelpInput represents the input for the mtv_help tool.
type MTVHelpInput struct {
// Command is the kubectl-mtv command or topic to get help for.
// Examp... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/mcp/tools/mtv_help_test.go | Go | package tools
import (
"context"
"strings"
"testing"
"github.com/modelcontextprotocol/go-sdk/mcp"
)
// --- Tool definition tests ---
func TestGetMTVHelpTool(t *testing.T) {
tool := GetMTVHelpTool()
if tool.Name != "mtv_help" {
t.Errorf("Name = %q, want %q", tool.Name, "mtv_help")
}
if tool.Description =... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/mcp/tools/mtv_read.go | Go | package tools
import (
"context"
"fmt"
"strings"
"github.com/modelcontextprotocol/go-sdk/mcp"
"github.com/yaacov/kubectl-mtv/pkg/mcp/discovery"
"github.com/yaacov/kubectl-mtv/pkg/mcp/util"
)
// MTVReadInput represents the input for the mtv_read tool.
type MTVReadInput struct {
Command string `json:"command" j... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/mcp/tools/mtv_read_test.go | Go | package tools
import (
"context"
"encoding/json"
"os/exec"
"strings"
"testing"
"time"
"github.com/modelcontextprotocol/go-sdk/mcp"
"github.com/yaacov/kubectl-mtv/pkg/mcp/discovery"
"github.com/yaacov/kubectl-mtv/pkg/mcp/util"
)
// testRegistry builds a minimal registry for testing.
func testRegistry() *disc... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/mcp/tools/mtv_write.go | Go | package tools
import (
"context"
"fmt"
"strings"
"github.com/modelcontextprotocol/go-sdk/mcp"
"github.com/yaacov/kubectl-mtv/pkg/mcp/discovery"
"github.com/yaacov/kubectl-mtv/pkg/mcp/util"
)
// MTVWriteInput represents the input for the mtv_write tool.
type MTVWriteInput struct {
Command string `json:"command... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/mcp/tools/mtv_write_test.go | Go | package tools
import (
"context"
"strings"
"testing"
"github.com/modelcontextprotocol/go-sdk/mcp"
"github.com/yaacov/kubectl-mtv/pkg/mcp/discovery"
)
// --- Tool definition tests ---
func TestGetMTVWriteTool(t *testing.T) {
registry := testRegistry()
tool := GetMTVWriteTool(registry)
if tool.Name != "mtv_w... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/mcp/util/util.go | Go | package util
import (
"bytes"
"context"
"encoding/json"
"fmt"
"log"
"net/http"
"os"
"os/exec"
"regexp"
"strings"
"time"
shellquote "github.com/kballard/go-shellquote"
)
// contextKey is a custom type for context keys to avoid collisions
type contextKey string
const (
// kubeconfigTokenKey is the contex... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/mcp/util/util_test.go | Go | package util
import (
"context"
"net/http"
"os"
"strings"
"testing"
)
func TestResolveEnvVar(t *testing.T) {
// Set test environment variables
os.Setenv("TEST_HOST", "https://10.6.46.250")
os.Setenv("TEST_PORT", "443")
os.Setenv("TEST_USER", "admin")
defer func() {
os.Unsetenv("TEST_HOST")
os.Unsetenv("... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/client/access.go | Go | package client
import (
"context"
authorizationv1 "k8s.io/api/authorization/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/cli-runtime/pkg/genericclioptions"
)
// CanAccessResource checks if the user has permissions to perform the specified verb on the given r... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/client/client.go | Go | package client
import (
"context"
"fmt"
"io"
"net/http"
"net/url"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kub... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/client/inventory.go | Go | package client
import (
"context"
"encoding/json"
"fmt"
"net/url"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/klog/v2"
)
// parseJSONResponse parses a JSON response, treating empty or null resp... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/client/namespace.go | Go | package client
import (
"k8s.io/cli-runtime/pkg/genericclioptions"
)
// ForkliftMTVNamespace is the default namespace where Forklift MTV CRDs are deployed
const OpenShiftMTVNamespace = "openshift-mtv"
// ResolveNamespace determines the effective namespace with fallback logic:
// 1. Use namespace from command line f... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/client/operator.go | Go | package client
import (
"context"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/cli-runtime/pkg/genericclioptions"
)
// MTVOperatorInfo holds information about the MTV Operator installation
type MTVOp... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/client/routes.go | Go | package client
import (
"context"
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/cli-runtime/pkg/genericclioptions"
)
// CanAccessRoutesInNamespace checks if the user has permissions to list routes in the given namespace
func CanAccessRoutesInName... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/client/token.go | Go | package client
import (
"context"
"strings"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/klog/v2"
)
// Fallback namespaces where Forklift/MTV controller may be deployed
// Use... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/completion/completion.go | Go | package completion
import (
"context"
"fmt"
"strings"
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/yaacov/kubectl-mtv/pkg/cmd/get/inve... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/config/interfaces.go | Go | package config
import "k8s.io/cli-runtime/pkg/genericclioptions"
// InventoryConfigGetter defines the interface for getting inventory service configuration.
// This interface is shared across multiple commands that need to access the MTV inventory service.
type InventoryConfigGetter interface {
GetInventoryURL() str... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/flags/mapping_type.go | Go | package flags
import (
"fmt"
)
// MappingTypeFlag implements pflag.Value interface for mapping type validation
type MappingTypeFlag struct {
value string
}
func (m *MappingTypeFlag) String() string {
return m.value
}
func (m *MappingTypeFlag) Set(value string) error {
validTypes := []string{"network", "storage"... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/flags/migration_type.go | Go | package flags
import (
"fmt"
"github.com/kubev2v/forklift/pkg/apis/forklift/v1beta1"
)
// MigrationTypeFlag implements pflag.Value interface for migration type validation
type MigrationTypeFlag struct {
value v1beta1.MigrationType
}
func (m *MigrationTypeFlag) String() string {
return string(m.value)
}
func (m... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/flags/output_format_type.go | Go | package flags
import (
"fmt"
)
// OutputFormatTypeFlag implements pflag.Value interface for output format type validation
type OutputFormatTypeFlag struct {
value string
validFormats []string
}
func (o *OutputFormatTypeFlag) String() string {
return o.value
}
func (o *OutputFormatTypeFlag) Set(value stri... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/flags/provider_type.go | Go | package flags
import (
"fmt"
"strings"
forkliftv1beta1 "github.com/kubev2v/forklift/pkg/apis/forklift/v1beta1"
)
// staticProviderTypes is the single source of truth for built-in provider types.
var staticProviderTypes = []forkliftv1beta1.ProviderType{
forkliftv1beta1.OpenShift,
forkliftv1beta1.VSphere,
forkli... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/flags/sdk_endpoint_type.go | Go | package flags
import (
"fmt"
)
// SdkEndpointTypeFlag implements pflag.Value interface for SDK endpoint type validation
type SdkEndpointTypeFlag struct {
value string
}
func (s *SdkEndpointTypeFlag) String() string {
return s.value
}
func (s *SdkEndpointTypeFlag) Set(value string) error {
validTypes := []string... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/flags/vm_inventory_output_type.go | Go | package flags
import (
"fmt"
)
// VMInventoryOutputTypeFlag implements pflag.Value interface for VM inventory output format validation
type VMInventoryOutputTypeFlag struct {
value string
}
func (v *VMInventoryOutputTypeFlag) String() string {
return v.value
}
func (v *VMInventoryOutputTypeFlag) Set(value string... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/output/color.go | Go | package output
import (
"fmt"
"regexp"
"strings"
)
// ANSI color codes
const (
Reset = "\033[0m"
BoldText = "\033[1m"
RedColor = "\033[31m"
GreenColor = "\033[32m"
YellowColor = "\033[33m"
BlueColor = "\033[34m"
PurpleColor = "\033[35m"
CyanColor = "\033[36m"
White = "\033[37m"
Bol... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/output/json.go | Go | package output
// PrintJSON prints the given data as JSON using JSONPrinter
import (
"encoding/json"
"fmt"
"io"
"os"
)
// PrintJSONWithEmpty prints the given data as JSON using JSONPrinter with empty handling
func PrintJSONWithEmpty(data interface{}, emptyMessage string) error {
// Convert data to []map[string]i... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/output/table.go | Go | package output
// PrintTable prints the given data as a table using TablePrinter and headers
import (
"fmt"
"io"
"os"
"strings"
"unicode/utf8"
"github.com/yaacov/kubectl-mtv/pkg/util/query"
)
// PrintTableWithQuery prints the given data as a table using TablePrinter,
// supporting dynamic headers from query op... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/output/time.go | Go | package output
import (
"time"
)
// FormatTime formats a timestamp string with optional UTC conversion
func FormatTime(timestamp string, useUTC bool) string {
if timestamp == "" {
return "N/A"
}
// Parse the timestamp
t, err := time.Parse(time.RFC3339, timestamp)
if err != nil {
return timestamp
}
// Co... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/output/yaml.go | Go | package output
// PrintYAML prints the given data as YAML using YAMLPrinter
import (
"fmt"
"io"
"os"
"gopkg.in/yaml.v3"
)
// PrintYAMLWithEmpty prints the given data as YAML using YAMLPrinter with empty handling
func PrintYAMLWithEmpty(data interface{}, emptyMessage string) error {
items, ok := data.([]map[stri... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/query/apply.go | Go | package query
import (
"fmt"
)
// ApplyQuery filters, sorts, and limits the given items based on QueryOptions
func ApplyQuery(items []map[string]interface{}, queryOpts *QueryOptions) ([]map[string]interface{}, error) {
result := items
// Apply WHERE filtering if specified
if queryOpts.Where != "" {
var err err... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/query/filter.go | Go | package query
import (
"fmt"
"github.com/yaacov/tree-search-language/v6/pkg/tsl"
"github.com/yaacov/tree-search-language/v6/pkg/walkers/semantics"
)
// ParseWhereClause parses a WHERE clause string into a TSL tree
func ParseWhereClause(whereClause string) (*tsl.TSLNode, error) {
tree, err := tsl.ParseTSL(whereCl... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/query/filter_test.go | Go | package query
import (
"reflect"
"testing"
"time"
)
func TestApplyFilter(t *testing.T) {
tests := []struct {
name string
items []map[string]interface{}
where string
selectOpts []SelectOption
want []map[string]interface{}
wantErr bool
}{
{
name: "numeric greater than",
... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/query/helper.go | Go | package query
// ApplyQueryInterface parses the query string and applies it to the data (interface{}).
// Accepts data as []map[string]interface{} or map[string]interface{}.
// Returns filtered data as interface{} and error.
func ApplyQueryInterface(data interface{}, query string) (interface{}, error) {
var items []m... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/query/jsonpath.go | Go | package query
import (
"fmt"
"regexp"
"strconv"
"strings"
)
// GetValueByPathString gets a value from an object using a string path
// The path can use dot notation (e.g. "metadata.name") and array indexing (e.g. "spec.containers[0].name")
func GetValueByPathString(obj interface{}, path string) (interface{}, erro... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/query/jsonpath_test.go | Go | package query
import (
"reflect"
"testing"
"time"
)
func TestGetValueByPathString(t *testing.T) {
obj := map[string]interface{}{
"metadata": map[string]interface{}{
"name": "pod1",
"labels": map[string]interface{}{
"env": "prod",
},
},
"spec": map[string]interface{}{
"containers": []interfac... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/query/parallel_filter.go | Go | package query
import (
"fmt"
"runtime"
"sync"
)
// CalculateBatchSize determines an appropriate batch size based on the total items
// and available CPU cores. If providedBatchSize > 0, it uses that instead.
func CalculateBatchSize(totalItems int, providedBatchSize int) int {
if providedBatchSize > 0 {
return p... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/query/parse.go | Go | package query
import (
"fmt"
"regexp"
"strconv"
"strings"
)
var selectRegexp = regexp.MustCompile(`(?i)^(?:(sum|len|any|all)\s*\(?\s*([^)\s]+)\s*\)?|(.+?))\s*(?:as\s+(.+))?$`)
// parseSelectClause splits and parses a select clause into SelectOptions entries.
func parseSelectClause(selectClause string) []SelectOp... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/query/parse_test.go | Go | package query
import (
"reflect"
"testing"
)
func TestParseQueryString(t *testing.T) {
tests := []struct {
name string
query string
expected *QueryOptions
err bool
}{
{
name: "empty query",
query: "",
expected: &QueryOptions{
Select: nil,
HasSelect: false,
Where: ... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/query/reducer.go | Go | package query
import (
"fmt"
)
// applyReducer runs sum/len/any/all on slice values.
func applyReducer(value interface{}, reducer string) (interface{}, error) {
arr, ok := value.([]interface{})
if !ok {
// not an array – no reduction
return value, nil
}
switch reducer {
case "sum":
var total float64
fo... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/query/sort.go | Go | package query
import (
"fmt"
"sort"
"strconv"
)
// SortItems sorts the items based on the provided ordering options
func SortItems(items []map[string]interface{}, queryOpts *QueryOptions) ([]map[string]interface{}, error) {
orderOpts := queryOpts.OrderBy
selectOpts := queryOpts.Select
if len(orderOpts) == 0 {
... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/query/sort_test.go | Go | package query
import (
"reflect"
"testing"
)
func TestSortItems(t *testing.T) {
tests := []struct {
name string
items []map[string]interface{}
queryOpts *QueryOptions
want []map[string]interface{}
}{
{
name: "simple ascending",
items: []map[string]interface{}{
{"a": 2}, {"a": 1},... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/query/types.go | Go | package query
// QueryOptions contains the parsed query string options
type QueryOptions struct {
Select []SelectOption
Where string
OrderBy []OrderOption
Limit int
HasSelect bool
HasOrderBy bool
HasLimit bool
}
// SelectOption represents a column to be selected and its optional alias
type ... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/query/validate.go | Go | package query
import (
"fmt"
"regexp"
"strings"
)
// QueryKeyword represents a SQL-like keyword in queries
type QueryKeyword struct {
Name string
Pattern *regexp.Regexp
Position int // Expected position order (1=SELECT, 2=WHERE, 3=ORDER BY, 4=LIMIT)
}
// Common query keywords with their expected positions... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/query/validate_test.go | Go | package query
import (
"strings"
"testing"
)
func TestValidateQuerySyntax(t *testing.T) {
tests := []struct {
name string
query string
expectError bool
errorType string
errorMsg string
}{
// Valid queries
{
name: "empty query",
query: "",
expectError: false,
... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
pkg/util/tui/model.go | Go | package tui
import (
"time"
"github.com/charmbracelet/bubbles/help"
"github.com/charmbracelet/bubbles/key"
"github.com/charmbracelet/bubbles/spinner"
"github.com/charmbracelet/bubbles/viewport"
tea "github.com/charmbracelet/bubbletea"
)
// DataFetcher is a function that fetches and returns data as a formatted ... | yaacov/kubectl-mtv | 11 | A kubectl plugin that helps users of Forklift migrate virtualization workloads from oVirt, VMware, OpenStack, and OVA files to KubeVirt on Kubernetes. | Go | yaacov | Yaacov Zamir | Red Hat |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.