Merge "Change kolla_version LABEL to git sha-1"

This commit is contained in:
Zuul 2022-07-01 09:36:30 +00:00 committed by Gerrit Code Review
commit ea5d95d3f2
3 changed files with 12 additions and 1 deletions

View File

@ -816,7 +816,8 @@ class KollaWorker(object):
return ret
def create_dockerfiles(self):
kolla_version = version.version_info.cached_version_string()
kolla_version = version.git_info if len(version.git_info) != 0 else \
version.version_info.cached_version_string()
supported_distro_name = common_config.DISTRO_PRETTY_NAME.get(
self.base)
for path in self.docker_build_paths:

View File

@ -10,6 +10,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import pbr.git
import pbr.version
kolla_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
version_info = pbr.version.VersionInfo('kolla')
git_info = pbr.git.get_git_short_sha(git_dir=os.path.join(kolla_path, ".git"))

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
Change ``kolla_version`` label to git sha-1 if images
are built with kolla from git.