Documentation ¶
Overview ¶
* Copyright 2020-2023 Alibaba Group Holding Limited.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
* Copyright 2020-2023 Alibaba Group Holding Limited.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
* Copyright 2020-2023 Alibaba Group Holding Limited.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
* Copyright 2020-2023 Alibaba Group Holding Limited.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
* Copyright 2020-2023 Alibaba Group Holding Limited.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
* Copyright 2020-2023 Alibaba Group Holding Limited.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
* Copyright 2020-2023 Alibaba Group Holding Limited.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
* Copyright 2020-2023 Alibaba Group Holding Limited.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
* Copyright 2020-2023 Alibaba Group Holding Limited.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
* Copyright 2020-2023 Alibaba Group Holding Limited.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
* Copyright 2020-2023 Alibaba Group Holding Limited.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
* Copyright 2020-2023 Alibaba Group Holding Limited.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
* Copyright 2020-2023 Alibaba Group Holding Limited.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
* Copyright 2020-2023 Alibaba Group Holding Limited.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func ApplyManifests(c client.Client, manifests Manifests, namespace string) error
- func ApplyManifestsWithOwnerRef(c client.Client, objs []*unstructured.Unstructured, ownerKind, refKind string) error
- func AssertNoArgs(cmd *cobra.Command, args []string)
- func AssertNoArgsOrInput(cmd *cobra.Command, args []string)
- func BuildObjsFromEtcdManifests(etcdConfig *k8s.EtcdConfig, name string, namespace string, replicas int, ...) ([]*unstructured.Unstructured, []*unstructured.Unstructured, error)
- func BuildObjsFromManifests(templateName string, value interface{}, tmplFunc map[string]interface{}) ([]*unstructured.Unstructured, error)
- func BuildObjsFromVineyarddManifests(files []string, value interface{}, tmplFunc map[string]interface{}) ([]*unstructured.Unstructured, error)
- func CaptureCmdOutput(cmd *cobra.Command) string
- func CheckClientSocket(cmd *cobra.Command, args []string)
- func ConnectDeployment(deployment, namespace string, readyChannel, stopChannel chan struct{}) (*client.RPCClient, error)
- func ConnectViaIPC(ipcSocket string) (*client.IPCClient, error)
- func ConnectViaRPC(rpcSocket string) (*client.RPCClient, error)
- func ConvertEmbeddedFSToKustomizeFS(efs embed.FS) (filesys.FileSystem, error)
- func ConvertToJson(str string) (string, error)
- func ConvertToYaml(str string) (string, error)
- func Create[T client.Object](c client.Client, v T, until ...func(T) bool) error
- func CreateIfNotExists[T client.Object](c client.Client, v T, until ...func(T) bool) error
- func CreateNamespaceIfNotExist(c client.Client)
- func CreateWithContext[T client.Object](c client.Client, ctx context.Context, v T, ignoreExists bool, ...) error
- func Delete(c client.Client, key types.NamespacedName, v client.Object) error
- func DeleteManifests(c client.Client, manifests Manifests, namespace string) error
- func DeleteWithContext(c client.Client, ctx context.Context, key types.NamespacedName, ...) error
- func Deserializer() runtime.Decoder
- func Examples(examples string) string
- func GetAnnotations(obj *unstructured.Unstructured) (map[string]string, error)
- func GetContainer(obj *unstructured.Unstructured) ([]interface{}, error)
- func GetContainersAndVolumes(obj *unstructured.Unstructured) ([]interface{}, []interface{}, error)
- func GetKubernetesConfig() *rest.Config
- func GetLabels(obj *unstructured.Unstructured) (map[string]string, error)
- func GetName(obj *unstructured.Unstructured) (string, error)
- func GetNamespace(obj *unstructured.Unstructured) (string, error)
- func GetPVAndPVC(pVAndPVC string) (*corev1.PersistentVolumeSpec, *corev1.PersistentVolumeClaimSpec, error)
- func GetRequiredPodAffinity(obj *unstructured.Unstructured) ([]interface{}, error)
- func GetStatus(obj *unstructured.Unstructured) (map[string]interface{}, error)
- func GetValidForwardPort(forwardPort int) (int, error)
- func GetVolume(obj *unstructured.Unstructured) ([]interface{}, error)
- func KubernetesClient() client.Client
- func KubernetesClientset() *kubernetes.Clientset
- func LongDesc(long string) string
- func ParseEnvs(envArray []string) ([]corev1.EnvVar, error)
- func ParseManifestToObject(manifest string) (*unstructured.Unstructured, error)
- func ParseOwnerRef(of string) ([]metav1.OwnerReference, error)
- func ParsePVCSpec(pvcspec string) (*corev1.PersistentVolumeClaimSpec, error)
- func ParsePVSpec(pvspec string) (*corev1.PersistentVolumeSpec, error)
- func ParsePVandPVCSpec(PvAndPvcJSON string) (*corev1.PersistentVolumeSpec, *corev1.PersistentVolumeClaimSpec, error)
- func ParseSecurityContext(securityContextJSON string) (*corev1.SecurityContext, error)
- func ParseVineyardClusters(clusters []string) (*[]v1alpha1.VineyardClusters, error)
- func ParseVolume(volumeJSON string) (*[]corev1.Volume, error)
- func ParseVolumeMount(volumeMountJSON string) (*[]corev1.VolumeMount, error)
- func PortForwardDeployment(deploymentName, namespace string, forwardPort, port int, ...)
- func ReadFromFile(path string) (string, error)
- func ReadFromStdin(args []string) (string, error)
- func ReadJsonFromStdin(args []string) (string, error)
- func RenderManifestAsObj(path string, value interface{}, tmplFunc map[string]interface{}) (*unstructured.Unstructured, error)
- func Scheme() *runtime.Scheme
- func SetAnnotations(obj *unstructured.Unstructured, annotations map[string]string) error
- func SetContainer(obj *unstructured.Unstructured, containers []interface{}) error
- func SetLabels(obj *unstructured.Unstructured, labels map[string]string) error
- func SetNodename(obj *unstructured.Unstructured, nodename string) error
- func SetRequiredPodAffinity(obj *unstructured.Unstructured, required []interface{}) error
- func SetVolume(obj *unstructured.Unstructured, volumes []interface{}) error
- func Wait(condition wait.ConditionFunc) error
- func WaitForDNSName(dnsName string, timeout time.Duration) error
- func WriteCertstoDir(dir string, ca *CertificateAuthority, wbcert *WebhookCertificate) error
- func WriteToFile(path string, content string) error
- type CertGenerator
- type CertificateAuthority
- type Client
- func (c *Client) GetBlob(id string, unsafe bool) (blob map[types.ObjectID]client.Blob, err error)
- func (c *Client) GetClusterInfo() (map[string]any, error)
- func (c *Client) GetMetaData(id string, syncRemote bool) (meta *client.ObjectMeta, err error)
- func (c *Client) ListBlobs(limit int) (map[types.ObjectID]client.Blob, error)
- func (c *Client) ListMetadatas(pattern string, regex bool, limits int) (map[string]map[string]any, error)
- func (c *Client) PutBlob(address []byte, size uint64) (types.ObjectID, error)
- type KeyValue
- type Manifests
- type Objects
- type Options
- type Output
- type WebhookCertificate
Constants ¶
const ( // ForwardAddress is the address to forward to ForwardAddress = "127.0.0.1" // DeploymentLabel is the label used to select the pod under a deployment DeploymentLabel = "app.vineyard.io/name" )
const (
// PodKind is the kind of the kubernetes pod.
PodKind = "Pod"
)
Variables ¶
var ( CACommonName = "vineyard-webhook-ca" CAOrgainzation = []string{"Alibaba"} // CAKeyName is the name of the CA private key CAKeyName = "ca-key.pem" // CACertName is the name of the CA certificate CACertName = "ca-cert.pem" // WebhookServerKeyName is the name of the webhook server private key WebhookServerKeyName = "key.pem" // WebhookServerKeyForTLSName is the name of the webhook server private key for TLS WebhookServerKeyForTLSName = "tls.key" // WebhookServerCertName is the name of the webhook server certificate WebhookServerCertName = "cert.pem" // WebhookServerCertForTLSName is the name of the webhook server certificate for TLS WebhookServerCertForTLSName = "tls.crt" )
var ( // MetaHeaders are the headers for the less metadata output MetaHeaders []string = []string{"ID", "TYPENAME", "LENGTH", "TRANSIENT", "TYPE", "MEMBERS", "INSTANCE ID"} // ClusterInfoHeaders are the headers for the cluster info output ClusterInfoHeaders []string = []string{"INSTANCE ID", "HOSTID", "HOSTNAME", "IPC_SOCKET", "NODENAME", "RPC_ENDPOINT", "TIMESTAMP"} // BufferHeaders are the headers for the buffer output BufferHeaders []string = []string{"ID", "BUFFER"} // ValidSortedKeys are the valid keys for sorting ValidSortedKeys []string = []string{"id", "typename", "type", "instance_id"} // ValidOutputFormats are the valid output formats ValidOutputFormats []string = []string{"table", "json"} )
var Indentation = " "
Functions ¶
func ApplyManifests ¶
ApplyManifests create kubernetes resources from manifests
func ApplyManifestsWithOwnerRef ¶
func ApplyManifestsWithOwnerRef(c client.Client, objs []*unstructured.Unstructured, ownerKind, refKind string) error
ApplyManifestsWithOwnerRef create kubernetes resources from manifests and choose one object as the owner of the other specific objects Currently, only support to use the kind of manifest as the distinguishing conditions. As a result, the ownerKind and refKind should not to be the same. Also, the refKind could be more than one and should be separated by comma.
func AssertNoArgs ¶
func AssertNoArgsOrInput ¶
func BuildObjsFromEtcdManifests ¶
func BuildObjsFromEtcdManifests(etcdConfig *k8s.EtcdConfig, name string, namespace string, replicas int, image string, value interface{}, tmplFunc map[string]interface{}, ) ([]*unstructured.Unstructured, []*unstructured.Unstructured, error)
BuildObjsFromEtcdManifests builds a list of objects from the etcd template files. the template files are under the dir 'k8s/pkg/templates/etcd'
func BuildObjsFromManifests ¶
func BuildObjsFromManifests(templateName string, value interface{}, tmplFunc map[string]interface{}, ) ([]*unstructured.Unstructured, error)
BuildObjsFromManifests builds a list of objects from the the standard template files such as backup and recover
func BuildObjsFromVineyarddManifests ¶
func BuildObjsFromVineyarddManifests(files []string, value interface{}, tmplFunc map[string]interface{}, ) ([]*unstructured.Unstructured, error)
BuildObjsFromVineyarddManifests builds a list of objects from the vineyardd template files.
func CaptureCmdOutput ¶
func CheckClientSocket ¶
func ConnectDeployment ¶
func ConnectDeployment(deployment, namespace string, readyChannel, stopChannel chan struct{}) (*client.RPCClient, error)
ConnectDeployment connects to the vineyardd deployment via rpc
func ConnectViaIPC ¶
ConnectViaIPC connects to the ipc server
func ConnectViaRPC ¶
ConnectViaRPC connects to the rpc server
func ConvertEmbeddedFSToKustomizeFS ¶
func ConvertEmbeddedFSToKustomizeFS(efs embed.FS) (filesys.FileSystem, error)
ConvertEmbeddedFSToKustomizeFS performs a walk from the root of the provided embed.FS and copies the file tree into an in-memory Kustomize FileSystem,
func ConvertToJson ¶
ConvertToJson check whether the string is json type and converts the string to json type if not
func ConvertToYaml ¶
ConvertToYaml converts the json string to yaml type
func CreateIfNotExists ¶
func CreateNamespaceIfNotExist ¶
CreateNamespaceIfNotExist creates namespace if it does not exist
func CreateWithContext ¶
func DeleteManifests ¶
DeleteManifests delete kubernetes resources from manifests
func DeleteWithContext ¶
func Deserializer ¶
func GetAnnotations ¶
func GetAnnotations(obj *unstructured.Unstructured) (map[string]string, error)
GetAnnotations returns the annotations of the given unstructured kubernetes object.
func GetContainer ¶
func GetContainer(obj *unstructured.Unstructured) ([]interface{}, error)
GetContainer returns the container interface with the given unstructured kubernetes object.
func GetContainersAndVolumes ¶
func GetContainersAndVolumes(obj *unstructured.Unstructured) ([]interface{}, []interface{}, error)
GetContainersAndVolumes returns the containers and volumes of the given unstructured kubernetes object.
func GetKubernetesConfig ¶
func GetLabels ¶
func GetLabels(obj *unstructured.Unstructured) (map[string]string, error)
GetLabels returns the labels of the given unstructured kubernetes object.
func GetName ¶
func GetName(obj *unstructured.Unstructured) (string, error)
GetName returns the name of the given unstructured kubernetes object.
func GetNamespace ¶
func GetNamespace(obj *unstructured.Unstructured) (string, error)
GetNamespace returns the namespace of the given unstructured kubernetes object.
func GetPVAndPVC ¶
func GetPVAndPVC(pVAndPVC string) (*corev1.PersistentVolumeSpec, *corev1.PersistentVolumeClaimSpec, error)
GetPVAndPVC parse the pVAndPVC string to corev1.PersistentVolumeSpec and corev1.PersistentVolumeClaimSpec, then return the relevant fields.
func GetRequiredPodAffinity ¶
func GetRequiredPodAffinity(obj *unstructured.Unstructured) ([]interface{}, error)
GetRequiredPodAffinity returns the required pod affinity of the given unstructured kubernetes object.
func GetStatus ¶
func GetStatus(obj *unstructured.Unstructured) (map[string]interface{}, error)
GetStatus returns the status of the given unstructured kubernetes object.
func GetValidForwardPort ¶
func GetVolume ¶
func GetVolume(obj *unstructured.Unstructured) ([]interface{}, error)
GetVolume returns the volume interface with the given unstructured kubernetes object.
func KubernetesClient ¶
KubernetesClient return the kubernetes client
func KubernetesClientset ¶
func KubernetesClientset() *kubernetes.Clientset
KubernetesClientset return the kubernetes clientset
func ParseManifestToObject ¶
func ParseManifestToObject(manifest string) (*unstructured.Unstructured, error)
ParseManifestToObject parse a kubernetes manifest to an object
func ParseOwnerRef ¶
func ParseOwnerRef(of string) ([]metav1.OwnerReference, error)
ParseOwnerRef parse the string to metav1.OwnerReference
func ParsePVCSpec ¶
func ParsePVCSpec(pvcspec string) (*corev1.PersistentVolumeClaimSpec, error)
ParsePVCSpec parse the json string to corev1.PersistentVolumeClaimSpec
func ParsePVSpec ¶
func ParsePVSpec(pvspec string) (*corev1.PersistentVolumeSpec, error)
ParsePVSpec parse the json string to corev1.PersistentVolumeSpec
func ParsePVandPVCSpec ¶
func ParsePVandPVCSpec( PvAndPvcJSON string, ) (*corev1.PersistentVolumeSpec, *corev1.PersistentVolumeClaimSpec, error)
ParsePVandPVCSpec parse the json string to corev1.PersistentVolumeSpec and corev1.PersistentVolumeClaimSpec
func ParseSecurityContext ¶
func ParseSecurityContext(securityContextJSON string) (*corev1.SecurityContext, error)
ParseSecurityContext parse the json string to corev1.SecurityContext
func ParseVineyardClusters ¶
func ParseVineyardClusters(clusters []string) (*[]v1alpha1.VineyardClusters, error)
ParseVineyardClusters parse the []string to nested []{ "namespace": "vineyard-cluster-namespace", "name": "vineyard-cluster-name", }
func ParseVolume ¶
ParseVolume parse the json string to corev1.Volume
func ParseVolumeMount ¶
func ParseVolumeMount(volumeMountJSON string) (*[]corev1.VolumeMount, error)
ParseVolumeMount parse the json string to corev1.VolumeMount
func PortForwardDeployment ¶
func ReadFromFile ¶
ReadFromFile reads the file and returns the content as a string.
func ReadFromStdin ¶
ReadFromStdin read the stdin to string
func ReadJsonFromStdin ¶
ReadJsonFromStdin read the stdin to json string
func RenderManifestAsObj ¶
func RenderManifestAsObj(path string, value interface{}, tmplFunc map[string]interface{}, ) (*unstructured.Unstructured, error)
RenderManifestAsObj renders the manifest as an object
func SetAnnotations ¶
func SetAnnotations(obj *unstructured.Unstructured, annotations map[string]string) error
SetAnnotations sets the annotations of the given unstructured kubernetes object.
func SetContainer ¶
func SetContainer(obj *unstructured.Unstructured, containers []interface{}) error
SetContainer sets the container with the given unstructured kubernetes object.
func SetLabels ¶
func SetLabels(obj *unstructured.Unstructured, labels map[string]string) error
SetLabels sets the labels of the given unstructured kubernetes object.
func SetNodename ¶
func SetNodename(obj *unstructured.Unstructured, nodename string) error
SetNodename sets the nodename of the given unstructured kubernetes object.
func SetRequiredPodAffinity ¶
func SetRequiredPodAffinity(obj *unstructured.Unstructured, required []interface{}) error
SetRequiredPodAffinity sets the required pod affinity of the given unstructured kubernetes object.
func SetVolume ¶
func SetVolume(obj *unstructured.Unstructured, volumes []interface{}) error
SetVolume sets the volume with the given unstructured kubernetes object.
func Wait ¶
func Wait(condition wait.ConditionFunc) error
func WaitForDNSName ¶
wait for a DNS name to be resolved with a timeout
func WriteCertstoDir ¶
func WriteCertstoDir(dir string, ca *CertificateAuthority, wbcert *WebhookCertificate) error
WriteCertstoDir writes the given data to the given file under the given directory
func WriteToFile ¶
WriteToFile writes the content to the file.
Types ¶
type CertGenerator ¶
type CertGenerator struct { // CommonName is the common name of the certificate CommonName string // Organizations is the organization of the certificate Organizations []string // DNSName is the DNS name of the certificate DNSName string // Directory is the directory to store the generated certificates Directory string CertificateAuthority WebhookCertificate }
func NewCertGenerator ¶
func (*CertGenerator) Generate ¶
func (c *CertGenerator) Generate() error
func (*CertGenerator) PatchCABundleToMutatingWebhook ¶
func (c *CertGenerator) PatchCABundleToMutatingWebhook(webhookName string) error
func (*CertGenerator) PatchCABundleToValidatingWebhook ¶
func (c *CertGenerator) PatchCABundleToValidatingWebhook(webhookName string) error
type CertificateAuthority ¶
type CertificateAuthority struct { Cert *x509.Certificate Key *rsa.PrivateKey }
CertificateAuthority represents a self-signed CA
func NewCertificateAuthority ¶
func NewCertificateAuthority(commonName string, organizations []string) (*CertificateAuthority, error)
NewCertificateAuthority create a new self-signed CA
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient() (Client, chan struct{})
NewClient returns a new client connected to the vineyardd server
func (*Client) GetClusterInfo ¶
GetClusterInfo returns the cluster info
func (*Client) GetMetaData ¶
GetMetadata
type Manifests ¶
type Manifests []*unstructured.Unstructured
func ParseManifestsToObjects ¶
ParseManifestsToObjects parse kubernetes manifests to objects
type Objects ¶
type Objects interface { ListMetadatas(string, bool, int) (map[string]map[string]any, error) ListBlobs() (map[types.ObjectID]client.Blob, error) GetClusterInfo() (map[string]map[string]string, error) GetBlob(id string, unsafe bool) (blob map[types.ObjectID]client.Blob, err error) GetMetaData(id string, syncRemote bool) (meta *client.ObjectMeta, err error) }
Objects are the operate interface for all objects
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options are the options for the output
type Output ¶
type Output struct { Options // contains filtered or unexported fields }
Output is the output of the metadata and buffers
func (*Output) WithFilter ¶
type WebhookCertificate ¶
type WebhookCertificate struct { Cert *x509.Certificate Key *rsa.PrivateKey }
WebhookCertificate contains the certificate and key of webhook server
func NewWebhookCertificate ¶
func NewWebhookCertificate(commonName string, organizations []string, ca *CertificateAuthority, dnsName string) (*WebhookCertificate, error)
NewWebhookCertificate create a new certificate for webhook server