Skip to content

Conversation

@gonzariosm
Copy link

  • Updated image model
  • Created docker model
  • Created image list and getbycode function

}

// registry url (staging)
registryPath := "registry-staging.sitehost.co.nz"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be better if the request has a variable like ImageProvider and it can be either empty, or sitehost or custom values.

If empty or sitehost, we can assume sitehost provided image hence registry.sitehost.co.nz
if custom, it's custom image so registry-clients.sitehost.co.nz.

put the registry urls as constants.

For now if custom value is detected, print out message that say something along the line custom image is not supported at the moment

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, we can add ImageProvider to AddRequestWithImage struct. Then control this value in the same function?

Copy link
Collaborator

@tommy-ng0 tommy-ng0 May 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I would imagine we can set a variable in terraform to specify if the image is from sitehost or custom provider.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but in this case the endpoint is different

sitehost images: https://api.sitehost.nz/1.2/cloud/stack/image/list_all.json
client images: https://api.sitehost.nz/1.2/cloud/image/list_all.json

},
Expose: request.Ports,
Image: request.Image,
Labels: []string{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all labels are the same across all type of images. You will need to check for different type of image and create the labels for it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide and example please.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can create services and integrated containers and compare the docker-compose file to web containers.

Name: request.Name,
Label: request.Label,
Image: registryPath + "/" + image.Code + ":" + imageLastVersion,
Type: image.Labels.NzSitehostImageType,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need to check the image type and only proceed with the supported image types we discussed before. Print out a message that says something along the line of image type is not supported at the moment.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm if the expected types are service and www.

Copy link
Collaborator

@tommy-ng0 tommy-ng0 May 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for now we expect service, www and integrated type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants