Repository: dragonflyoss/Dragonfly2
Pull request #1324 (2022-05-24 06:18:42)

feat: custom preheat tag parameters
Signed-off-by: Gaius <gaius.qi@gmail.com>

<!--- Provide a general summary of your changes in the Title above -->

## Description
- Custom preheat tag parameters.
<!--- Describe your changes in detail -->

## Related Issue

<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
<!--- Please link to the issue here: -->

## Motivation and Context

<!--- Why is this change required? What problem does it solve? -->

## Screenshots (if appropriate)

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation Update (if none of the other choices apply)

## Checklist

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have read the **CONTRIBUTING** document.
- [ ] I have added tests to cover my changes.


codecov-commenter: # [Codecov](https://codecov.io/gh/dragonflyoss/Dragonfly2/pull/1324?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss) Report
> Merging [#1324](https://codecov.io/gh/dragonflyoss/Dragonfly2/pull/1324?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss) (9bfe47d) into [main](https://codecov.io/gh/dragonflyoss/Dragonfly2/commit/22fb2fd9dfb3c05213480c10fdc03be684ab6346?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss) (22fb2fd) will **decrease** coverage by `0.21%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/dragonflyoss/Dragonfly2/pull/1324/graphs/tree.svg?width=650&height=150&src=pr&token=PUICJYSAT7&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss)](https://codecov.io/gh/dragonflyoss/Dragonfly2/pull/1324?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss)

```diff
@@            Coverage Diff             @@
##             main    #1324      +/-   ##
==========================================
- Coverage   45.79%   45.57%   -0.22%     
==========================================
  Files         140      140              
  Lines       11900    11900              
==========================================
- Hits         5450     5424      -26     
- Misses       5839     5859      +20     
- Partials      611      617       +6     
```

| Flag | Coverage Δ | |
|---|---|---|
| Object-compatibility-e2etests | `?` | |
| e2etests | `?` | |
| unittests | `45.57% <ø> (-0.22%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Impacted Files](https://codecov.io/gh/dragonflyoss/Dragonfly2/pull/1324?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss) | Coverage Δ | |
|---|---|---|
| [cdn/supervisor/progress/progress.go](https://codecov.io/gh/dragonflyoss/Dragonfly2/pull/1324/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#diff-Y2RuL3N1cGVydmlzb3IvcHJvZ3Jlc3MvcHJvZ3Jlc3MuZ28=) | `90.62% <0.00%> (-6.25%)` | :arrow_down: |
| [...ent/daemon/peer/peertask\_piecetask\_synchronizer.go](https://codecov.io/gh/dragonflyoss/Dragonfly2/pull/1324/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#diff-Y2xpZW50L2RhZW1vbi9wZWVyL3BlZXJ0YXNrX3BpZWNldGFza19zeW5jaHJvbml6ZXIuZ28=) | `42.56% <0.00%> (-4.11%)` | :arrow_down: |
| [client/daemon/peer/peertask\_piecetask\_poller.go](https://codecov.io/gh/dragonflyoss/Dragonfly2/pull/1324/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#diff-Y2xpZW50L2RhZW1vbi9wZWVyL3BlZXJ0YXNrX3BpZWNldGFza19wb2xsZXIuZ28=) | `47.10% <0.00%> (-3.63%)` | :arrow_down: |
| [client/daemon/peer/peertask\_conductor.go](https://codecov.io/gh/dragonflyoss/Dragonfly2/pull/1324/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#diff-Y2xpZW50L2RhZW1vbi9wZWVyL3BlZXJ0YXNrX2NvbmR1Y3Rvci5nbw==) | `57.27% <0.00%> (-0.91%)` | :arrow_down: |


Patch:
diff --git a/api/manager/docs.go b/api/manager/docs.go
index a686a923..c6f7cc06 100644
--- a/api/manager/docs.go
+++ b/api/manager/docs.go
@@ -3542,9 +3542,15 @@ const docTemplate = `{
                 "bio": {
                     "type": "string"
                 },
+                "created_at": {
+                    "type": "string"
+                },
                 "download_rate_limit": {
                     "type": "integer"
                 },
+                "id": {
+                    "type": "integer"
+                },
                 "name": {
                     "type": "string"
                 },
@@ -3563,6 +3569,9 @@ const docTemplate = `{
                 "state": {
                     "type": "string"
                 },
+                "updated_at": {
+                    "type": "string"
+                },
                 "url": {
                     "type": "string"
                 },
@@ -3574,52 +3583,22 @@ const docTemplate = `{
                 }
             }
         },
