Skip to content

Commit

Permalink
Clarify await behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
lblackstone committed Aug 16, 2019
1 parent 2f1e959 commit 0078b45
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 15 deletions.
15 changes: 10 additions & 5 deletions pkg/gen/awaitComments.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,22 @@ const StatefulSetAwaitComment = preamble + `
2. The value of '.status.updateRevision' matches '.status.currentRevision'.`

const PodAwaitComment = preamble + `
1. The Pod is scheduled (PodScheduled condition is true).
2. The Pod is initialized (Initialized condition is true).
3. The Pod is ready (Ready condition is true) and the '.status.phase' is set to "Running".
1. The Pod is scheduled ("PodScheduled"" '.status.condition' is true).
2. The Pod is initialized ("Initialized" '.status.condition' is true).
3. The Pod is ready ("Ready" '.status.condition' is true) and the '.status.phase' is
set to "Running".
Or (for Jobs): The Pod succeeded ('.status.phase' set to "Succeeded").`

const ServiceAwaitComment = preamble + `
1. Service object exists.
2. Related Endpoint objects are created. Each time we get an update, wait ~5-10 seconds
for any stragglers.
3. The endpoints objects target some number of living objects.
4. External IP address is allocated (if Service is type 'LoadBalancer').`
3. The endpoints objects target some number of living objects (unless the Service is
an "empty headless" Service [1] or a Service with '.spec.type: ExternalName').
4. External IP address is allocated (if Service has '.spec.type: LoadBalancer').
[1] https://kubernetes.io/docs/concepts/services-networking/service/#headless-services
`

const IngressAwaitComment = preamble + `
1. Ingress object exists.
Expand Down
7 changes: 4 additions & 3 deletions sdk/nodejs/core/v1/Pod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ import { getVersion } from "../../version";
* create/update and populating output properties from the current state of the resource.
* The following conditions are used to determine whether the resource creation has
* succeeded or failed:
* 1. The Pod is scheduled (PodScheduled condition is true).
* 2. The Pod is initialized (Initialized condition is true).
* 3. The Pod is ready (Ready condition is true) and the '.status.phase' is set to "Running".
* 1. The Pod is scheduled ("PodScheduled"" '.status.condition' is true).
* 2. The Pod is initialized ("Initialized" '.status.condition' is true).
* 3. The Pod is ready ("Ready" '.status.condition' is true) and the '.status.phase' is
* set to "Running".
* Or (for Jobs): The Pod succeeded ('.status.phase' set to "Succeeded").
*/
export class Pod extends pulumi.CustomResource {
Expand Down
8 changes: 6 additions & 2 deletions sdk/nodejs/core/v1/Service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ import { getVersion } from "../../version";
* 1. Service object exists.
* 2. Related Endpoint objects are created. Each time we get an update, wait ~5-10 seconds
* for any stragglers.
* 3. The endpoints objects target some number of living objects.
* 4. External IP address is allocated (if Service is type 'LoadBalancer').
* 3. The endpoints objects target some number of living objects (unless the Service is
* an "empty headless" Service [1] or a Service with '.spec.type: ExternalName').
* 4. External IP address is allocated (if Service has '.spec.type: LoadBalancer').
*
* [1] https://kubernetes.io/docs/concepts/services-networking/service/#headless-services
*
*/
export class Service extends pulumi.CustomResource {
/**
Expand Down
7 changes: 4 additions & 3 deletions sdk/python/pulumi_kubernetes/core/v1/Pod.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ class Pod(pulumi.CustomResource):
create/update and populating output properties from the current state of the resource.
The following conditions are used to determine whether the resource creation has
succeeded or failed:
1. The Pod is scheduled (PodScheduled condition is true).
2. The Pod is initialized (Initialized condition is true).
3. The Pod is ready (Ready condition is true) and the '.status.phase' is set to "Running".
1. The Pod is scheduled ("PodScheduled"" '.status.condition' is true).
2. The Pod is initialized ("Initialized" '.status.condition' is true).
3. The Pod is ready ("Ready" '.status.condition' is true) and the '.status.phase' is
set to "Running".
Or (for Jobs): The Pod succeeded ('.status.phase' set to "Succeeded").
"""

Expand Down
8 changes: 6 additions & 2 deletions sdk/python/pulumi_kubernetes/core/v1/Service.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ class Service(pulumi.CustomResource):
1. Service object exists.
2. Related Endpoint objects are created. Each time we get an update, wait ~5-10 seconds
for any stragglers.
3. The endpoints objects target some number of living objects.
4. External IP address is allocated (if Service is type 'LoadBalancer').
3. The endpoints objects target some number of living objects (unless the Service is
an "empty headless" Service [1] or a Service with '.spec.type: ExternalName').
4. External IP address is allocated (if Service has '.spec.type: LoadBalancer').
[1] https://kubernetes.io/docs/concepts/services-networking/service/#headless-services
"""

def __init__(self, resource_name, opts=None, metadata=None, spec=None, status=None, __name__=None, __opts__=None):
Expand Down

0 comments on commit 0078b45

Please sign in to comment.