@@ -2479,19 +2479,6 @@ function validateContainerApp(
24792479 `"containers.rollout_step_percentage" field should be a number between 25 and 100, but got ${ containerAppOptional . rollout_step_percentage } `
24802480 ) ;
24812481 }
2482-
2483- if (
2484- ! isOptionalProperty ( containerAppOptional , "rollout_kind" , "string" ) &&
2485- "rollout_kind" in containerAppOptional &&
2486- ! [ "full_auto" , "full_manual" , "none" ] . includes (
2487- containerAppOptional . rollout_kind
2488- )
2489- ) {
2490- diagnostics . errors . push (
2491- `"containers.rollout_kind" field should be either 'full_auto', 'full_manual' or 'none', but got ${ containerAppOptional . rollout_kind } `
2492- ) ;
2493- }
2494-
24952482 // Leaving for legacy reasons
24962483 // TODO: When cleaning up container.configuration usage in other places clean this up
24972484 // as well.
@@ -2500,16 +2487,71 @@ function validateContainerApp(
25002487 `"containers.configuration" is defined as an array, it should be an object`
25012488 ) ;
25022489 }
2503- if ( "instance_type" in containerAppOptional ) {
2504- validateOptionalProperty (
2505- diagnostics ,
2506- field ,
2490+ validateOptionalProperty (
2491+ diagnostics ,
2492+ field ,
2493+ "rollout_kind" ,
2494+ containerAppOptional . rollout_kind ,
2495+ "string" ,
2496+ [ "full_auto" , "full_manual" , "none" ]
2497+ ) ;
2498+ validateOptionalProperty (
2499+ diagnostics ,
2500+ field ,
2501+ "instance_type" ,
2502+ containerAppOptional . instance_type ,
2503+ "string" ,
2504+ [ "dev" , "basic" , "standard" ]
2505+ ) ;
2506+ validateOptionalProperty (
2507+ diagnostics ,
2508+ field ,
2509+ "max_instances" ,
2510+ containerAppOptional . max_instances ,
2511+ "number"
2512+ ) ;
2513+ validateOptionalProperty (
2514+ diagnostics ,
2515+ field ,
2516+ "image_build_context" ,
2517+ containerAppOptional . image_build_context ,
2518+ "string"
2519+ ) ;
2520+ validateOptionalProperty (
2521+ diagnostics ,
2522+ field ,
2523+ "image_vars" ,
2524+ containerAppOptional . image_vars ,
2525+ "object"
2526+ ) ;
2527+ validateOptionalProperty (
2528+ diagnostics ,
2529+ field ,
2530+ "scheduling_policy" ,
2531+ containerAppOptional . scheduling_policy ,
2532+ "string" ,
2533+ [ "regional" , "moon" , "default" ]
2534+ ) ;
2535+ validateAdditionalProperties (
2536+ diagnostics ,
2537+ field ,
2538+ Object . keys ( containerAppOptional ) ,
2539+ [
2540+ "name" ,
2541+ "instances" ,
2542+ "max_instances" ,
2543+ "image" ,
2544+ "image_build_context" ,
2545+ "image_vars" ,
2546+ "class_name" ,
2547+ "scheduling_policy" ,
25072548 "instance_type" ,
2508- containerAppOptional . instance_type ,
2509- "string" ,
2510- [ "dev" , "basic" , "standard" ]
2511- ) ;
2512- }
2549+ "configuration" ,
2550+ "constraints" ,
2551+ "rollout_step_percentage" ,
2552+ "rollout_kind" ,
2553+ ]
2554+ ) ;
25132555 }
25142556
25152557 if ( diagnostics . errors . length > 0 ) {
0 commit comments