public void overrideCubeProperties ( DockerCompositions overrideDockerCompositions ) { final Set < String > containerIds = overrideDockerCompositions . getContainerIds ( ) ; for ( String containerId : containerIds ) { // main definition of containers contains a container that must be overrode if ( containers . containsKey ( containerId ) ) { final CubeContainer cubeContainer = containers . get ( containerId ) ; final CubeContainer overrideCubeContainer = overrideDockerCompositions . get ( containerId ) ; cubeContainer . setRemoveVolumes ( overrideCubeContainer . getRemoveVolumes ( ) ) ; cubeContainer . setAlwaysPull ( overrideCubeContainer . getAlwaysPull ( ) ) ; if ( overrideCubeContainer . hasAwait ( ) ) { cubeContainer . setAwait ( overrideCubeContainer . getAwait ( ) ) ; } if ( overrideCubeContainer . hasBeforeStop ( ) ) { cubeContainer . setBeforeStop ( overrideCubeContainer . getBeforeStop ( ) ) ; } if ( overrideCubeContainer . isManual ( ) ) { cubeContainer . setManual ( overrideCubeContainer . isManual ( ) ) ; } if ( overrideCubeContainer . isKillContainer ( ) ) { cubeContainer . setKillContainer ( overrideCubeContainer . isKillContainer ( ) ) ; } } else { logger . warning ( String . format ( "Overriding Container %s are not defined in main definition of containers." , containerId ) ) ; } } }
This method only overrides properties that are specific from Cube like await strategy or before stop events .