Class CustomResourceHandler

    • Constructor Detail

      • CustomResourceHandler

        public CustomResourceHandler​(Resources resources)
    • Method Detail

      • getPrinterColumnDecorator

        protected Decorator getPrinterColumnDecorator​(String name,
                                                      String version,
                                                      String path,
                                                      String type,
                                                      String column,
                                                      String description,
                                                      String format)
        Description copied from class: AbstractCustomResourceHandler
        Provides the decorator implementation associated with the CRD generation version.
        Specified by:
        getPrinterColumnDecorator in class AbstractCustomResourceHandler
        Parameters:
        name - the resource name
        version - the associated version
        path - the path from which the printer column is extracted
        type - the data type of the printer column
        column - the name of the column
        description - the description of the column
        format - the format of the printer column
        Returns:
        the concrete decorator implementing the addition of a printer column to the currently built CRD
      • addDecorators

        protected void addDecorators​(CustomResourceInfo config,
                                     io.sundr.codegen.model.TypeDef def,
                                     Optional<String> specReplicasPath,
                                     Optional<String> statusReplicasPath,
                                     Optional<String> labelSelectorPath,
                                     boolean statusExists)
        Description copied from class: AbstractCustomResourceHandler
        Adds all the necessary decorators to build the specific CRD version. For optional paths, see https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#customresourcesubresourcescale-v1-apiextensions-k8s-io These paths
        Specified by:
        addDecorators in class AbstractCustomResourceHandler
        Parameters:
        config - the gathered CustomResourceInfo used as basis for the CRD generation
        def - the TypeDef associated with the CustomResource from which the CRD is generated
        specReplicasPath - an optionally detected path of field defining spec replicas
        statusReplicasPath - an optionally detected path of field defining status replicas
        labelSelectorPath - an optionally detected path of field defining `status.selector`
        statusExists - true if the CustomResource from which the CRD is generated defines a status field, false otherwise