mia-platform / mlp

cli for easier deployment of Mia-Platform Console projects
https://docs.mia-platform.eu/docs/runtime_suite_tools/mlp/overview
Apache License 2.0
12 stars 2 forks source link

[BUG] MLP always need RBAC for creating namespaces #3

Closed thobianchi closed 2 years ago

thobianchi commented 2 years ago

During the MLP deploy phase there is this code:

if _, err := helper.Create(namespace, false, namespaceInfo[0].Object); err != nil && !apierrors.IsAlreadyExists(err) {
        return nil, err
    }

for ensuring the existence of the namespace.

For a variety of reasons, this is suboptimal, it si best to at least first, do a GET to see if exists and/or mlp don't have the right permissions to do this action, because is cannot be always granted.

Best solution is to add a new flag to skip the process entirely, something like "--skip-ensure-namespace" and add an if on the entire ensureNamespace function.

davidebianchi commented 2 years ago

There is a --ensure-namespace flag already handled, which skip the namespace creation if not needed. It is sufficient for the usecase?