Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use sequential numbering for naming the Update object #710

Closed
EronWright opened this issue Oct 7, 2024 · 2 comments
Closed

Use sequential numbering for naming the Update object #710

EronWright opened this issue Oct 7, 2024 · 2 comments
Assignees
Labels
kind/enhancement Improvements or new features resolution/fixed This issue was fixed

Comments

@EronWright
Copy link
Contributor

EronWright commented Oct 7, 2024

Either use the stack history to anticipate the next update #, or simply use the current timestamp.

For example, in Go Playground:

fmt.Printf("random-yaml-%x\n", time.Now().UnixMilli())

random-yaml-124e0533580  
@EronWright EronWright self-assigned this Oct 7, 2024
@EronWright EronWright converted this from a draft issue Oct 7, 2024
@cleverguy25
Copy link

Added to epic #586

@pulumi-bot pulumi-bot added the needs-triage Needs attention from the triage team label Oct 7, 2024
@rquitales rquitales added kind/enhancement Improvements or new features and removed needs-triage Needs attention from the triage team labels Oct 7, 2024
@EronWright
Copy link
Contributor Author

For comparison, here's the logic for naming of cronjob pods:
https://github.com/kubernetes/kubernetes/blob/b7d1766c186f9bf9b104716b0f744223d9523dd8/pkg/controller/cronjob/utils.go#L276

Which resembles:

hello-28819970-mgh5n      0/1     Terminating         0          3m3s
hello-28819970-mgh5n      0/1     Terminating         0          3m3s
hello-28819974-qdccd      0/1     Pending             0          0s
hello-28819974-qdccd      0/1     Pending             0          0s
hello-28819974-qdccd      0/1     ContainerCreating   0          0s
hello-28819974-qdccd      0/1     Completed           0          1s
hello-28819974-qdccd      0/1     Completed           0          2s
hello-28819974-qdccd      0/1     Completed           0          3s
hello-28819974-qdccd      0/1     Completed           0          3s
hello-28819971-9kr4l      0/1     Terminating         0          3m3s
hello-28819971-9kr4l      0/1     Terminating         0          3m3s
hello-28819975-9plkj      0/1     Pending             0          0s
hello-28819975-9plkj      0/1     Pending             0          0s
hello-28819975-9plkj      0/1     ContainerCreating   0          0s
hello-28819975-9plkj      0/1     Completed           0          1s
hello-28819975-9plkj      0/1     Completed           0          2s

EronWright added a commit that referenced this issue Oct 17, 2024
<!--Thanks for your contribution. See [CONTRIBUTING](CONTRIBUTING.md)
    for Pulumi's contribution guidelines.

    Help us merge your changes more quickly by adding more details such
    as labels, milestones, and reviewers.-->

### Proposed changes

<!--Give us a brief description of what you've done and what it solves.
-->

Use a sequential numbering strategy for the stack update objects.

Before:
```
NAME                   WORKSPACE     PROGRESSING   FAILED   COMPLETE   URL
random-yaml-tf9hxngl   random-yaml                                     
random-yaml-tf9hxngl   random-yaml   True          False    False      
random-yaml-tf9hxngl   random-yaml   False         False    True       https://app.pulumi.com/eron-pulumi-corp/random/dev/updates/4814
random-yaml-vqzmzxtr   random-yaml                                     
random-yaml-vqzmzxtr   random-yaml   True          False    False      
random-yaml-vqzmzxtr   random-yaml   False         False    True       https://app.pulumi.com/eron-pulumi-corp/random/dev/updates/4815
random-yaml-m4wm7dzt   random-yaml                                     
random-yaml-m4wm7dzt   random-yaml   True          False    False      
random-yaml-m4wm7dzt   random-yaml   False         False    True       https://app.pulumi.com/eron-pulumi-corp/random/dev/updates/4816
```

After:
```
NAME                      WORKSPACE     PROGRESSING   FAILED   COMPLETE   URL
random-yaml-1929cadf4a8   random-yaml                                     
random-yaml-1929cadf4a8   random-yaml   True          False    False      
random-yaml-1929cadf4a8   random-yaml   False         False    True       https://app.pulumi.com/eron-pulumi-corp/random/dev/updates/4828
random-yaml-1929caf016f   random-yaml                                     
random-yaml-1929caf016f   random-yaml   True          False    False      
random-yaml-1929caf016f   random-yaml   False         False    True       https://app.pulumi.com/eron-pulumi-corp/random/dev/updates/4829
random-yaml-1929cb00a8f   random-yaml                                     
random-yaml-1929cb00a8f   random-yaml   True          False    False      
random-yaml-1929cb00a8f   random-yaml   False         False    True       https://app.pulumi.com/eron-pulumi-corp/random/dev/updates/4830

```

When you list the completed updates, they're now in order:
```
❯ kubectl get update
NAME                      WORKSPACE     PROGRESSING   FAILED   COMPLETE   URL
random-yaml-1929cadf4a8   random-yaml   False         False    True       https://app.pulumi.com/eron-pulumi-corp/random/dev/updates/4828
random-yaml-1929caf016f   random-yaml   False         False    True       https://app.pulumi.com/eron-pulumi-corp/random/dev/updates/4829
random-yaml-1929cb00a8f   random-yaml   False         False    True       https://app.pulumi.com/eron-pulumi-corp/random/dev/updates/4830
random-yaml-1929cb11670   random-yaml   False         False    True       https://app.pulumi.com/eron-pulumi-corp/random/dev/updates/4831
random-yaml-1929cb22165   random-yaml   False         False    True       https://app.pulumi.com/eron-pulumi-corp/random/dev/updates/4832
random-yaml-1929cb32d64   random-yaml   False         False    True       https://app.pulumi.com/eron-pulumi-corp/random/dev/updates/4833
random-yaml-1929cb43738   random-yaml   False         False    True       https://app.pulumi.com/eron-pulumi-corp/random/dev/updates/4834
random-yaml-1929cb540cb   random-yaml   False         False    True       https://app.pulumi.com/eron-pulumi-corp/random/dev/updates/4835

```
### Related issues (optional)

<!--Refer to related PRs or issues: #1234, or 'Fixes #1234' or 'Closes
#1234'.
Or link to full URLs to issues or pull requests in other GitHub
repositories. -->

Closes #710
@EronWright EronWright added the resolution/fixed This issue was fixed label Oct 17, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Pulumi Kubernetes Operator v2 Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features resolution/fixed This issue was fixed
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants