Documentation
¶
Index ¶
- Constants
- func DecryptResponse(privateKey *ecdh.PrivateKey, encryptedJSON []byte) ([]byte, error)
- func GenerateKubecontextFunction(fArgs handler.FunctionImplementationArguments) (gaby.Container, any, error)
- func GetGenerateKubecontextSignature() api.FunctionSignature
- func InitAccess() error
- func InitSchemaFinder() error
- func RegisterFunctions(rp *k8skit.K8sResourceProviderType, fh handler.FunctionRegistry)
- type EncryptedResponse
- type ResourceQuantityComparison
- type SchemaFinder
- type SchemaInfo
Constants ¶
const ( // AnnotationGenerateKubecontext must be set to "allow" on the ServiceAccount // for the function to issue a token. AnnotationGenerateKubecontext = "confighub.com/generate-kubecontext" // AnnotationAccessTTL controls the token lifetime. AnnotationAccessTTL = "confighub.com/access-ttl" // AnnotationAccessMaxTTL caps user-requested TTL overrides. AnnotationAccessMaxTTL = "confighub.com/access-max-ttl" // AnnotationKubernetesAPIEndpoint is the external API server endpoint to use in the // generated kubeconfig. Required, since the function will not be able to determine it // itself from inside the cluster. AnnotationKubernetesAPIEndpoint = "confighub.com/kubernetes-api-endpoint" )
const AttributeNameAnnotationValue = api.AttributeName("annotation-value")
const AttributeNameLabelValue = api.AttributeName("label-value")
const AttributeNameMetadataName = api.AttributeName("metadata-name")
const AttributeNameNamespaceNameReference = api.AttributeName("namespace-name-reference")
const AttributeNameWorkloadLabels = api.AttributeName("workload-labels")
Variables ¶
This section is empty.
Functions ¶
func DecryptResponse ¶ added in v0.1.26
func DecryptResponse(privateKey *ecdh.PrivateKey, encryptedJSON []byte) ([]byte, error)
DecryptResponse decrypts an EncryptedResponse using the caller's private key. This is used by the CLI plugin.
func GenerateKubecontextFunction ¶ added in v0.1.26
func GenerateKubecontextFunction(fArgs handler.FunctionImplementationArguments) (gaby.Container, any, error)
GenerateKubecontextFunction is the function implementation.
func GetGenerateKubecontextSignature ¶ added in v0.1.26
func GetGenerateKubecontextSignature() api.FunctionSignature
GetGenerateKubecontextSignature returns the function signature.
func InitAccess ¶ added in v0.1.26
func InitAccess() error
InitAccess initializes the Kubernetes client for token requests. It tries in-cluster config first, then falls back to kubeconfig.
func InitSchemaFinder ¶
func InitSchemaFinder() error
func RegisterFunctions ¶
func RegisterFunctions(rp *k8skit.K8sResourceProviderType, fh handler.FunctionRegistry)
RegisterFunctions registers all Kubernetes functions onto the provided FunctionHandler using the given registrar's resource provider.
Types ¶
type EncryptedResponse ¶ added in v0.1.26
type EncryptedResponse struct {
PublicKey string `json:"publicKey"` // Worker's ephemeral public key (base64)
Nonce string `json:"nonce"` // AES-GCM nonce (base64)
Ciphertext string `json:"ciphertext"` // Encrypted kubeconfig (base64)
}
EncryptedResponse is the JSON structure returned in function output.
type ResourceQuantityComparison ¶
type ResourceQuantityComparison struct {
// contains filtered or unexported fields
}
ResourceQuantityComparison implements CustomStringComparator for Kubernetes resource quantities
func NewResourceQuantityComparison ¶
func NewResourceQuantityComparison() *ResourceQuantityComparison
NewResourceQuantityComparison creates a new ResourceQuantityComparison instance
func (*ResourceQuantityComparison) Evaluate ¶
func (r *ResourceQuantityComparison) Evaluate(expr *api.RelationalExpression, value string) (bool, error)
Evaluate implements CustomStringComparator.Evaluate
func (*ResourceQuantityComparison) MatchesPath ¶
func (r *ResourceQuantityComparison) MatchesPath(path string) bool
MatchesPath implements CustomStringComparator.MatchesPath
type SchemaFinder ¶
type SchemaFinder struct {
// contains filtered or unexported fields
}
func NewSchemaFinder ¶
func NewSchemaFinder() (*SchemaFinder, error)
func (*SchemaFinder) LookupPath ¶
func (e *SchemaFinder) LookupPath(gvkString, fieldPath string) (*SchemaInfo, error)
type SchemaInfo ¶
type SchemaInfo struct {
Description string
}
func LookupPath ¶
func LookupPath(gvkString, fieldPath string) (*SchemaInfo, error)