core/src/main/java/io/fabric8/maven/core/service/ApplyService.java
public boolean applyNamespace(Namespace entity) {
        String namespace = getOrCreateMetadata(entity).getName();
        log.info("Using namespace: " + namespace);
        String name = getName(entity);
        Objects.requireNonNull(name, "No name for " + entity );
        Namespace old = kubernetesClient.namespaces().withName(name).get();
        if (!isRunning(old)) {
            try {
                Object answer = kubernetesClient.namespaces().create(entity);
                logGeneratedEntity("Created namespace: ", namespace, entity, answer);
                return true;
            } catch (Exception e) {
                onApplyError("Failed to create namespace: " + name + " due " + e.getMessage(), e);
            }
        }
        return false;
    }
public boolean applyNamespace(Namespace entity) {
        String namespace = getOrCreateMetadata(entity).getName();
        log.info("Using namespace: " + namespace);
        String name = getName(entity);
        Objects.requireNonNull(name, "No name for " + entity );
        Namespace old = kubernetesClient.namespaces().withName(name).get();
        if (!isRunning(old)) {
            try {
                Object answer = kubernetesClient.namespaces().create(entity);
                logGeneratedEntity("Created namespace: ", namespace, entity, answer);
                return true;
            } catch (Exception e) {
                onApplyError("Failed to create namespace: " + name + " due " + e.getMessage(), e);
            }
        }
        return false;
    }
public boolean applyNamespace ( Namespace entity ) { String namespace = getOrCreateMetadata ( entity ) . getName ( ) ; log . info ( "Using namespace: " + namespace ) ; String name = getName ( entity ) ; Objects . requireNonNull ( name , "No name for " + entity ) ; Namespace old = kubernetesClient . namespaces ( ) . withName ( name ) . get ( ) ; if ( ! isRunning ( old ) ) { try { Object answer = kubernetesClient . namespaces ( ) . create ( entity ) ; logGeneratedEntity ( "Created namespace: " , namespace , entity , answer ) ; return true ; } catch ( Exception e ) { onApplyError ( "Failed to create namespace: " + name + " due " + e . getMessage ( ) , e ) ; } } return false ; }
Returns true if the namespace is created
Returns true if the namespace is created