Skip to content

Commit

Permalink
Azure: Add more VM image info
Browse files Browse the repository at this point in the history
  • Loading branch information
ish-hcc committed Dec 26, 2024
1 parent cbdc9af commit 302e333
Show file tree
Hide file tree
Showing 4 changed files with 167 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type Config struct {
Zone string `yaml:"zone"`
Resources struct {
Image struct {
NameId string `yaml:"nameId"`
Name string `yaml:"name"`
} `yaml:"image"`
Security struct {
NameId string `yaml:"nameId"`
Expand Down Expand Up @@ -80,9 +80,9 @@ type Config struct {
IID struct {
NameId string `yaml:"nameId"`
} `yaml:"IID"`
ImageIID struct {
NameId string `yaml:"nameId"`
} `yaml:"ImageIID"`
Image struct {
Name string `yaml:"name"`
} `yaml:"Image"`
ImageType string `yaml:"ImageType"`
VmSpecName string `yaml:"VmSpecName"`
KeyPairIID struct {
Expand Down Expand Up @@ -248,7 +248,7 @@ func testImageHandler(config Config) {

testImageHandlerListPrint()

imageIID := irs.IID{NameId: config.Azure.Resources.Image.NameId}
imageName := config.Azure.Resources.Image.Name

Loop:
for {
Expand All @@ -272,7 +272,7 @@ Loop:
cblogger.Info("Finish ListImage()")
case 2:
cblogger.Info("Start GetImage() ...")
if imageInfo, err := imageHandler.GetImage(imageIID); err != nil {
if imageInfo, err := imageHandler.GetImage(imageName); err != nil {
cblogger.Error(err)
} else {
spew.Dump(imageInfo)
Expand Down Expand Up @@ -787,7 +787,7 @@ func testVMHandler(config Config) {
},
ImageType: imageType,
ImageIID: irs.IID{
NameId: config.Azure.Resources.Vm.ImageIID.NameId,
NameId: config.Azure.Resources.Vm.Image.Name,
},
VpcIID: irs.IID{
NameId: config.Azure.Resources.Vm.VpcIID.NameId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ azure:
zone: TBD
resources:
image:
nameId: Canonical:UbuntuServer:18.04-LTS:18.04.201804262
name: Canonical:UbuntuServer:18.04-LTS:18.04.201804262
security:
nameId: mcb-test-sg
VpcIID:
Expand Down Expand Up @@ -48,8 +48,8 @@ azure:
vm:
IID:
nameId: mcb-test-vm
ImageIID:
nameId: imageid
Image:
name: imageName
# nameId: Canonical:UbuntuServer:18.04-LTS:18.04.201804262
ImageType: MyImage
VmSpecName: Standard_B1ls
Expand Down
Loading

0 comments on commit 302e333

Please sign in to comment.