Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

add observedGeneration to represent Component and AppConfig has reconciled #91

Closed
wonderflow opened this issue Jul 9, 2020 · 7 comments · Fixed by #205
Closed

add observedGeneration to represent Component and AppConfig has reconciled #91

wonderflow opened this issue Jul 9, 2020 · 7 comments · Fixed by #205
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@wonderflow
Copy link
Member

wonderflow commented Jul 9, 2020

observedGeneration field of status in K8s object is widely used in K8s built-in resource. It reflects the generation of the most recently observed Object.

With the help of observedGeneration field, user can recognize whether a CR is reconciled by controller.

A workflow will like below:

apiversion: core.oam.dev/v1alpha2
kind: Component
metadata:
  name: c1
  generation: 1
spec:
  workload:
    image: nginx:v1
    ...

After the controller reconciled, the observedGeneration will appear and align with generation in metadata:

apiversion: core.oam.dev/v1alpha2
kind: Component
metadata:
  name: c1
  generation: 1
spec:
  workload:
    image: nginx:v1
    ...
status:
  observedGeneration: 1

Later, we have another change, it will be:

apiversion: core.oam.dev/v1alpha2
kind: Component
metadata:
  name: c1
  generation: 2
spec:
  workload:
    image: nginx:v2
    ...
status:
  observedGeneration: 1

And after reconciled, it will be:

apiversion: core.oam.dev/v1alpha2
kind: Component
metadata:
  name: c1
  generation: 2
spec:
  workload:
    image: nginx:v2
    ...
status:
  observedGeneration: 2

Also, CR of AppConfig also need to add this field.

@wonderflow wonderflow added good first issue Good for newcomers enhancement New feature or request labels Jul 9, 2020
@wonderflow wonderflow changed the title add observedGeneration into status of Component and AppConfig CR add observedGeneration into status of Component and AppConfig Jul 9, 2020
@wonderflow wonderflow changed the title add observedGeneration into status of Component and AppConfig add observedGeneration to represent Component and AppConfig has reconciled successfully Jul 9, 2020
@wonderflow wonderflow changed the title add observedGeneration to represent Component and AppConfig has reconciled successfully add observedGeneration to represent Component and AppConfig has reconciled Jul 9, 2020
@LeoLiuYan
Copy link
Contributor

/assign

@wonderflow
Copy link
Member Author

@LeoLiuYan Thanks

@wonderflow
Copy link
Member Author

This is a kindly ping. Hi @LeoLiuYan, have you started?

@LeoLiuYan
Copy link
Contributor

This is a kindly ping. Hi @LeoLiuYan, have you started?

Oh.. not yet. I will start in this weekend.

@wonderflow
Copy link
Member Author

@LeoLiuYan Hi, are you still interested on this work?

@LeoLiuYan
Copy link
Contributor

LeoLiuYan commented Aug 20, 2020

@LeoLiuYan Hi, are you still interested on this work?

Yes, I will submit a PR as soon as possible.

@LeoLiuYan LeoLiuYan removed their assignment Sep 7, 2020
@Ghostbaby
Copy link
Contributor

/assign @Ghostbaby

Ghostbaby added a commit to Ghostbaby/oam-kubernetes-runtime that referenced this issue Sep 13, 2020
Add observedGeneration to represent Component

Fix crossplane#91

Signed-off-by: zhuhuijun <zhuhuijunzhj@gmail.com>
wonderflow pushed a commit that referenced this issue Sep 28, 2020
* feat(component):Add observedGeneration to represent Component

Add observedGeneration to represent Component

Fix #91

Signed-off-by: zhuhuijun <zhuhuijunzhj@gmail.com>

* feat(component):Add observedGeneration to represent Component

Add observedGeneration to represent Component

Fix #205

Signed-off-by: zhuhuijun <zhuhuijunzhj@gmail.com>

* mv updateObservedGeneration

Signed-off-by: zhuhuijun <zhuhuijunzhj@gmail.com>

* fix check-diff

Signed-off-by: zhuhuijun <zhuhuijunzhj@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants