package mapper import ( goext "github.com/external-secrets/external-secrets/apis/externalsecrets/v1beta1" helmApi "github.com/fluxcd/helm-controller/api/v2" helmRepositoryApi "github.com/fluxcd/source-controller/api/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "edge-infra.dev/pkg/edge/api/graph/model" "edge-infra.dev/pkg/edge/bsl" "edge-infra.dev/pkg/edge/ctlfish" ) func GetHelmRepositories() model.LoqRequest { return BuildLogRequest(helmRepositoryApi.HelmRepositoryKind, helmRepositoryApi.GroupVersion.Group, helmRepositoryApi.GroupVersion.Version, nil, nil) } func GetHelmReleases() model.LoqRequest { return BuildLogRequest("HelmRelease", helmApi.GroupVersion.Group, helmApi.GroupVersion.Version, nil, nil) } func GetHelmRelease(name, ns *string) model.LoqRequest { return BuildLogRequest("HelmRelease", helmApi.GroupVersion.Group, helmApi.GroupVersion.Version, name, ns) } func GetSecrets(name, ns *string) model.LoqRequest { return BuildLogRequest("Secret", v1.GroupName, v1.SchemeGroupVersion.String(), name, ns) } func GetExternalSecrets(name, ns *string) model.LoqRequest { return BuildLogRequest("ExternalSecret", goext.ExtSecretGroupVersionKind.Group, goext.ExtSecretGroupVersionKind.Version, name, ns) } func GetNamespaces() model.LoqRequest { return BuildLogRequest("Namespace", v1.GroupName, v1.SchemeGroupVersion.String(), nil, nil) } func GetStore(name *string) model.LoqRequest { return BuildLogRequest("Store", "edge.ncr.com", "v1alpha1", name, name) } func GetCluster(name *string) model.LoqRequest { return BuildLogRequest("Cluster", "edge.ncr.com", "v1alpha1", name, nil) } func GetGKeCluster(name *string) model.LoqRequest { return BuildLogRequest("GKECluster", "edge.ncr.com", "v1alpha1", name, nil) } func GetBanner(name *string) model.LoqRequest { return BuildLogRequest("Banner", "edge.ncr.com", "v1alpha1", name, nil) } func GetStoreStatus(cid string) model.LoqRequest { return BuildLogRequest("StoreStatus", "edge.ncr.com", "v1", &cid, nil) } func GetBSLInfoConfigMap() model.LoqRequest { name := bsl.BSLInfoConfigMapName ns := metav1.NamespacePublic return BuildLogRequest("ConfigMap", v1.GroupName, v1.SchemeGroupVersion.String(), &name, &ns) } func GetClusterStatus() model.LoqRequest { name := ctlfish.ClusterStatusName namespace := ctlfish.ClusterStatusNamespace return BuildLogRequest(ctlfish.ClusterStatusKind, ctlfish.ClusterStatusGroup, ctlfish.ClusterStatusVersion, &name, &namespace) } func GetNodes() model.LoqRequest { return BuildLogRequest("Node", "", "v1", nil, nil) } func BuildLogRequest(kind, group, version string, name, namespace *string) model.LoqRequest { return model.LoqRequest{ Kind: kind, Group: group, Version: version, Name: name, Namespace: namespace, GetClusterEdgeID: false, } }