Documentation ¶
Index ¶
- Constants
- func AddQueryParams(url string, params map[string][]string) string
- func AuthClient() (*authorization.AuthorizationV1Client, error)
- func BuildServiceHostname(name, namespace string) string
- func CheckAndCreateObject(client client.Client, namespacedName types.NamespacedName, obj runtime.Object) error
- func Client(options client.Options) (client.Client, error)
- func Contains(arr []string, str string) bool
- func DecodeBasicAuth(basic string) (username, password string)
- func DiffKeyList(diffList []Diff) []string
- func EncryptBasicAuth(username, password string) string
- func FileExists(path string) bool
- func GetBasicAuth(imagePullSecret, namespace, registryURL string) (string, error)
- func GetCAData(secretName, namespace string) ([]byte, error)
- func GetCondition(obj interface{}, conditionType status.ConditionType) *status.Condition
- func GetRegistryLogger(subresource interface{}, resNamespace, resName string) logr.Logger
- func GetSecret(name, namespace string) (*corev1.Secret, error)
- func HTTPEncodeBasicAuth(username, password string) string
- func Matched(pattern string, image string) bool
- func Namespace() (string, error)
- func OperatorServiceName() string
- func ParseBasicAuth(sec *corev1.Secret, host string) (string, error)
- func ParseImageName(imageName string) string
- func RandomString(length int) string
- func RemovePemBlock(data []byte, blockType string) []byte
- func RespondError(w http.ResponseWriter, code int, msg string) error
- func RespondJSON(w http.ResponseWriter, data interface{}) error
- func SetCondition(error error, patch interface{}, condition *status.Condition)
- func SetErrorConditionIfChanged(target, origin interface{}, condition *status.Condition, err error)
- func TrimHTTPScheme(url string) string
- type CertPair
- func (c *CertPair) CertDataToPem() ([]byte, error)
- func (c *CertPair) CreateCertificateData() error
- func (c *CertPair) KeyToPem() ([]byte, error)
- func (c *CertPair) SetParent(cert *x509.Certificate, key *rsa.PrivateKey)
- func (c *CertPair) SetSubject(subject *pkix.Name)
- func (c *CertPair) SetSubjectAltName(ips []net.IP, domains []string)
- type Diff
- type DiffType
- type ErrorResponse
- type Patcher
- type RegistryLogger
Constants ¶
const ( SCHEME_HTTP_PREFIX = "http://" SCHEME_HTTPS_PREFIX = "https://" )
const ( ContentTypeBinary = "application/octet-stream" ContentTypeForm = "application/x-www-form-urlencoded" ContentTypeJSON = "application/json" ContentTypeHTML = "text/html; charset=utf-8" ContentTypeText = "text/plain; charset=utf-8" )
Variables ¶
This section is empty.
Functions ¶
func AuthClient ¶
func AuthClient() (*authorization.AuthorizationV1Client, error)
func BuildServiceHostname ¶
func CheckAndCreateObject ¶
func DecodeBasicAuth ¶
DecodeBasicAuth decode and splits username and password from basic auth string
func DiffKeyList ¶
func EncryptBasicAuth ¶
EncryptBasicAuth encrypt username and password by base64
func FileExists ¶
func GetBasicAuth ¶
GetBasicAuth returns `username:password` as string encrypted by base64 from imagePullSecghret
func GetCondition ¶ added in v0.3.2
func GetCondition(obj interface{}, conditionType status.ConditionType) *status.Condition
func GetRegistryLogger ¶
[TODO] API is not worked well
func HTTPEncodeBasicAuth ¶
HTTPEncodeBasicAuth encodes basic auth string by base64
func OperatorServiceName ¶
func OperatorServiceName() string
func ParseBasicAuth ¶
ParseBasicAuth returns `username:password` as string encrypted by base64
func ParseImageName ¶
func RandomString ¶
RandomString generate random string with lower case alphabets and digits
func RemovePemBlock ¶
func RespondError ¶
func RespondError(w http.ResponseWriter, code int, msg string) error
func RespondJSON ¶
func RespondJSON(w http.ResponseWriter, data interface{}) error
func SetCondition ¶
SetCondition sets a condition of patch status
func SetErrorConditionIfChanged ¶ added in v0.3.2
SetErrorConditionIfChanged sets target's condition If target's condition, origin's condition and condtion is same, don't set target's condition If not, set target's condition
func TrimHTTPScheme ¶ added in v0.3.0
TrimHTTPScheme trims 'http://' or 'https://' prefix in the url
Types ¶
type CertPair ¶
type CertPair struct { ParentCert *x509.Certificate ParentKey *rsa.PrivateKey Template *x509.Certificate Key *rsa.PrivateKey X509CertData []byte }
func NewCertPair ¶
func NewCertPair(key *rsa.PrivateKey, isCA bool) (*CertPair, error)
func (*CertPair) CertDataToPem ¶
func (*CertPair) CreateCertificateData ¶
func (*CertPair) SetParent ¶
func (c *CertPair) SetParent(cert *x509.Certificate, key *rsa.PrivateKey)
func (*CertPair) SetSubject ¶
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
}
type RegistryLogger ¶
type RegistryLogger struct {
// contains filtered or unexported fields
}
func NewRegistryLogger ¶
func NewRegistryLogger(subresource interface{}, resNamespace, resName string) *RegistryLogger
func (*RegistryLogger) Error ¶
func (r *RegistryLogger) Error(err error, msg string, keysAndValues ...interface{})
func (*RegistryLogger) Info ¶
func (r *RegistryLogger) Info(msg string, keysAndValues ...interface{})