-        "model.Assertion": {
+        "model.Config": {
             "type": "object",
             "properties": {
-                "key": {
+                "bio": {
                     "type": "string"
                 },
-                "policy": {
-                    "type": "array",
-                    "items": {
-                        "type": "array",
-                        "items": {
-                            "type": "string"
-                        }
-                    }
-                },
-                "policyMap": {
-                    "type": "object",
-                    "additionalProperties": {
-                        "type": "integer"
-                    }
+                "created_at": {
+                    "type": "string"
                 },
-                "rm": {},
-                "tokens": {
-                    "type": "array",
-                    "items": {
-                        "type": "string"
-                    }
+                "id": {
+                    "type": "integer"
                 },
-                "value": {
-                    "type": "string"
-                }
-            }
-        },
-        "model.AssertionMap": {
-            "type": "object",
-            "additionalProperties": {
-                "$ref": "#/definitions/model.Assertion"
-            }
-        },
-        "model.Config": {
-            "type": "object",
-            "properties": {
-                "bio": {
+                "name": {
                     "type": "string"
                 },
-                "name": {
+                "updated_at": {
                     "type": "string"
                 },
                 "user_id": {
@@ -3643,6 +3622,12 @@ const docTemplate = `{
                 "bio": {
                     "type": "string"
                 },
+                "created_at": {
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                },
                 "result": {
                     "$ref": "#/definitions/model.JSONMap"
                 },
@@ -3667,6 +3652,9 @@ const docTemplate = `{
                 "type": {
                     "type": "string"
                 },
+                "updated_at": {
+                    "type": "string"
+                },
                 "user_id": {
                     "type": "integer"
                 }
@@ -3684,20 +3672,35 @@ const docTemplate = `{
                 "client_secret": {
                     "type": "string"
                 },
+                "created_at": {
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                },
                 "name": {
                     "type": "string"
                 },
                 "redirect_url": {
                     "type": "string"
+                },
+                "updated_at": {
+                    "type": "string"
                 }
             }
         },
         "model.Scheduler": {
             "type": "object",
             "properties": {
+                "created_at": {
+                    "type": "string"
+                },
                 "host_name": {
                     "type": "string"
                 },
+                "id": {
+                    "type": "integer"
+                },
                 "idc": {
                     "type": "string"
                 },
@@ -3718,6 +3721,9 @@ const docTemplate = `{
                 },
                 "state": {
                     "type": "string"
+                },
+                "updated_at": {
+                    "type": "string"
                 }
             }
         },
@@ -3736,6 +3742,12 @@ const docTemplate = `{
                 "config": {
                     "$ref": "#/definitions/model.JSONMap"
                 },
+                "created_at": {
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                },
                 "is_default": {
                     "type": "boolean"
                 },
@@ -3759,6 +3771,9 @@ const docTemplate = `{
                     "items": {
                         "$ref": "#/definitions/model.SeedPeerCluster"
                     }
+                },
+                "updated_at": {
+                    "type": "string"
                 }
             }
         },
@@ -3768,6 +3783,12 @@ const docTemplate = `{
                 "bio": {
                     "type": "string"
                 },
+                "created_at": {
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                },
                 "name": {
                     "type": "string"
                 },
@@ -3776,6 +3797,9 @@ const docTemplate = `{
                     "items": {
                         "$ref": "#/definitions/model.SecurityRule"
                     }
+                },
+                "updated_at": {
+                    "type": "string"
                 }
             }
         },
@@ -3785,9 +3809,15 @@ const docTemplate = `{
                 "bio": {
                     "type": "string"
                 },
+                "created_at": {
+                    "type": "string"
+                },
                 "domain": {
                     "type": "string"
                 },
+                "id": {
+                    "type": "integer"
+                },
                 "name": {
                     "type": "string"
                 },
@@ -3799,18 +3829,27 @@ const docTemplate = `{
                     "items": {
                         "$ref": "#/definitions/model.SecurityGroup"
                     }
+                },
+                "updated_at": {
+                    "type": "string"
                 }
             }
         },
         "model.SeedPeer": {
             "type": "object",
             "properties": {
+                "created_at": {
+                    "type": "string"
+                },
                 "download_port": {
                     "type": "integer"
                 },
                 "host_name": {
                     "type": "string"
                 },
+                "id": {
+                    "type": "integer"
+                },
                 "idc": {
                     "type": "string"
                 },
@@ -3837,6 +3876,9 @@ const docTemplate = `{
                 },
                 "type": {
                     "type": "string"
+                },
+                "updated_at": {
+                    "type": "string"
                 }
             }
         },
@@ -3852,6 +3894,12 @@ const docTemplate = `{
                 "config": {
                     "$ref": "#/definitions/model.JSONMap"
                 },
+                "created_at": {
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                },
                 "is_default": {
                     "type": "boolean"
                 },
@@ -3875,6 +3923,9 @@ const docTemplate = `{
                 },
                 "security_group_id": {
                     "type": "integer"
+                },
+                "updated_at": {
+                    "type": "string"
                 }
             }
         },
@@ -3887,9 +3938,15 @@ const docTemplate = `{
                 "bio": {
                     "type": "string"
                 },
+                "created_at": {
+                    "type": "string"
+                },
                 "email": {
                     "type": "string"
                 },
+                "id": {
+                    "type": "integer"
+                },
                 "location": {
                     "type": "string"
                 },
@@ -3901,6 +3958,9 @@ const docTemplate = `{
                 },
                 "state": {
                     "type": "string"
+                },
+                "updated_at": {
+                    "type": "string"
                 }
             }
         },
diff --git a/api/manager/swagger.json b/api/manager/swagger.json
index d1a4abac..643e6b15 100644
--- a/api/manager/swagger.json
+++ b/api/manager/swagger.json
@@ -3535,9 +3535,15 @@
                 "bio": {
                     "type": "string"
                 },
+                "created_at": {
+                    "type": "string"
+                },
                 "download_rate_limit": {
                     "type": "integer"
                 },
+                "id": {
+                    "type": "integer"
+                },
                 "name": {
                     "type": "string"
                 },
@@ -3556,6 +3562,9 @@
                 "state": {
                     "type": "string"
                 },
+                "updated_at": {
+                    "type": "string"
+                },
                 "url": {
                     "type": "string"
                 },
@@ -3567,52 +3576,22 @@
                 }
             }
         },
-        "model.Assertion": {
+        "model.Config": {
             "type": "object",
             "properties": {
-                "key": {
+                "bio": {
                     "type": "string"
                 },
-                "policy": {
-                    "type": "array",
-                    "items": {
-                        "type": "array",
-                        "items": {
-                            "type": "string"
-                        }
-                    }
-                },
-                "policyMap": {
-                    "type": "object",
-                    "additionalProperties": {
-                        "type": "integer"
-                    }
+                "created_at": {
+                    "type": "string"
                 },
-                "rm": {},
-                "tokens": {
-                    "type": "array",
-                    "items": {
-                        "type": "string"
-                    }
+                "id": {
+                    "type": "integer"
                 },
-                "value": {
-                    "type": "string"
-                }
-            }
-        },
-        "model.AssertionMap": {
-            "type": "object",
-            "additionalProperties": {
-                "$ref": "#/definitions/model.Assertion"
-            }
-        },
-        "model.Config": {
-            "type": "object",
-            "properties": {
-                "bio": {
+                "name": {
                     "type": "string"
                 },
-                "name": {
+                "updated_at": {
                     "type": "string"
                 },
                 "user_id": {
@@ -3636,6 +3615,12 @@
                 "bio": {
                     "type": "string"
                 },
+                "created_at": {
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                },
                 "result": {
                     "$ref": "#/definitions/model.JSONMap"
                 },
@@ -3660,6 +3645,9 @@
                 "type": {
                     "type": "string"
                 },
+                "updated_at": {
+                    "type": "string"
+                },
                 "user_id": {
                     "type": "integer"
                 }
@@ -3677,20 +3665,35 @@
                 "client_secret": {
                     "type": "string"
                 },
+                "created_at": {
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                },
                 "name": {
                     "type": "string"
                 },
                 "redirect_url": {
                     "type": "string"
+                },
+                "updated_at": {
+                    "type": "string"
                 }
             }
         },
         "model.Scheduler": {
             "type": "object",
             "properties": {
+                "created_at": {
+                    "type": "string"
+                },
                 "host_name": {
                     "type": "string"
                 },
+                "id": {
+                    "type": "integer"
+                },
                 "idc": {
                     "type": "string"
                 },
@@ -3711,6 +3714,9 @@
                 },
                 "state": {
                     "type": "string"
+                },
+                "updated_at": {
+                    "type": "string"
                 }
             }
         },
@@ -3729,6 +3735,12 @@
                 "config": {
                     "$ref": "#/definitions/model.JSONMap"
                 },
+                "created_at": {
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                },
                 "is_default": {
                     "type": "boolean"
                 },
@@ -3752,6 +3764,9 @@
                     "items": {
                         "$ref": "#/definitions/model.SeedPeerCluster"
                     }
+                },
+                "updated_at": {
+                    "type": "string"
                 }
             }
         },
@@ -3761,6 +3776,12 @@
                 "bio": {
                     "type": "string"
                 },
+                "created_at": {
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                },
                 "name": {
                     "type": "string"
                 },
@@ -3769,6 +3790,9 @@
                     "items": {
                         "$ref": "#/definitions/model.SecurityRule"
                     }
+                },
+                "updated_at": {
+                    "type": "string"
                 }
             }
         },
@@ -3778,9 +3802,15 @@
                 "bio": {
                     "type": "string"
                 },
+                "created_at": {
+                    "type": "string"
+                },
                 "domain": {
                     "type": "string"
                 },
+                "id": {
+                    "type": "integer"
+                },
                 "name": {
                     "type": "string"
                 },
@@ -3792,18 +3822,27 @@
                     "items": {
                         "$ref": "#/definitions/model.SecurityGroup"
                     }
+                },
+                "updated_at": {
+                    "type": "string"
                 }
             }
         },
         "model.SeedPeer": {
             "type": "object",
             "properties": {
+                "created_at": {
+                    "type": "string"
+                },
                 "download_port": {
                     "type": "integer"
                 },
                 "host_name": {
                     "type": "string"
                 },
+                "id": {
+                    "type": "integer"
+                },
                 "idc": {
                     "type": "string"
                 },
@@ -3830,6 +3869,9 @@
                 },
                 "type": {
                     "type": "string"
+                },
+                "updated_at": {
+                    "type": "string"
                 }
             }
         },
@@ -3845,6 +3887,12 @@
                 "config": {
                     "$ref": "#/definitions/model.JSONMap"
                 },
+                "created_at": {
+                    "type": "string"
+                },
+                "id": {
+                    "type": "integer"
+                },
                 "is_default": {
                     "type": "boolean"
                 },
@@ -3868,6 +3916,9 @@
                 },
                 "security_group_id": {
                     "type": "integer"
+                },
+                "updated_at": {
+                    "type": "string"
                 }
             }
         },
@@ -3880,9 +3931,15 @@
                 "bio": {
                     "type": "string"
                 },
+                "created_at": {
+                    "type": "string"
+                },
                 "email": {
                     "type": "string"
                 },
+                "id": {
+                    "type": "integer"
+                },
                 "location": {
                     "type": "string"
                 },
@@ -3894,6 +3951,9 @@
                 },
                 "state": {
                     "type": "string"
+                },
+                "updated_at": {
+                    "type": "string"
                 }
             }
         },
diff --git a/api/manager/swagger.yaml b/api/manager/swagger.yaml
index 46956026..d568a9e2 100644
--- a/api/manager/swagger.yaml
+++ b/api/manager/swagger.yaml
@@ -4,8 +4,12 @@ definitions:
     properties:
       bio:
         type: string
+      created_at:
+        type: string
       download_rate_limit:
         type: integer
+      id:
+        type: integer
       name:
         type: string
       scheduler_clusters:
@@ -18,6 +22,8 @@ definitions:
         type: array
       state:
         type: string
+      updated_at:
+        type: string
       url:
         type: string
       user:
@@ -25,38 +31,18 @@ definitions:
       user_id:
         type: integer
     type: object
-  model.Assertion:
-    properties:
-      key:
-        type: string
-      policy:
-        items:
-          items:
-            type: string
-          type: array
-        type: array
-      policyMap:
-        additionalProperties:
-          type: integer
-        type: object
-      rm: {}
-      tokens:
-        items:
-          type: string
-        type: array
-      value:
-        type: string
-    type: object
-  model.AssertionMap:
-    additionalProperties:
-      $ref: '#/definitions/model.Assertion'
-    type: object
   model.Config:
     properties:
       bio:
         type: string
+      created_at:
+        type: string
+      id:
+        type: integer
       name:
         type: string
+      updated_at:
+        type: string
       user_id:
         type: integer
       value:
@@ -71,6 +57,10 @@ definitions:
         $ref: '#/definitions/model.JSONMap'
       bio:
         type: string
+      created_at:
+        type: string
+      id:
+        type: integer
       result:
         $ref: '#/definitions/model.JSONMap'
       scheduler_clusters:
@@ -87,6 +77,8 @@ definitions:
         type: string
       type:
         type: string
+      updated_at:
+        type: string
       user_id:
         type: integer
     type: object
@@ -98,15 +90,25 @@ definitions:
         type: string
       client_secret:
         type: string
+      created_at:
+        type: string
+      id:
+        type: integer
       name:
         type: string
       redirect_url:
         type: string
+      updated_at:
+        type: string
     type: object
   model.Scheduler:
     properties:
+      created_at:
+        type: string
       host_name:
         type: string
+      id:
+        type: integer
       idc:
         type: string
       ip:
@@ -121,6 +123,8 @@ definitions:
         type: integer
       state:
         type: string
+      updated_at:
+        type: string
     type: object
   model.SchedulerCluster:
     properties:
@@ -132,6 +136,10 @@ definitions:
         $ref: '#/definitions/model.JSONMap'
       config:
         $ref: '#/definitions/model.JSONMap'
+      created_at:
+        type: string
+      id:
+        type: integer
       is_default:
         type: boolean
       jobs:
@@ -148,24 +156,36 @@ definitions:
         items:
           $ref: '#/definitions/model.SeedPeerCluster'
         type: array
+      updated_at:
+        type: string
     type: object
   model.SecurityGroup:
     properties:
       bio:
         type: string
+      created_at:
+        type: string
+      id:
+        type: integer
       name:
         type: string
       security_rules:
         items:
           $ref: '#/definitions/model.SecurityRule'
         type: array
+      updated_at:
+        type: string
     type: object
   model.SecurityRule:
     properties:
       bio:
         type: string
+      created_at:
+        type: string
       domain:
         type: string
+      id:
+        type: integer
       name:
         type: string
       proxy_domain:
@@ -174,13 +194,19 @@ definitions:
         items:
           $ref: '#/definitions/model.SecurityGroup'
         type: array
+      updated_at:
+        type: string
     type: object
   model.SeedPeer:
     properties:
+      created_at:
+        type: string
       download_port:
         type: integer
       host_name:
         type: string
+      id:
+        type: integer
       idc:
         type: string
       ip:
@@ -199,6 +225,8 @@ definitions:
         type: string
       type:
         type: string
+      updated_at:
+        type: string
     type: object
   model.SeedPeerCluster:
     properties:
@@ -208,6 +236,10 @@ definitions:
         type: string
       config:
         $ref: '#/definitions/model.JSONMap'
+      created_at:
+        type: string
+      id:
+        type: integer
       is_default:
         type: boolean
       jobs:
@@ -224,6 +256,8 @@ definitions:
         $ref: '#/definitions/model.JSONMap'
       security_group_id:
         type: integer
+      updated_at:
+        type: string
     type: object
   model.User:
     properties:
@@ -231,8 +265,12 @@ definitions:
         type: string
       bio:
         type: string
+      created_at:
+        type: string
       email:
         type: string
+      id:
+        type: integer
       location:
         type: string
       name:
@@ -241,6 +279,8 @@ definitions:
         type: string
       state:
         type: string
+      updated_at:
+        type: string
     type: object
   rbac.Permission:
     properties:
diff --git a/manager/job/job.go b/manager/job/job.go
index 6f90ac0b..6b562c0e 100644
--- a/manager/job/job.go
+++ b/manager/job/job.go
@@ -38,7 +38,7 @@ func New(cfg *config.Config) (*Job, error) {
 		return nil, err
 	}
 
-	p, err := newPreheat(j, cfg.Server.Name)
+	p, err := newPreheat(j)
 	if err != nil {
 		return nil, err
 	}
diff --git a/manager/job/preheat.go b/manager/job/preheat.go
index 89155a67..618c3aa9 100644
--- a/manager/job/preheat.go
+++ b/manager/job/preheat.go
@@ -62,8 +62,7 @@ type Preheat interface {
 }
 
 type preheat struct {
-	job    *internaljob.Job
-	bizTag string
+	job *internaljob.Job
 }
 
 type preheatImage struct {
@@ -73,10 +72,9 @@ type preheatImage struct {
 	tag      string
 }
 
-func newPreheat(job *internaljob.Job, bizTag string) (Preheat, error) {
+func newPreheat(job *internaljob.Job) (Preheat, error) {
 	return &preheat{
-		job:    job,
-		bizTag: bizTag,
+		job: job,
 	}, nil
 }
 
@@ -88,6 +86,7 @@ func (p *preheat) CreatePreheat(ctx context.Context, schedulers []model.Schedule
 	defer span.End()
 
 	url := json.URL
+	tag := json.Tag
 	filter := json.Filter
 	rawheader := json.Headers
 
@@ -104,7 +103,7 @@ func (p *preheat) CreatePreheat(ctx context.Context, schedulers []model.Schedule
 			return nil, err
 		}
 
-		files, err = p.getLayers(ctx, url, filter, httputils.MapToHeader(rawheader), image)
+		files, err = p.getLayers(ctx, url, tag, filter, httputils.MapToHeader(rawheader), image)
 		if err != nil {
 			return nil, err
 		}
@@ -112,7 +111,7 @@ func (p *preheat) CreatePreheat(ctx context.Context, schedulers []model.Schedule
 		files = []*internaljob.PreheatRequest{
 			{
 				URL:     url,
-				Tag:     p.bizTag,
+				Tag:     tag,
 				Filter:  filter,
 				Headers: rawheader,
 			},
@@ -168,7 +167,7 @@ func (p *preheat) createGroupJob(ctx context.Context, files []*internaljob.Prehe
 	}, nil
 }
 
-func (p *preheat) getLayers(ctx context.Context, url string, filter string, header http.Header, image *preheatImage) ([]*internaljob.PreheatRequest, error) {
+func (p *preheat) getLayers(ctx context.Context, url, tag, filter string, header http.Header, image *preheatImage) ([]*internaljob.PreheatRequest, error) {
 	ctx, span := tracer.Start(ctx, config.SpanGetLayers, trace.WithSpanKind(trace.SpanKindProducer))
 	defer span.End()
 
@@ -197,7 +196,7 @@ func (p *preheat) getLayers(ctx context.Context, url string, filter string, head
 		}
 	}
 
-	layers, err := p.parseLayers(resp, url, filter, header, image)
+	layers, err := p.parseLayers(resp, url, tag, filter, header, image)
 	if err != nil {
 		return nil, err
 	}
@@ -229,7 +228,7 @@ func (p *preheat) getManifests(ctx context.Context, url string, header http.Head
 	return resp, nil
 }
 
-func (p *preheat) parseLayers(resp *http.Response, url, filter string, header http.Header, image *preheatImage) ([]*internaljob.PreheatRequest, error) {
+func (p *preheat) parseLayers(resp *http.Response, url, tag, filter string, header http.Header, image *preheatImage) ([]*internaljob.PreheatRequest, error) {
 	body, err := io.ReadAll(resp.Body)
 	if err != nil {
 		return nil, err
@@ -245,7 +244,7 @@ func (p *preheat) parseLayers(resp *http.Response, url, filter string, header ht
 		digest := v.Digest.String()
 		layer := &internaljob.PreheatRequest{
 			URL:     layerURL(image.protocol, image.domain, image.name, digest),
-			Tag:     p.bizTag,
+			Tag:     tag,
 			Filter:  filter,
 			Digest:  digest,
 			Headers: httputils.HeaderToMap(header),
diff --git a/manager/types/job.go b/manager/types/job.go
index 975c7a0a..6a980ca0 100644
--- a/manager/types/job.go
+++ b/manager/types/job.go
@@ -55,6 +55,7 @@ type CreatePreheatJobRequest struct {
 type PreheatArgs struct {
 	Type    string            `json:"type" binding:"required,oneof=image file"`
 	URL     string            `json:"url" binding:"required"`
+	Tag     string            `json:"tag" binding:"omitempty"`
 	Filter  string            `json:"filter" binding:"omitempty"`
 	Headers map[string]string `json:"headers" binding:"omitempty"`
 }


Test patch:
diff --git a/test/e2e/manager/preheat.go b/test/e2e/manager/preheat.go
index c5d5cf5f..c7a1ad68 100644
--- a/test/e2e/manager/preheat.go
+++ b/test/e2e/manager/preheat.go
@@ -62,6 +62,7 @@ var _ = Describe("Preheat with manager", func() {
 					Args: types.PreheatArgs{
 						Type: "file",
 						URL:  url,
+						Tag:  managerTag,
 					},
 				})
 				Expect(err).NotTo(HaveOccurred())
@@ -115,6 +116,7 @@ var _ = Describe("Preheat with manager", func() {
 				Args: types.PreheatArgs{
 					Type: "image",
 					URL:  url,
+					Tag:  managerTag,
 				},
 			})
 			Expect(err).NotTo(HaveOccurred())