app/src/mutations/scale.py
def update_deployment_scale(name: str, namespace: str, replicas: int):
    """Updates a Deployment to scale to a certain amount of replicas.

    Does not wait for the cluster state to update to the desired state.

    Args:
        name: Name of the Deployment.
        namespace: Namespace of the Deployment.
        replicas: Desired number of replicas.
    """
    try:
        api = client.AppsV1Api()
        current_scale = api.read_namespaced_deployment_scale(name, namespace)
        current_scale.spec.replicas = replicas
        new_scale = api.patch_namespaced_deployment_scale(name, namespace,
                                                          current_scale)
        log.debug(f"Updated deployment {namespace}/{name} spec to "
                  f"{new_scale.spec.replicas} replicas")
    except ApiException as e:
        sentry_sdk.capture_exception(e)
Updates a Deployment to scale to a certain amount of replicas.

    Does not wait for the cluster state to update to the desired state.

    Args:
        name: Name of the Deployment.
        namespace: Namespace of the Deployment.
        replicas: Desired number of replicas.
    
Updates a Deployment to scale to a certain amount of replicas.
Does not wait for the cluster state to update to the desired state.
Updates a Deployment to scale to a certain amount of replicas . Does not wait for the cluster state to update to the desired state .
def update_deployment_scale(name: str, namespace: str, replicas: int):
    try:
        api = client.AppsV1Api()
        current_scale = api.read_namespaced_deployment_scale(name, namespace)
        current_scale.spec.replicas = replicas
        new_scale = api.patch_namespaced_deployment_scale(name, namespace,
                                                          current_scale)
        log.debug(f"Updated deployment {namespace}/{name} spec to "
                  f"{new_scale.spec.replicas} replicas")
    except ApiException as e:
        sentry_sdk.capture_exception(e)
def update_deployment_scale ( name : str , namespace : str , replicas : int ) : try : api = client . AppsV1Api ( ) current_scale = api . read_namespaced_deployment_scale ( name , namespace ) current_scale . spec . replicas = replicas new_scale = api . patch_namespaced_deployment_scale ( name , namespace , current_scale ) log . debug ( f"Updated deployment {namespace}/{name} spec to " f"{new_scale.spec.replicas} replicas" ) except ApiException as e : sentry_sdk . capture_exception ( e )
Updates a Deployment to scale to a certain amount of replicas.
Updates a Deployment to scale to a certain amount of replicas .
"""Updates a Deployment to scale to a certain amount of replicas.

    Does not wait for the cluster state to update to the desired state.

    Args:
        name: Name of the Deployment.
        namespace: Namespace of the Deployment.
        replicas: Desired number of replicas.
    """
name
str
Name of the Deployment.
Name of the Deployment .
namespace
str
Namespace of the Deployment.
Namespace of the Deployment .
replicas
int
Desired number of replicas.
Desired number of replicas .