Documentation ¶
Index ¶
- Constants
- Variables
- func FilterKeysWithoutPrefix(object map[string]string, prefix string) map[string]string
- func FilterMap(originalMap map[string]string, substring string) map[string]string
- func GenerateRecordName(hostname, suffix string) string
- func GenerateResourceName(hostname, suffix string) string
- func GenerateSecretName(resourceName string) string
- func GetCappConfig(k8sClient client.Client) (*cappv1alpha1.CappConfig, error)
- func GetDNSConfig(ctx context.Context, k8sClient client.Client) (cappv1alpha1.DNSConfig, error)
- func GetDNSRecordFromConfig(dnsConfig cappv1alpha1.DNSConfig) (string, error)
- func GetIssuerNameFromConfig(dnsConfig cappv1alpha1.DNSConfig) (string, error)
- func GetListOptions(set labels.Set) client.ListOptions
- func GetResource(k8sClient client.Client, obj client.Object, name, namespace string) error
- func GetXPProviderFromConfig(dnsConfig cappv1alpha1.DNSConfig) (string, error)
- func GetZoneFromConfig(dnsConfig cappv1alpha1.DNSConfig) (string, error)
- func IsCustomHostnameSet(hostname string) bool
- func IsDNSRecordAvailable(ctx context.Context, k8sClient client.Client, name, namespace string) (bool, error)
- func IsOnOpenshift(config *rest.Config) (bool, error)
- func MergeMaps(m1 map[string]string, m2 map[string]string) map[string]string
- func TruncateCommonName(s string) string
Constants ¶
const ( CappConfigName = "capp-config" CappNS = "capp-operator-system" CappKey = "capp" )
Variables ¶
var ( CappAPIGroup = cappv1alpha1.GroupVersion.Group CappNamespaceKey = CappAPIGroup + "/parent-capp-ns" CappResourceKey = CappAPIGroup + "/parent-capp" ManagedByLabelKey = CappAPIGroup + "/managed-by" )
Functions ¶
func FilterKeysWithoutPrefix ¶
FilterKeysWithoutPrefix removes keys from a map if they don't start with a given prefix
func FilterMap ¶
FilterMap returns a new map containing only the key-value pairs where the key contains the specified substring.
func GenerateRecordName ¶ added in v0.3.0
GenerateRecordName generates the hostname based on the provided suffix and a dot(".") trailing character. It returns the original hostname with the suffix removed if it was present, otherwise the original hostname.
func GenerateResourceName ¶ added in v0.3.0
GenerateResourceName generates the hostname based on the provided suffix and a dot(".") trailing character. If the hostname does not already end with the suffix (minus the trailing dot), it appends the suffix to the hostname.
func GenerateSecretName ¶ added in v0.3.0
GenerateSecretName generates TLS secret name for certificate and domain mapping.
func GetCappConfig ¶ added in v0.3.6
func GetCappConfig(k8sClient client.Client) (*cappv1alpha1.CappConfig, error)
GetCappConfig fetches and returns an existing instance of an existing cappConfig
func GetDNSConfig ¶ added in v0.3.0
GetDNSConfig returns the data of the DNS for the CappConfig CRD.
func GetDNSRecordFromConfig ¶ added in v0.3.0
func GetDNSRecordFromConfig(dnsConfig cappv1alpha1.DNSConfig) (string, error)
GetDNSRecordFromConfig returns the DNSRecord to be used for the record from a CappConfig CRD.
func GetIssuerNameFromConfig ¶ added in v0.3.3
func GetIssuerNameFromConfig(dnsConfig cappv1alpha1.DNSConfig) (string, error)
GetIssuerNameFromConfig returns the name of the Certificate Issuer to be used for the Certificate from a CappConfig CRD.
func GetListOptions ¶ added in v0.3.0
func GetListOptions(set labels.Set) client.ListOptions
GetListOptions returns a list option object from a given Set.
func GetResource ¶ added in v0.3.6
GetResource fetches an existing resource and returns an instance of it.
func GetXPProviderFromConfig ¶ added in v0.3.3
func GetXPProviderFromConfig(dnsConfig cappv1alpha1.DNSConfig) (string, error)
GetXPProviderFromConfig returns the Crossplane provider to be used for the record from the CappConfig CRD.
func GetZoneFromConfig ¶ added in v0.3.0
func GetZoneFromConfig(dnsConfig cappv1alpha1.DNSConfig) (string, error)
GetZoneFromConfig returns the zone to be used for the record from the CappConfig CRD.
func IsCustomHostnameSet ¶ added in v0.3.2
IsCustomHostnameSet returns a boolean indicating whether a custom hostname is set.
func IsDNSRecordAvailable ¶ added in v0.3.0
func IsDNSRecordAvailable(ctx context.Context, k8sClient client.Client, name, namespace string) (bool, error)
IsDNSRecordAvailable returns a boolean indicating whether a CNAMERecord is currently available.
func IsOnOpenshift ¶
IsOnOpenshift returns true if the cluster has the openshift config group
func MergeMaps ¶
MergeMaps merges two string-string maps by combining their key-value pairs into a new map.
func TruncateCommonName ¶ added in v0.3.3
TruncateCommonName truncates the CommonName string to be no longer than 64 characters.
Types ¶
This section is empty.