Skip to content

Commit d90e147

Browse files
Adjust mapped imageProject name for CoseOS. (#13247) (#9513)
[upstream:4a6f3ee52ef9b7004fe639ec289be7ce28a268af] Signed-off-by: Modular Magician <[email protected]>
1 parent dda01c7 commit d90e147

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

.changelog/13247.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note: bug
2+
compute: adjust mapped image names that were preventing usage of `fedora-coreos` in `google_compute_image` resource
3+
```

google-beta/services/compute/image.go

+14-10
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,17 @@ var (
3939
// built-in projects to look for images/families containing the string
4040
// on the left in
4141
var ImageMap = map[string]string{
42-
"centos": "centos-cloud",
43-
"coreos": "coreos-cloud",
44-
"debian": "debian-cloud",
45-
"opensuse": "opensuse-cloud",
46-
"rhel": "rhel-cloud",
47-
"rocky-linux": "rocky-linux-cloud",
48-
"sles": "suse-cloud",
49-
"ubuntu": "ubuntu-os-cloud",
50-
"windows": "windows-cloud",
51-
"windows-sql": "windows-sql-cloud",
42+
"centos": "centos-cloud",
43+
"coreos": "coreos-cloud",
44+
"debian": "debian-cloud",
45+
"fedora-coreos": "fedora-coreos-cloud",
46+
"opensuse": "opensuse-cloud",
47+
"rhel": "rhel-cloud",
48+
"rocky-linux": "rocky-linux-cloud",
49+
"sles": "suse-cloud",
50+
"ubuntu": "ubuntu-os-cloud",
51+
"windows": "windows-cloud",
52+
"windows-sql": "windows-sql-cloud",
5253
}
5354

5455
func resolveImageImageExists(c *transport_tpg.Config, project, name, userAgent string) (bool, error) {
@@ -101,6 +102,9 @@ func ResolveImage(c *transport_tpg.Config, project, name, userAgent string) (str
101102
for k, v := range ImageMap {
102103
if strings.Contains(name, k) {
103104
builtInProject = v
105+
if builtInProject == "coreos-cloud" && strings.Contains(name, "fedora") {
106+
builtInProject = ImageMap["fedora-coreos"]
107+
}
104108
break
105109
}
106110
}

0 commit comments

Comments
 (0)