Merge branch '4.15' into main

This commit is contained in:
nicolas 2021-09-02 12:16:06 -03:00
commit eb64141785
No known key found for this signature in database
GPG Key ID: 656E1BCC8CB54F84
7 changed files with 119 additions and 10 deletions

View File

@ -29,6 +29,7 @@ import java.util.Date;
import javax.inject.Inject;
import com.cloud.upgrade.dao.Upgrade41510to41520;
import org.apache.cloudstack.utils.CloudStackVersion;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
@ -71,7 +72,7 @@ import com.cloud.upgrade.dao.Upgrade41300to41310;
import com.cloud.upgrade.dao.Upgrade41310to41400;
import com.cloud.upgrade.dao.Upgrade41400to41500;
import com.cloud.upgrade.dao.Upgrade41500to41510;
import com.cloud.upgrade.dao.Upgrade41510to41600;
import com.cloud.upgrade.dao.Upgrade41520to41600;
import com.cloud.upgrade.dao.Upgrade420to421;
import com.cloud.upgrade.dao.Upgrade421to430;
import com.cloud.upgrade.dao.Upgrade430to440;
@ -198,8 +199,8 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
.next("4.14.0.0", new Upgrade41400to41500())
.next("4.14.1.0", new Upgrade41400to41500())
.next("4.15.0.0", new Upgrade41500to41510())
.next("4.15.1.0", new Upgrade41510to41600())
.next("4.15.2.0", new Upgrade41510to41600())
.next("4.15.1.0", new Upgrade41510to41520())
.next("4.15.2.0", new Upgrade41520to41600())
.build();
}

View File

@ -0,0 +1,66 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.upgrade.dao;
import com.cloud.utils.exception.CloudRuntimeException;
import java.io.InputStream;
import java.sql.Connection;
public class Upgrade41510to41520 implements DbUpgrade {
@Override
public String[] getUpgradableVersionRange() {
return new String[]{"4.15.1.0", "4.15.2.0"};
}
@Override
public String getUpgradedVersion() {
return "4.15.2.0";
}
@Override
public boolean supportsRollingUpgrade() {
return false;
}
@Override
public InputStream[] getPrepareScripts() {
final String scriptFile = "META-INF/db/schema-41510to41520.sql";
final InputStream script = Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
if (script == null) {
throw new CloudRuntimeException("Unable to find " + scriptFile);
}
return new InputStream[] {script};
}
@Override
public void performDataMigration(Connection conn) {
}
@Override
public InputStream[] getCleanupScripts() {
final String scriptFile = "META-INF/db/schema-41510to41520-cleanup.sql";
final InputStream script = Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
if (script == null) {
throw new CloudRuntimeException("Unable to find " + scriptFile);
}
return new InputStream[] {script};
}
}

View File

@ -32,13 +32,13 @@ import org.apache.log4j.Logger;
import com.cloud.hypervisor.Hypervisor;
import com.cloud.utils.exception.CloudRuntimeException;
public class Upgrade41510to41600 implements DbUpgrade, DbUpgradeSystemVmTemplate {
public class Upgrade41520to41600 implements DbUpgrade, DbUpgradeSystemVmTemplate {
final static Logger LOG = Logger.getLogger(Upgrade41510to41600.class);
final static Logger LOG = Logger.getLogger(Upgrade41520to41600.class);
@Override
public String[] getUpgradableVersionRange() {
return new String[] {"4.15.1.0", "4.16.0.0"};
return new String[] {"4.15.2.0", "4.16.0.0"};
}
@Override
@ -53,7 +53,7 @@ public class Upgrade41510to41600 implements DbUpgrade, DbUpgradeSystemVmTemplate
@Override
public InputStream[] getPrepareScripts() {
final String scriptFile = "META-INF/db/schema-41510to41600.sql";
final String scriptFile = "META-INF/db/schema-41520to41600.sql";
final InputStream script = Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
if (script == null) {
throw new CloudRuntimeException("Unable to find " + scriptFile);
@ -237,7 +237,7 @@ public class Upgrade41510to41600 implements DbUpgrade, DbUpgradeSystemVmTemplate
@Override
public InputStream[] getCleanupScripts() {
final String scriptFile = "META-INF/db/schema-41510to41600-cleanup.sql";
final String scriptFile = "META-INF/db/schema-41520to41600-cleanup.sql";
final InputStream script = Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
if (script == null) {
throw new CloudRuntimeException("Unable to find " + scriptFile);

View File

@ -16,6 +16,6 @@
-- under the License.
--;
-- Schema upgrade cleanup from 4.15.1.0 to 4.16.0.0
-- Schema upgrade cleanup from 4.15.1.0 to 4.15.2.0
--;

View File

@ -0,0 +1,21 @@
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--;
-- Schema upgrade from 4.15.1.0 to 4.15.2.0
--;

View File

@ -0,0 +1,21 @@
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--;
-- Schema upgrade cleanup from 4.15.2.0 to 4.16.0.0
--;

View File

@ -16,7 +16,7 @@
-- under the License.
--;
-- Schema upgrade from 4.15.1.0 to 4.16.0.0
-- Schema upgrade from 4.15.2.0 to 4.16.0.0
--;
-- Adding dynamic scalable flag for service offering table