@@ -2469,19 +2469,6 @@ function validateContainerApp(
24692469 `"containers.rollout_step_percentage" field should be a number between 25 and 100, but got ${ containerAppOptional . rollout_step_percentage } `
24702470 ) ;
24712471 }
2472-
2473- if (
2474- ! isOptionalProperty ( containerAppOptional , "rollout_kind" , "string" ) &&
2475- "rollout_kind" in containerAppOptional &&
2476- ! [ "full_auto" , "full_manual" , "none" ] . includes (
2477- containerAppOptional . rollout_kind
2478- )
2479- ) {
2480- diagnostics . errors . push (
2481- `"containers.rollout_kind" field should be either 'full_auto', 'full_manual' or 'none', but got ${ containerAppOptional . rollout_kind } `
2482- ) ;
2483- }
2484-
24852472 // Leaving for legacy reasons
24862473 // TODO: When cleaning up container.configuration usage in other places clean this up
24872474 // as well.
@@ -2490,16 +2477,71 @@ function validateContainerApp(
24902477 `"containers.configuration" is defined as an array, it should be an object`
24912478 ) ;
24922479 }
2493- if ( "instance_type" in containerAppOptional ) {
2494- validateOptionalProperty (
2495- diagnostics ,
2496- field ,
2480+ validateOptionalProperty (
2481+ diagnostics ,
2482+ field ,
2483+ "rollout_kind" ,
2484+ containerAppOptional . rollout_kind ,
2485+ "string" ,
2486+ [ "full_auto" , "full_manual" , "none" ]
2487+ ) ;
2488+ validateOptionalProperty (
2489+ diagnostics ,
2490+ field ,
2491+ "instance_type" ,
2492+ containerAppOptional . instance_type ,
2493+ "string" ,
2494+ [ "dev" , "basic" , "standard" ]
2495+ ) ;
2496+ validateOptionalProperty (
2497+ diagnostics ,
2498+ field ,
2499+ "max_instances" ,
2500+ containerAppOptional . max_instances ,
2501+ "number"
2502+ ) ;
2503+ validateOptionalProperty (
2504+ diagnostics ,
2505+ field ,
2506+ "image_build_context" ,
2507+ containerAppOptional . image_build_context ,
2508+ "string"
2509+ ) ;
2510+ validateOptionalProperty (
2511+ diagnostics ,
2512+ field ,
2513+ "image_vars" ,
2514+ containerAppOptional . image_vars ,
2515+ "object"
2516+ ) ;
2517+ validateOptionalProperty (
2518+ diagnostics ,
2519+ field ,
2520+ "scheduling_policy" ,
2521+ containerAppOptional . scheduling_policy ,
2522+ "string" ,
2523+ [ "regional" , "moon" , "default" ]
2524+ ) ;
2525+ validateAdditionalProperties (
2526+ diagnostics ,
2527+ field ,
2528+ Object . keys ( containerAppOptional ) ,
2529+ [
2530+ "name" ,
2531+ "instances" ,
2532+ "max_instances" ,
2533+ "image" ,
2534+ "image_build_context" ,
2535+ "image_vars" ,
2536+ "class_name" ,
2537+ "scheduling_policy" ,
24972538 "instance_type" ,
2498- containerAppOptional . instance_type ,
2499- "string" ,
2500- [ "dev" , "basic" , "standard" ]
2501- ) ;
2502- }
2539+ "configuration" ,
2540+ "constraints" ,
2541+ "rollout_step_percentage" ,
2542+ "rollout_kind" ,
2543+ ]
2544+ ) ;
25032545 }
25042546
25052547 if ( diagnostics . errors . length > 0 ) {
0 commit comments