Documentation ¶
Index ¶
- func AnnotationsForCluster(cr *argoproj.ArgoCD) map[string]string
- func AppendStringMap(src map[string]string, add map[string]string) map[string]string
- func CombineImageTag(img string, tag string) string
- func CreateEvent(client client.Client, eventType, action, message, reason string, ...) error
- func CreateSecret(client client.Client, name string, namespace string, data map[string][]byte) error
- func CreateTLSSecret(client client.Client, name string, namespace string, data map[string][]byte) error
- func DefaultPVCResources() corev1.ResourceRequirements
- func EncodeCertificatePEM(cert *x509.Certificate) []byte
- func EncodePrivateKeyPEM(key *rsa.PrivateKey) []byte
- func EnvMerge(existing []corev1.EnvVar, merge []corev1.EnvVar, override bool) []corev1.EnvVar
- func FetchObject(client client.Client, namespace string, name string, obj client.Object) error
- func FetchSecret(client client.Client, meta metav1.ObjectMeta, name string) (*corev1.Secret, error)
- func FetchStorageSecretName(export *argoprojv1alpha1.ArgoCDExport) string
- func IsAPIRegistered(group string, version string) (bool, error)
- func IsObjectFound(client client.Client, namespace string, name string, obj client.Object) bool
- func LabelsForCluster(cr *argoproj.ArgoCD) map[string]string
- func NameWithSuffix(meta metav1.ObjectMeta, suffix string) string
- func NewPersistentVolumeClaim(meta metav1.ObjectMeta) *corev1.PersistentVolumeClaim
- func NewPersistentVolumeClaimWithName(name string, meta metav1.ObjectMeta) *corev1.PersistentVolumeClaim
- func NewPrivateKey() (*rsa.PrivateKey, error)
- func NewSecret(cr *argoproj.ArgoCD) *corev1.Secret
- func NewSecretWithName(cr *argoproj.ArgoCD, name string) *corev1.Secret
- func NewSecretWithSuffix(cr *argoproj.ArgoCD, suffix string) *corev1.Secret
- func NewSelfSignedCACertificate(name string, key *rsa.PrivateKey) (*x509.Certificate, error)
- func NewSignedCertificate(cfg *certmanagerv1.CertificateSpec, dnsNames []string, key *rsa.PrivateKey, ...) (*x509.Certificate, error)
- func NewTLSSecret(cr *argoproj.ArgoCD, suffix string) *corev1.Secret
- func ParsePEMEncodedCert(pemdata []byte) (*x509.Certificate, error)
- func ParsePEMEncodedPrivateKey(pemdata []byte) (*rsa.PrivateKey, error)
- func VerifyAPI(group string, version string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnnotationsForCluster ¶
annotationsForCluster returns the annotations for all cluster resources.
func AppendStringMap ¶
AppendStringMap will append the map `add` to the given map `src` and return the result.
func CombineImageTag ¶
CombineImageTag will return the combined image and tag in the proper format for tags and digests.
func CreateEvent ¶
func CreateEvent(client client.Client, eventType, action, message, reason string, objectMeta metav1.ObjectMeta, typeMeta metav1.TypeMeta) error
CreateEvent will create a new Kubernetes Event with the given action, message, reason and involved uid.
func CreateSecret ¶ added in v0.13.0
func CreateTLSSecret ¶ added in v0.13.0
func DefaultPVCResources ¶
func DefaultPVCResources() corev1.ResourceRequirements
DefaultPVCResources will return the default PVC resources.
func EncodeCertificatePEM ¶
func EncodeCertificatePEM(cert *x509.Certificate) []byte
EncodeCertificatePEM encodes the given certificate pem and returns bytes (base64).
func EncodePrivateKeyPEM ¶
func EncodePrivateKeyPEM(key *rsa.PrivateKey) []byte
EncodePrivateKeyPEM encodes the given private key pem and returns bytes (base64).
func EnvMerge ¶
EnvMerge merges two slices of EnvVar entries into a single one. If existing has an EnvVar with same Name attribute as one in merge, the EnvVar is not merged unless override is set to true.
func FetchObject ¶
FetchObject will retrieve the object with the given namespace and name using the Kubernetes API. The result will be stored in the given object.
func FetchSecret ¶
FetchSecret will retrieve the object with the given Name using the provided client. The result will be returned.
func FetchStorageSecretName ¶
func FetchStorageSecretName(export *argoprojv1alpha1.ArgoCDExport) string
FetchStorageSecretName will return the name of the Secret to use for the export process.
func IsAPIRegistered ¶ added in v0.10.2
IsAPIRegistered returns true if the API is registered irrespective of whether the API status is available or not.
func IsObjectFound ¶
IsObjectFound will perform a basic check that the given object exists via the Kubernetes API. If an error occurs as part of the check, the function will return false.
func LabelsForCluster ¶
LabelsForCluster returns the labels for all cluster resources.
func NameWithSuffix ¶
func NameWithSuffix(meta metav1.ObjectMeta, suffix string) string
NameWithSuffix will return a string using the Name from the given ObjectMeta with the provded suffix appended. Example: If ObjectMeta.Name is "test" and suffix is "object", the value of "test-object" will be returned.
func NewPersistentVolumeClaim ¶
func NewPersistentVolumeClaim(meta metav1.ObjectMeta) *corev1.PersistentVolumeClaim
NewPersistentVolumeClaim returns a new PersistentVolumeClaim instance for the ObjectMeta resource.
func NewPersistentVolumeClaimWithName ¶
func NewPersistentVolumeClaimWithName(name string, meta metav1.ObjectMeta) *corev1.PersistentVolumeClaim
NewPersistentVolumeClaimWithName returns a new PersistentVolumeClaim instance with the given name.
func NewPrivateKey ¶
func NewPrivateKey() (*rsa.PrivateKey, error)
NewPrivateKey returns randomly generated RSA private key.
func NewSecretWithName ¶
NewSecretWithName returns a new Secret based on the given metadata with the provided Name.
func NewSecretWithSuffix ¶
NewSecretWithSuffix returns a new Secret based on the given metadata with the provided suffix on the Name.
func NewSelfSignedCACertificate ¶
func NewSelfSignedCACertificate(name string, key *rsa.PrivateKey) (*x509.Certificate, error)
NewSelfSignedCACertificate returns a self-signed CA certificate based on given configuration and private key. The certificate has one-year lease.
func NewSignedCertificate ¶
func NewSignedCertificate(cfg *certmanagerv1.CertificateSpec, dnsNames []string, key *rsa.PrivateKey, caCert *x509.Certificate, caKey *rsa.PrivateKey) (*x509.Certificate, error)
NewSignedCertificate signs a certificate using the given private key, CA and returns a signed certificate. The certificate could be used for both client and server auth. The certificate has one-year lease.
func NewTLSSecret ¶
NewTLSSecret returns a new TLS Secret based on the given metadata with the provided suffix on the Name.
func ParsePEMEncodedCert ¶
func ParsePEMEncodedCert(pemdata []byte) (*x509.Certificate, error)
ParsePEMEncodedCert parses a certificate from the given pemdata
func ParsePEMEncodedPrivateKey ¶
func ParsePEMEncodedPrivateKey(pemdata []byte) (*rsa.PrivateKey, error)
ParsePEMEncodedPrivateKey parses a private key from given pemdata
Types ¶
This section is empty.