Skip to content

Commit bb9b938

Browse files
committed
Make operating system name parametric for ci tests
Signed-off-by: Koray Oksay <koray.oksay@gmail.com>
1 parent 8342db4 commit bb9b938

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ci/cloudrunners/oci/main.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ var args struct {
3131
shape string
3232
shapeOcpus float32
3333
shapeMemoryInGBs float32
34+
runEnv string
3435
}
3536

3637
func main() {
@@ -58,9 +59,13 @@ func run(cmd *cobra.Command, argv []string) error {
5859

5960
// List Images and retrieve the latest ID by type and arch
6061

62+
osname := fmt.Sprintf("ubuntu-24.04-%s-gha-image", args.arch)
63+
if args.runEnv != "production" {
64+
osname = fmt.Sprintf("rc-ubuntu-24.04-%s-gha-image", args.arch)
65+
}
6166
images, err := computeClient.ListImages(ctx, core.ListImagesRequest{
6267
CompartmentId: common.String(args.compartmentId),
63-
OperatingSystem: common.String(fmt.Sprintf("ubuntu-24.04-%s-gha-image", args.arch)),
68+
OperatingSystem: common.String(osname),
6469
SortBy: core.ListImagesSortByTimecreated,
6570
SortOrder: core.ListImagesSortOrderDesc,
6671
Limit: common.Int(1),
@@ -232,4 +237,10 @@ func init() {
232237
0.0, // Default to 0.
233238
"Amount of memory in GBs for flexible shapes (e.g., 16.0, 32.0). Required if a '.Flex' shape is used.",
234239
)
240+
flags.StringVar(
241+
&args.runEnv,
242+
"running-environment",
243+
"production",
244+
"Running Environment: production or ci",
245+
)
235246
}

0 commit comments

Comments
 (0)