• Geoff Simmons's avatar
    Add the controller devmode flag and TemplateConfig CRD, first iteration. · 6d7ab230
    Geoff Simmons authored
    The TemplateConfig resource is only read by the controller's k8s client
    when the devmode CLI flag is set.
    
    The TemplateConfig spec has fields for the various templates for VCL
    generation: ingress, self-sharding, ACL etc. The value type for all
    of those fields is string, and each field is optional.
    
    When a TemplateConfig specifies a value for a template type, the
    controller attempts to parse it as a text/template.Template, using
    the same function map defined for the template type. If the parse
    fails, then the error is logged and an Event type Warning with the
    error message is generated, and the field is ignored.
    
    If the parse succeeds, then the template is replaced for all further
    VCL generation by the controller.
    
    When a TemplateConfig is deleted, then for each template type that it
    specifies, the template is reverted to the controller's standard value.
    
    In this first iteration:
    
    - only the ACL template is updated, will add the other types.
    
    - only kubectl deployments are supported, will add support in the
    helm chart for the viking controller.
    
    - we have an e2e test, but it is not yet added to the e2e script that
    runs all of them, or to the gitlab CI script, since these have to
    support helm deployments.
    6d7ab230
factory.go 7.11 KB