Пример #1
0
 def _strategy_params_to_int(self, roll_update_strategy, resource_name,
                             metadata_name, is_preview, is_validate):
     strategy_params = ['maxUnavailable', 'maxSurge']
     for p in strategy_params:
         roll_update_strategy[p] = utils.handle_number_var(
             roll_update_strategy[p],
             f'{resource_name}[{metadata_name}]{p}', is_preview,
             is_validate)
Пример #2
0
 def set_base_spec(self, spec, resource_name, metadata_name, is_preview,
                   is_validate):
     # 处理minReadySeconds
     min_readys = 'minReadySeconds'
     if min_readys in spec:
         spec[min_readys] = utils.handle_number_var(
             spec[min_readys],
             f'{resource_name}[{metadata_name}]{min_readys}', is_preview,
             is_validate)
Пример #3
0
 def _health_checks_params_to_int(self, health_check, metadata_name,
                                  is_preview, is_validate):
     common_check_params = [
         'delaySeconds',
         'intervalSeconds',
         'timeoutSeconds',
         'consecutiveFailures',
         'gracePeriodSeconds',
     ]
     for p in common_check_params:
         health_check[p] = utils.handle_number_var(
             health_check[p], f'Application[{metadata_name}]{p}',
             is_preview, is_validate)