#1602 copy updated policy for reserved cg builds
Merged 2 years ago by mikem. Opened 2 years ago by tkopecek.
tkopecek/koji issue1599  into  master

file modified
+3
@@ -5868,6 +5868,9 @@ 

          koji.plugin.run_callbacks('preBuildStateChange', attribute='state', old=st_old, new=st_complete, info=buildinfo)

          update = UpdateProcessor('build', clauses=['id=%(id)s'], values=buildinfo)

          update.set(state=st_complete, extra=extra, owner=owner, source=source)

+         if self.buildinfo.get('volume_id'):

+             # reserved builds have reapplied volume policy now

+             update.set(volume_id=self.buildinfo['volume_id'])

          update.rawset(completion_time='NOW()')

          update.execute()

          buildinfo = get_build(build_id, strict=True)

BTW, should we forbid user to set volume or in cg_init_build?
it might confuse people, because volume policy will finally override it after CGimport is finished.

BTW, should we forbid user to set volume or in cg_init_build?

Hmm, we might want to forbid other things as well, or at least filter them out. E.g. source/task_id/extra, unless there is a clear case for them. It seems odd to have these values set by something outside of the metadata.

should we forbid user to set volume or in cg_init_build?

Regardless, this is a separate issue. Filed as #1605

This change looks ok and seems to fix the issue at hand :thumbsup:

Commit bee6899 fixes this pull-request

Pull-Request has been merged by mikem

2 years ago