diff --git a/base/database/testing.go b/base/database/testing.go index cfeefc3a4..a720ccfe4 100644 --- a/base/database/testing.go +++ b/base/database/testing.go @@ -495,6 +495,7 @@ func DeleteSystem(t *testing.T, inventoryID string) { func CreateTemplate(t *testing.T, account int, uuid string, inventoryIDs []string) { template := &models.Template{ RhAccountID: account, UUID: uuid, Name: uuid, EnvironmentID: strings.ReplaceAll(uuid, "-", ""), + Arch: "x86_64", Version: "8", } tx := DB.Begin() diff --git a/base/models/models.go b/base/models/models.go index 88f53d75d..117f79841 100644 --- a/base/models/models.go +++ b/base/models/models.go @@ -46,6 +46,8 @@ type Template struct { UUID string EnvironmentID string Name string + Arch string + Version string // Config pgtype.JSONB // currently unused Description *string Creator *string // pointer for compatibility with previous API versions diff --git a/listener/templates.go b/listener/templates.go index 6c30f61df..78ddd80d8 100644 --- a/listener/templates.go +++ b/listener/templates.go @@ -93,6 +93,8 @@ func TemplateUpdate(template mqueue.TemplateResponse) error { UUID: template.UUID, EnvironmentID: template.EnvironmentID, Name: template.Name, + Arch: template.Arch, + Version: template.Version, //Config: nil, Description: template.Description, Creator: nil, diff --git a/platform/platform.go b/platform/platform.go index 97fb61244..4b01bb903 100644 --- a/platform/platform.go +++ b/platform/platform.go @@ -161,7 +161,7 @@ var templates = []mqueue.TemplateResponse{ OrgID: "org_1", Description: &desc1, Arch: "x86_64", - Version: "1", + Version: "8", Date: time.Now(), RepositoryUUIDS: []string{"20000000-0000-0000-0000-000000000001"}, EnvironmentID: "10000000000000000000000000000001", @@ -172,7 +172,7 @@ var templates = []mqueue.TemplateResponse{ OrgID: "org_1", Description: &desc2, Arch: "x86_64", - Version: "1", + Version: "8", Date: time.Now(), RepositoryUUIDS: []string{"20000000-0000-0000-0000-000000000001", "20000000-0000-0000-0000-000000000002"}, EnvironmentID: "10000000000000000000000000000002", @@ -334,8 +334,8 @@ func mockCreatedTemplates(c *gin.Context) { func mockUpdatedTemplates(c *gin.Context) { updated := templates - updated[0].Version = "2" - updated[1].Version = "2" + updated[0].Version = "9" + updated[1].Version = "9" err := sendTemplateMsg("template-updated", templates) if err != nil { c.JSON(http.StatusInternalServerError, err.Error())