Documentation
¶
Index ¶
- func AddSshFlags(flags *pflag.FlagSet, sshConf *SshConfig)
- func AllContainerIsRunning(pod *corev1.Pod) bool
- func BytesToInt(b []byte) uint32
- func CanI(clientset *kubernetes.Clientset, sa, ns string, resource *rbacv1.PolicyRule) (allowed bool, err error)
- func CheckPodStatus(cCtx context.Context, cFunc context.CancelFunc, podName string, ...)
- func CleanExtensionLib()
- func ConvertConfig(factory cmdutil.Factory) ([]byte, error)
- func ConvertK8sApiServerToDomain(kubeConfigPath string) (newPath string, err error)
- func ConvertToKubeConfigBytes(factory cmdutil.Factory) ([]byte, string, error)
- func ConvertToTempKubeconfigFile(kubeconfigBytes []byte) (string, error)
- func CopyVolumeIntoContainer(ctx context.Context, volume []mount.Mount, cli *client.Client, id string) error
- func CreateCIDRPod(ctx context.Context, clientset *kubernetes.Clientset, namespace string) (*v12.Pod, error)
- func CreateFolder(ctx context.Context, cli *client.Client, id string, src string, target string) (string, error)
- func Deduplicate(cidr []*net.IPNet) (result []*net.IPNet)
- func DeleteBlockFirewallRule(ctx context.Context)
- func DialSshRemote(ctx context.Context, conf *SshConfig) (remote *ssh.Client, err error)
- func DoReq(request *http.Request) (body []byte, err error)
- func Download(client *http.Client, url string, filename string, stdout, stderr io.Writer) error
- func DownloadFile(uri string) (string, error)
- func DownloadFileStream(uri string) ([]byte, error)
- func DownloadFileWithName(uri, name string) (string, error)
- func FindContainerByName(pod *corev1.Pod, name string) (*corev1.Container, int)
- func FindContainerEnv(container *corev1.Container, key string) (value string, found bool)
- func GetAnnotation(f util.Factory, ns string, resources string) (map[string]string, error)
- func GetAvailableTCPPortOrDie() (int, error)
- func GetAvailableUDPPortOrDie() (int, error)
- func GetCIDRByDumpClusterInfo(ctx context.Context, clientset *kubernetes.Clientset) ([]*net.IPNet, error)
- func GetCIDRElegant(ctx context.Context, clientset *kubernetes.Clientset, restconfig *rest.Config, ...) ([]*net.IPNet, error)
- func GetCIDRFromCNI(ctx context.Context, clientset *kubernetes.Clientset, restconfig *rest.Config, ...) ([]*net.IPNet, error)
- func GetCIDRFromResourceUgly(ctx context.Context, clientset *kubernetes.Clientset, namespace string) []*net.IPNet
- func GetClient() (*client.Client, *command.DockerCli, error)
- func GetClusterID(ctx context.Context, client v12.ConfigMapInterface) (types.UID, error)
- func GetClusterIDByCM(cm *v1.ConfigMap) types.UID
- func GetDNS(ctx context.Context, clientSet *kubernetes.Clientset, restConfig *rest.Config, ...) (*dns.ClientConfig, error)
- func GetDNSIPFromDnsPod(ctx context.Context, clientset *kubernetes.Clientset) (ips []string, err error)
- func GetDNSServiceIPFromPod(ctx context.Context, clientset *kubernetes.Clientset, config *rest.Config, ...) (*dns.ClientConfig, error)
- func GetEnv(ctx context.Context, set *kubernetes.Clientset, config *rest.Config, ...) (map[string][]string, error)
- func GetIPBaseNic() (*net.IPNet, error)
- func GetKrb5Path() string
- func GetKubeConfigPath(f cmdutil.Factory) string
- func GetKubeconfigCluster(f cmdutil.Factory) string
- func GetKubeconfigPath(factory cmdutil.Factory) (string, error)
- func GetLocalTunIP(tunName string) (net.IP, net.IP, error)
- func GetManifest(httpCli *http.Client, os string, arch string) (version string, url string, err error)
- func GetNsForListPodAndSvc(ctx context.Context, clientset *kubernetes.Clientset, nsList []string) (podNs string, svcNs string, err error)
- func GetPodCIDRFromCNI(ctx context.Context, clientset *kubernetes.Clientset, restconfig *rest.Config, ...) ([]*net.IPNet, error)
- func GetPodCIDRFromPod(ctx context.Context, clientset *kubernetes.Clientset, namespace string, ...) ([]*net.IPNet, error)
- func GetPodTemplateSpecPath(u *unstructured.Unstructured) (*v1.PodTemplateSpec, []string, error)
- func GetRunningPodList(ctx context.Context, clientset *kubernetes.Clientset, ns string, ...) ([]corev1.Pod, error)
- func GetServiceCIDRByCreateService(ctx context.Context, serviceInterface corev1.ServiceInterface) (*net.IPNet, error)
- func GetTlsDomain(namespace string) string
- func GetTopOwnerReference(factory util.Factory, namespace, workload string) (*resource.Info, error)
- func GetTopOwnerReferenceBySelector(factory util.Factory, namespace, selector string) (sets.Set[string], error)
- func GetTunDevice(ips ...net.IP) (*net.Interface, error)
- func GetTunDeviceByConn(tun net.Conn) (*net.Interface, error)
- func GetUnstructuredObject(f util.Factory, namespace string, workloads string) (*resource.Info, error)
- func GetUnstructuredObjectBySelector(f util.Factory, namespace string, selector string) ([]*resource.Info, error)
- func GetUnstructuredObjectList(f util.Factory, namespace string, workloads []string) ([]*resource.Info, error)
- func GetVolume(ctx context.Context, f util.Factory, ns, podName string) (map[string][]mount.Mount, error)
- func InitFactory(kubeconfigBytes string, ns string) cmdutil.Factory
- func InitFactoryByPath(kubeconfig string, ns string) cmdutil.Factory
- func InitLogger(debug bool)
- func InitLoggerForServer(debug bool)
- func IsAdmin() bool
- func IsIPv4(packet []byte) bool
- func IsIPv6(packet []byte) bool
- func IsIPv6Enabled() (bool, error)
- func IsPortListening(port int) bool
- func IsSameCluster(client v12.ConfigMapInterface, namespace string, ...) (bool, error)
- func IsWindows() bool
- func Join(names ...string) string
- func JumpTo(ctx context.Context, bClient *ssh.Client, to SshConfig) (client *ssh.Client, err error)
- func ListPod(ctx context.Context, lister v12.PodInterface, ...) error
- func ListService(ctx context.Context, lister v12.ServiceInterface, ...) error
- func Merge[K comparable, V any](fromMap, ToMap map[K]V) map[K]V
- func Move(src, dst string) error
- func NewPrincipal(name types.PrincipalName, realm string) principal
- func ParseCIDRFromString(content string) (result []*net.IPNet)
- func ParseDirMapping(dir string) (local, remote string, err error)
- func ParsePort(str string) v1.ContainerPort
- func Ping(ctx context.Context, srcIP, dstIP string) (bool, error)
- func PortForwardPod(config *rest.Config, clientset *rest.RESTClient, podName, namespace string, ...) error
- func PortMapUntil(ctx context.Context, conf *SshConfig, remote, local netip.AddrPort) error
- func Print(writer io.Writer, slogan string)
- func PrintLine(f func(...any), msg ...string)
- func PrintStatus(pod *corev1.Pod, writer io.Writer)
- func PrintStatusInline(pod *corev1.Pod) string
- func PullImage(ctx context.Context, platform *v1.Platform, cli *client.Client, ...) error
- func RemoteRun(client *ssh.Client, cmd string, env map[string]string) (output []byte, errOut []byte, err error)
- func RemoveDir(volume map[string][]mount.Mount) error
- func Rollback(f util.Factory, ns, workload string)
- func RolloutStatus(ctx1 context.Context, factory cmdutil.Factory, namespace, workloads string, ...) (err error)
- func RunCmd(exe string, args []string) error
- func RunCmdWithElevated(exe string, args []string) error
- func RunWithElevated()
- func RunWithRollingOutWithChecker(cmd *osexec.Cmd, checker func(log string)) (string, string, error)
- func RunningInContainer() bool
- func SCP(client *ssh.Client, stdout, stderr io.Writer, filename, to string) error
- func SCPAndExec(stdout, stderr io.Writer, client *ssh.Client, filename, to string, ...) error
- func SafeClose[T any](c chan T)
- func SafeRead[T any](c chan T) (T, bool)
- func SafeWrite[T any](c chan<- T, value T)
- func Shell(_ context.Context, clientset *kubernetes.Clientset, config *rest.Config, ...) (string, error)
- func SshJump(ctx context.Context, conf *SshConfig, flags *pflag.FlagSet, print bool) (path string, err error)
- func SshJumpAndSetEnv(ctx context.Context, conf *SshConfig, flags *pflag.FlagSet, print bool) error
- func StartupPProf(port int)
- func TransferImage(ctx context.Context, conf *SshConfig, imageSource, imageTarget string, ...) error
- func UnzipKubeVPNIntoFile(zipFile, filename string) error
- func UpdateImage(ctx context.Context, factory util.Factory, ns string, deployName string, ...) error
- func WaitPod(ctx context.Context, podInterface v12.PodInterface, list v1.ListOptions, ...) error
- func WaitPodToBeReady(ctx context.Context, podInterface v12.PodInterface, selector v1.LabelSelector) error
- func WaitPortToBeFree(ctx context.Context, port int) error
- func WatchPodToAddRoute(ctx context.Context, watcher v12.PodInterface, ...) error
- func WatchServiceToAddRoute(ctx context.Context, watcher v12.ServiceInterface, ...) error
- type AssetsEntity
- type AuthorEntity
- type CCache
- func (c *CCache) AddCredential(cred *Credential)
- func (c *CCache) Contains(p types.PrincipalName) bool
- func (c *CCache) GetClientPrincipalName() types.PrincipalName
- func (c *CCache) GetClientRealm() string
- func (c *CCache) GetEntries() []*Credential
- func (c *CCache) GetEntry(p types.PrincipalName) (*Credential, bool)
- func (c *CCache) Marshal() ([]byte, error)
- func (c *CCache) SetDefaultPrincipal(d principal)
- func (c *CCache) Unmarshal(b []byte) error
- type Credential
- type ForwardedPort
- type Krb5ClientState
- type Krb5InitiatorClient
- func NewKrb5InitiatorClientWithCache(krb5Conf, cacheFile string) (kcl Krb5InitiatorClient, err error)
- func NewKrb5InitiatorClientWithKeytab(username string, krb5Conf, keytabConf string) (kcl Krb5InitiatorClient, err error)
- func NewKrb5InitiatorClientWithPassword(username, password, krb5Conf string) (kcl Krb5InitiatorClient, err error)
- type PodRouteConfig
- type PortForwarder
- type ReactionsEntity
- type RootEntity
- type SshConfig
- func (config SshConfig) AliasRecursion(ctx context.Context) (client *ssh.Client, err error)
- func (s SshConfig) Clone() SshConfig
- func (config SshConfig) Dial(ctx context.Context) (client *ssh.Client, err error)
- func (config SshConfig) GetAuth() ([]ssh.AuthMethod, error)
- func (config SshConfig) JumpRecursion(ctx context.Context) (client *ssh.Client, err error)
- func (config *SshConfig) ToRPC() *rpc.SshJump
- type UploaderEntity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddSshFlags ¶ added in v2.2.8
func AllContainerIsRunning ¶
func BytesToInt ¶
func CanI ¶
func CanI(clientset *kubernetes.Clientset, sa, ns string, resource *rbacv1.PolicyRule) (allowed bool, err error)
func CheckPodStatus ¶ added in v2.2.5
func CheckPodStatus(cCtx context.Context, cFunc context.CancelFunc, podName string, podInterface v12.PodInterface)
func CleanExtensionLib ¶
func CleanExtensionLib()
func ConvertK8sApiServerToDomain ¶ added in v2.2.5
func ConvertToKubeConfigBytes ¶ added in v2.2.5
func CopyVolumeIntoContainer ¶ added in v2.2.5
func CreateCIDRPod ¶ added in v2.2.5
func CreateFolder ¶ added in v2.2.5
func DeleteBlockFirewallRule ¶
func DialSshRemote ¶
DialSshRemote https://github.com/golang/go/issues/21478
func Download ¶
Download https://api.github.com/repos/kubenetworks/kubevpn/releases https://github.com/kubenetworks/kubevpn/releases/download/v1.1.13/kubevpn-windows-arm64.exe
func DownloadFile ¶ added in v2.2.7
func DownloadFileStream ¶ added in v2.2.7
func DownloadFileWithName ¶ added in v2.2.7
func FindContainerByName ¶ added in v2.2.2
func FindContainerEnv ¶ added in v2.2.2
func GetAnnotation ¶
func GetCIDRByDumpClusterInfo ¶ added in v2.2.5
func GetCIDRByDumpClusterInfo(ctx context.Context, clientset *kubernetes.Clientset) ([]*net.IPNet, error)
GetCIDRByDumpClusterInfo root 22008 21846 14 Jan18 ? 6-22:53:35 kube-apiserver --advertise-address=10.56.95.185 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=NodeRestriction --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-kube-control-1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-kube-control-1-key.pem --etcd-servers=https://10.56.95.185:2379,https://10.56.95.186:2379,https://10.56.95.187:2379 --etcd-servers-overrides=/events#https://10.56.95.185:2381;https://10.56.95.186:2381;https://10.56.95.187:2381 --event-ttl=1h0m0s --insecure-port=0 --kubelet-certificate-authority=/etc/kubernetes/ssl/kubelet/kubelet-ca.crt --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=1m0s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.pub --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --tls-private-key-file=/etc/kubernetes/ssl/apiserver.key ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/#configure-ipv4-ipv6-dual-stack get cidr by dump cluster info
func GetCIDRElegant ¶
func GetCIDRElegant(ctx context.Context, clientset *kubernetes.Clientset, restconfig *rest.Config, namespace string) ([]*net.IPNet, error)
GetCIDRElegant 1) dump cluster info 2) grep cmdline 3) create svc + cat *.conflist 4) create svc + get pod ip with svc mask
func GetCIDRFromCNI ¶ added in v2.2.5
func GetCIDRFromCNI(ctx context.Context, clientset *kubernetes.Clientset, restconfig *rest.Config, namespace string) ([]*net.IPNet, error)
GetCIDRFromCNI kube-controller-manager--allocate-node-cidrs=true--authentication-kubeconfig=/etc/kubernetes/controller-manager.conf--authorization-kubeconfig=/etc/kubernetes/controller-manager.conf--bind-address=0.0.0.0--client-ca-file=/etc/kubernetes/ssl/ca.crt--cluster-cidr=10.233.64.0/18--cluster-name=cluster.local--cluster-signing-cert-file=/etc/kubernetes/ssl/ca.crt--cluster-signing-key-file=/etc/kubernetes/ssl/ca.key--configure-cloud-routes=false--controllers=*,bootstrapsigner,tokencleaner--kubeconfig=/etc/kubernetes/controller-manager.conf--leader-elect=true--leader-elect-lease-duration=15s--leader-elect-renew-deadline=10s--node-cidr-mask-size=24--node-monitor-grace-period=40s--node-monitor-period=5s--port=0--profiling=False--requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt--root-ca-file=/etc/kubernetes/ssl/ca.crt--service-account-private-key-file=/etc/kubernetes/ssl/sa.key--service-cluster-ip-range=10.233.0.0/18--terminated-pod-gc-threshold=12500--use-service-account-credentials=true
func GetCIDRFromResourceUgly ¶
func GetCIDRFromResourceUgly(ctx context.Context, clientset *kubernetes.Clientset, namespace string) []*net.IPNet
GetCIDRFromResourceUgly use podIP/24 and serviceIP/24 as cidr
func GetClusterID ¶ added in v2.2.7
func GetDNS ¶ added in v2.2.5
func GetDNS(ctx context.Context, clientSet *kubernetes.Clientset, restConfig *rest.Config, ns, pod string) (*dns.ClientConfig, error)
func GetDNSIPFromDnsPod ¶
func GetDNSServiceIPFromPod ¶
func GetDNSServiceIPFromPod(ctx context.Context, clientset *kubernetes.Clientset, config *rest.Config, podName, namespace string) (*dns.ClientConfig, error)
func GetIPBaseNic ¶
func GetKrb5Path ¶
func GetKrb5Path() string
func GetKubeConfigPath ¶ added in v2.2.5
func GetKubeconfigCluster ¶ added in v2.2.5
func GetManifest ¶
func GetNsForListPodAndSvc ¶ added in v2.2.13
func GetPodCIDRFromCNI ¶ added in v2.2.5
func GetPodCIDRFromCNI(ctx context.Context, clientset *kubernetes.Clientset, restconfig *rest.Config, namespace string) ([]*net.IPNet, error)
GetPodCIDRFromCNI
*
{ "name": "cni0", "cniVersion":"0.3.1", "plugins":[ { "datastore_type": "kubernetes", "nodename": "10.56.95.185", "type": "calico", "log_level": "info", "log_file_path": "/var/log/calico/cni/cni.log", "ipam": { "type": "calico-ipam", "assign_ipv4": "true", "ipv4_pools": ["10.233.64.0/18"] }, "policy": { "type": "k8s" }, "kubernetes": { "kubeconfig": "/etc/cni/net.d/calico-kubeconfig" } }, { "type":"portmap", "capabilities": { "portMappings": true } } ] }
func GetPodCIDRFromPod ¶ added in v2.2.5
func GetPodTemplateSpecPath ¶
func GetPodTemplateSpecPath(u *unstructured.Unstructured) (*v1.PodTemplateSpec, []string, error)
func GetRunningPodList ¶ added in v2.2.5
func GetServiceCIDRByCreateService ¶ added in v2.2.5
func GetTlsDomain ¶
func GetTopOwnerReference ¶
func GetTopOwnerReferenceBySelector ¶
func GetTopOwnerReferenceBySelector(factory util.Factory, namespace, selector string) (sets.Set[string], error)
GetTopOwnerReferenceBySelector assume pods, controller has same labels
func GetUnstructuredObject ¶
func GetVolume ¶ added in v2.2.5
func GetVolume(ctx context.Context, f util.Factory, ns, podName string) (map[string][]mount.Mount, error)
GetVolume key format: [container name]-[volume mount name]
func InitFactory ¶ added in v2.2.5
func InitFactoryByPath ¶ added in v2.2.5
func InitLogger ¶
func InitLogger(debug bool)
func InitLoggerForServer ¶ added in v2.2.2
func InitLoggerForServer(debug bool)
func IsIPv6Enabled ¶ added in v2.2.9
func IsPortListening ¶
func IsSameCluster ¶
func IsSameCluster(client v12.ConfigMapInterface, namespace string, clientB v12.ConfigMapInterface, namespaceB string) (bool, error)
func ListService ¶ added in v2.2.13
func Merge ¶
func Merge[K comparable, V any](fromMap, ToMap map[K]V) map[K]V
func NewPrincipal ¶ added in v2.2.8
func NewPrincipal(name types.PrincipalName, realm string) principal
NewPrincipal returns a new principal
func ParseCIDRFromString ¶ added in v2.2.5
ParseCIDRFromString
* kube-apiserver: --service-cluster-ip-range=<IPv4 CIDR>,<IPv6 CIDR> kube-controller-manager: --cluster-cidr=<IPv4 CIDR>,<IPv6 CIDR> --service-cluster-ip-range=<IPv4 CIDR>,<IPv6 CIDR> --node-cidr-mask-size-ipv4|--node-cidr-mask-size-ipv6 defaults to /24 for IPv4 and /64 for IPv6 kube-proxy: --cluster-cidr=<IPv4 CIDR>,<IPv6 CIDR>
func ParseDirMapping ¶ added in v2.2.11
func ParsePort ¶ added in v2.2.3
func ParsePort(str string) v1.ContainerPort
ParsePort tcp/udp/remote:local
func PortForwardPod ¶
func PortMapUntil ¶ added in v2.2.2
func PrintStatusInline ¶
func PullImage ¶
func PullImage(ctx context.Context, platform *v1.Platform, cli *client.Client, dockerCli *command.DockerCli, img string, out io.Writer) error
PullImage image.RunPull(ctx, c, image.PullOptions{})
func RolloutStatus ¶
func RunCmdWithElevated ¶
func RunWithElevated ¶
func RunWithElevated()
func RunningInContainer ¶
func RunningInContainer() bool
RunningInContainer returns true if the current process runs from inside a docker container.
func SCPAndExec ¶ added in v2.2.2
func SCPAndExec(stdout, stderr io.Writer, client *ssh.Client, filename, to string, commands ...string) error
SCPAndExec copy file to remote and exec command
func SshJumpAndSetEnv ¶ added in v2.2.3
func StartupPProf ¶
func StartupPProf(port int)
func TransferImage ¶
func TransferImage(ctx context.Context, conf *SshConfig, imageSource, imageTarget string, out io.Writer) error
TransferImage 1) if not special ssh config, just pull image and tag and push 2) if special ssh config, pull image, tag image, save image and scp image to remote, load image and push
func UnzipKubeVPNIntoFile ¶
func UpdateImage ¶ added in v2.2.5
func UpdateImage(ctx context.Context, factory util.Factory, ns string, deployName string, image string) error
UpdateImage update to newer image
func WaitPod ¶
func WaitPod(ctx context.Context, podInterface v12.PodInterface, list v1.ListOptions, checker func(*corev1.Pod) bool) error
func WaitPodToBeReady ¶
func WaitPodToBeReady(ctx context.Context, podInterface v12.PodInterface, selector v1.LabelSelector) error
func WatchPodToAddRoute ¶ added in v2.2.13
func WatchServiceToAddRoute ¶ added in v2.2.13
Types ¶
type AssetsEntity ¶
type AssetsEntity struct { Url string `json:"url"` Id int64 `json:"id"` NodeId string `json:"node_id"` Name string `json:"name"` Label string `json:"label"` Uploader UploaderEntity `json:"uploader"` ContentType string `json:"content_type"` State string `json:"state"` Size int64 `json:"size"` DownloadCount int64 `json:"download_count"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` BrowserDownloadUrl string `json:"browser_download_url"` }
type AuthorEntity ¶
type AuthorEntity struct { Login string `json:"login"` Id int64 `json:"id"` NodeId string `json:"node_id"` AvatarUrl string `json:"avatar_url"` GravatarId string `json:"gravatar_id"` Url string `json:"url"` HtmlUrl string `json:"html_url"` FollowersUrl string `json:"followers_url"` FollowingUrl string `json:"following_url"` GistsUrl string `json:"gists_url"` StarredUrl string `json:"starred_url"` SubscriptionsUrl string `json:"subscriptions_url"` OrganizationsUrl string `json:"organizations_url"` ReposUrl string `json:"repos_url"` EventsUrl string `json:"events_url"` ReceivedEventsUrl string `json:"received_events_url"` Type string `json:"type"` SiteAdmin bool `json:"site_admin"` }
type CCache ¶ added in v2.2.8
type CCache struct { Version uint8 Header header DefaultPrincipal principal Credentials []*Credential Path string }
CCache is the file credentials cache as define here: https://web.mit.edu/kerberos/krb5-latest/doc/formats/ccache_file_format.html
func LoadCCache ¶ added in v2.2.8
LoadCCache loads a credential cache file into a CCache type.
func NewV4CCache ¶ added in v2.2.8
func NewV4CCache() *CCache
NewV4CCache creates a new Version 4 CCache with no credentials in it
func (*CCache) AddCredential ¶ added in v2.2.8
func (c *CCache) AddCredential(cred *Credential)
AddCredential adds a credential to a CCache
func (*CCache) Contains ¶ added in v2.2.8
func (c *CCache) Contains(p types.PrincipalName) bool
Contains tests if the cache contains a credential for the provided server PrincipalName
func (*CCache) GetClientPrincipalName ¶ added in v2.2.8
func (c *CCache) GetClientPrincipalName() types.PrincipalName
GetClientPrincipalName returns a PrincipalName type for the client the credentials cache is for.
func (*CCache) GetClientRealm ¶ added in v2.2.8
GetClientRealm returns the reals of the client the credentials cache is for.
func (*CCache) GetEntries ¶ added in v2.2.8
func (c *CCache) GetEntries() []*Credential
GetEntries filters out configuration entries an returns a slice of credentials.
func (*CCache) GetEntry ¶ added in v2.2.8
func (c *CCache) GetEntry(p types.PrincipalName) (*Credential, bool)
GetEntry returns a specific credential for the PrincipalName provided.
func (*CCache) SetDefaultPrincipal ¶ added in v2.2.8
func (c *CCache) SetDefaultPrincipal(d principal)
SetDefaultPrincipal sets the default principal for a CCache
type Credential ¶ added in v2.2.8
type Credential struct { Client principal Server principal Key types.EncryptionKey AuthTime time.Time StartTime time.Time EndTime time.Time RenewTill time.Time IsSKey bool TicketFlags asn1.BitString Addresses []types.HostAddress AuthData []types.AuthorizationDataEntry Ticket []byte SecondTicket []byte }
Credential holds a Kerberos client's ccache credential information.
type ForwardedPort ¶
ForwardedPort contains a Local:Remote port pairing.
type Krb5ClientState ¶
type Krb5ClientState int
const ( ContextFlagREADY = 128 /* initiator states */ InitiatorStart Krb5ClientState = iota InitiatorRestart InitiatorWaitForMutal InitiatorReady )
type Krb5InitiatorClient ¶
type Krb5InitiatorClient struct {
// contains filtered or unexported fields
}
func NewKrb5InitiatorClientWithCache ¶
func NewKrb5InitiatorClientWithCache(krb5Conf, cacheFile string) (kcl Krb5InitiatorClient, err error)
func NewKrb5InitiatorClientWithKeytab ¶
func NewKrb5InitiatorClientWithKeytab(username string, krb5Conf, keytabConf string) (kcl Krb5InitiatorClient, err error)
func NewKrb5InitiatorClientWithPassword ¶
func NewKrb5InitiatorClientWithPassword(username, password, krb5Conf string) (kcl Krb5InitiatorClient, err error)
func (*Krb5InitiatorClient) DeleteSecContext ¶
func (k *Krb5InitiatorClient) DeleteSecContext() error
func (*Krb5InitiatorClient) GetMIC ¶
func (k *Krb5InitiatorClient) GetMIC(micFiled []byte) ([]byte, error)
func (*Krb5InitiatorClient) InitSecContext ¶
type PodRouteConfig ¶
type PortForwarder ¶
type PortForwarder struct { Ready chan struct{} // contains filtered or unexported fields }
PortForwarder knows how to listen for local connections and forward them to a remote pod via an upgraded HTTP request.
func NewOnAddresses ¶
func NewOnAddresses(dialer httpstream.Dialer, addresses []string, ports []string, stopChan <-chan struct{}, readyChan chan struct{}, out, errOut io.Writer) (*PortForwarder, error)
NewOnAddresses creates a new PortForwarder with custom listen addresses.
func (*PortForwarder) Close ¶
func (pf *PortForwarder) Close()
Close stops all listeners of PortForwarder.
func (*PortForwarder) ForwardPorts ¶
func (pf *PortForwarder) ForwardPorts() error
ForwardPorts formats and executes a port forwarding request. The connection will remain open until stopChan is closed.
func (*PortForwarder) GetPorts ¶
func (pf *PortForwarder) GetPorts() ([]ForwardedPort, error)
GetPorts will return the ports that were forwarded; this can be used to retrieve the locally-bound port in cases where the input was port 0. This function will signal an error if the Ready channel is nil or if the listeners are not ready yet; this function will succeed after the Ready channel has been closed.
type ReactionsEntity ¶
type ReactionsEntity struct { Url string `json:"url"` TotalCount int64 `json:"total_count"` Normal1 int64 `json:"+1"` Normal11 int64 `json:"-1"` Laugh int64 `json:"laugh"` Hooray int64 `json:"hooray"` Confused int64 `json:"confused"` Heart int64 `json:"heart"` Rocket int64 `json:"rocket"` Eyes int64 `json:"eyes"` }
type RootEntity ¶
type RootEntity struct { Url string `json:"url"` AssetsUrl string `json:"assets_url"` UploadUrl string `json:"upload_url"` HtmlUrl string `json:"html_url"` Id int64 `json:"id"` NodeId string `json:"node_id"` TagName string `json:"tag_name"` TargetCommitish string `json:"target_commitish"` Name string `json:"name"` Draft bool `json:"draft"` Prerelease bool `json:"prerelease"` CreatedAt string `json:"created_at"` PublishedAt string `json:"published_at"` Assets []AssetsEntity `json:"assets"` TarballUrl string `json:"tarball_url"` ZipballUrl string `json:"zipball_url"` Body string `json:"body"` Reactions ReactionsEntity `json:"reactions"` }
type SshConfig ¶
type SshConfig struct { Addr string User string Password string Keyfile string Jump string ConfigAlias string RemoteKubeconfig string // GSSAPI GSSAPIKeytabConf string GSSAPIPassword string GSSAPICacheFile string }
func GetBastion ¶ added in v2.2.8
func ParseSshFromRPC ¶
func (SshConfig) AliasRecursion ¶ added in v2.2.8
func (SshConfig) GetAuth ¶ added in v2.2.8
func (config SshConfig) GetAuth() ([]ssh.AuthMethod, error)
func (SshConfig) JumpRecursion ¶ added in v2.2.8
type UploaderEntity ¶
type UploaderEntity struct { Login string `json:"login"` Id int64 `json:"id"` NodeId string `json:"node_id"` AvatarUrl string `json:"avatar_url"` GravatarId string `json:"gravatar_id"` Url string `json:"url"` HtmlUrl string `json:"html_url"` FollowersUrl string `json:"followers_url"` FollowingUrl string `json:"following_url"` GistsUrl string `json:"gists_url"` StarredUrl string `json:"starred_url"` SubscriptionsUrl string `json:"subscriptions_url"` OrganizationsUrl string `json:"organizations_url"` ReposUrl string `json:"repos_url"` EventsUrl string `json:"events_url"` ReceivedEventsUrl string `json:"received_events_url"` Type string `json:"type"` SiteAdmin bool `json:"site_admin"` }
Source Files
¶
- chan.go
- cidr.go
- container.go
- dns.go
- elevate_others.go
- elevatecheck_others.go
- file.go
- getcidr.go
- gssapi.go
- gssapi_ccache.go
- gssapi_other.go
- image.go
- kube.go
- log.go
- name.go
- net.go
- net_others.go
- networkpolicy_other.go
- ns.go
- pod.go
- port.go
- portforward.go
- route.go
- scp.go
- ssh.go
- unstructure.go
- upgarde.go
- util.go
- volume.go