Versions in this module Expand all Collapse all v0 v0.1.0 Dec 6, 2022 Changes in this version + const AnnotationTenantKubeConfigBase64 + const CertificateValidity + const KubeZooClusterName + const RsaKeySize + const TenantIDKey + const TenantIDLength + const TenantIDSeparator + func AddTenantIDPrefix(tenantID, input string) string + func AddTenantIDToUserInfo(tenantID string, info user.Info) user.Info + func ContainString(sli []string, s string) bool + func ConvertCRDNameToUpstream(name, tenantID string) string + func ConvertInternalListOptions(ctx context.Context, options *metainternalversion.ListOptions, tenantID string) (*metav1.ListOptions, error) + func ConvertTenantObjectNameToUpstream(name, tenantID string, gvk schema.GroupVersionKind) string + func ConvertUpstreamApiGroupToTenant(tenantID string, apiGroup *metav1.APIGroup) + func ConvertUpstreamResourceListToTenant(tenantID string, resourceList *metav1.APIResourceList) + func EncodeCertPEM(cert *x509.Certificate) []byte + func EncodePrivateKeyPEM(key *rsa.PrivateKey) []byte + func FilterUnstructuredList(utdList *unstructured.UnstructuredList, tenantID string, ...) *unstructured.UnstructuredList + func FlattenResourceLists(resourceLists []*metav1.APIResourceList) (ret []metav1.APIResource) + func GenKubeconfig(kubeZooServerAddress, tenantId string, caCert, clientKey, clientCert []byte) ([]byte, error) + func GetGVR(rsrc metav1.APIResource) schema.GroupVersionResource + func GetTenantIDFromNamespace(namespace string) (string, error) + func GetUnstructured(resource interface{}) (*unstructured.Unstructured, error) + func IsCRD(r metav1.APIResource) bool + func IsCRDObject(obj runtime.Object) bool + func IsGroupKindNamespaced(kind metav1.GroupKind) (bool, error) + func ListCRDsForTenant(tenantID string, crdLister v1.CustomResourceDefinitionLister) ([]*extensionsv1.CustomResourceDefinition, error) + func NewCertAndKey(caCert *x509.Certificate, caKey crypto.Signer, config *Config) (*x509.Certificate, *rsa.PrivateKey, error) + func NewPrivateKey() (*rsa.PrivateKey, error) + func NewSignedCert(cfg *Config, key crypto.Signer, caCert *x509.Certificate, caKey crypto.Signer) (*x509.Certificate, error) + func NewTenantCertAndKey(caFile, caKeyFile, tenantID string) (*x509.Certificate, *rsa.PrivateKey, error) + func RemoveString(sli []string, s string) (ret []string) + func TenantFrom(ctx context.Context) (string, bool) + func TenantIDFrom(ctx context.Context) string + func TrimTenantIDFromError(err error, tenantID string) error + func TrimTenantIDFromStatus(status metav1.Status, tenantID string) metav1.Status + func TrimTenantIDPrefix(tenantID, input string) string + func UpstreamObjectBelongsToTenant(obj runtime.Object, tenantID string, isNamespaceScoped bool) bool + func ValidateTenantName(tenantId string) *string + type AltNames struct + DNSNames []string + IPs []net.IP + type CheckGroupKindFunc func(group, kind, tenantID string, isTenantObject bool) (namespaced, customResourceGroup bool, err error) + func NewCheckGroupKindFunc(crdLister v1.CustomResourceDefinitionLister) CheckGroupKindFunc + type Config struct + AltNames AltNames + CommonName string + Organization []string + OrganizationalUnit []string + Usages []x509.ExtKeyUsage + type CustomGroupResourcesMap map[string]map[string]*v1.CustomResourceDefinition + func NewCustomGroupResourcesMap(crdList []*v1.CustomResourceDefinition) CustomGroupResourcesMap + func (grm CustomGroupResourcesMap) GetCRD(apiGroup, resourceName string) *v1.CustomResourceDefinition + func (grm CustomGroupResourcesMap) HasGroup(apiGroup string) bool + func (grm CustomGroupResourcesMap) HasGroupResource(apiGroup, resourceName string) bool + func (grm CustomGroupResourcesMap) HasGroupVersion(apiGroup, version string) bool + func (grm CustomGroupResourcesMap) HasGroupVersionResource(apiGroup, version, resourceName string) bool + func (grm CustomGroupResourcesMap) HasResource(resourceName string) bool + type FakeCRDLister struct + Crds []*apiextensionsv1.CustomResourceDefinition + func (l *FakeCRDLister) Get(name string) (*apiextensionsv1.CustomResourceDefinition, error) + func (l *FakeCRDLister) List(selector labels.Selector) (ret []*apiextensionsv1.CustomResourceDefinition, err error)