Documentation ¶
Index ¶
- Constants
- func CreateKustomizationMaps() map[MapType]map[string]bool
- func EvaluateKustomizeManifest(compDir string) (resmap.ResMap, error)
- func GenerateKustomizationFile(kfDef *kfconfig.KfConfig, root string, compPath string, overlays []string, ...) error
- func GenerateYamlWithOperatorAnnotation(resMap resmap.ResMap, instance *unstructured.Unstructured) ([]byte, error)
- func GetKfApp(kfdef *kfconfig.KfConfig) kftypesv3.KfApp
- func GetKustomization(kustomizationPath string) *types.Kustomization
- func MergeKustomization(compDir string, targetDir string, kfDef *kfconfig.KfConfig, ...) error
- func MergeKustomizations(kfDef *kfconfig.KfConfig, compDir string, overlayParams []string, ...) (*types.Kustomization, error)
- func ReadKfDef(kfDefFile string) *kfdefsv3.KfDef
- func ReadUnstructured(kfDefFile string) (*unstructured.Unstructured, error)
- func WriteKfDef(kfdef *kfdefsv3.KfDef, kfdefpath string) error
- func WriteKustomizationFile(name string, kustomizeDir string, resMap resmap.ResMap) error
- type MapType
- type Setter
Constants ¶
const (
OverlayParamName = "overlay"
)
Variables ¶
This section is empty.
Functions ¶
func CreateKustomizationMaps ¶
func EvaluateKustomizeManifest ¶
EvaluateKustomizeManifest evaluates the kustomize dir compDir, and returns the resources.
func GenerateKustomizationFile ¶
func GenerateKustomizationFile(kfDef *kfconfig.KfConfig, root string, compPath string, overlays []string, params []kfconfig.NameValue) error
GenerateKustomizationFile will create a kustomization.yaml It will parse a args structure that provides mixin or multiple overlays to be merged with the base kustomization file for example
componentParams: tf-job-operator: - name: overlay value: namespaced-gangscheduled
TODO(https://github.com/kubeflow/kubeflow/issues/3491): As part of fixing the discovery logic we should change the KfDef spec to provide a list of applications (not a map). and preserve order when applying them so we can get rid of the logic hard-coding moving some applications to the front.
TODO(jlewi): Why is the path split between root and compPath? TODO(jlewi): Why is this taking kfDef and writing kfDef? Is this because it is reordering components? TODO(jlewi): This function appears to special case handling of using kustomize for KfDef. Presumably this is because of the code in coordinator which is using it to generate KfDef from overlays. But this function is also used to generate the manifests for the individual kustomize packages.
func GenerateYamlWithOperatorAnnotation ¶
func GenerateYamlWithOperatorAnnotation(resMap resmap.ResMap, instance *unstructured.Unstructured) ([]byte, error)
GenerateYamlWithOperatorAnnotation adds operator info to the annotation to every resource some code copied from ResMap.AsYaml() func
func GetKustomization ¶
func GetKustomization(kustomizationPath string) *types.Kustomization
GetKustomization will read a kustomization.yaml and return Kustomization type
func MergeKustomization ¶
func MergeKustomization(compDir string, targetDir string, kfDef *kfconfig.KfConfig, params []kfconfig.NameValue, parent *types.Kustomization, child *types.Kustomization, kustomizationMaps map[MapType]map[string]bool) error
MergeKustomization will merge the child into the parent if the child has no bases, then the parent just needs to add the child as base otherwise the parent needs to merge with behaviors Multiple overlays are constrained in what they can merge which exclude NamePrefixes, NameSuffixes, CommonLabels, CommonAnnotations. Any of these will generate an error
func MergeKustomizations ¶
func MergeKustomizations(kfDef *kfconfig.KfConfig, compDir string, overlayParams []string, params []kfconfig.NameValue) (*types.Kustomization, error)
MergeKustomizations will merge base and all overlay kustomization files into a single kustomization file
func ReadUnstructured ¶
func ReadUnstructured(kfDefFile string) (*unstructured.Unstructured, error)
ReadUnstructured will read a resource .yaml and return the Unstructured type
func WriteKfDef ¶
WriteKfDef will write a KfDef to a config .yaml