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

bugfix: update binding status when work's applied condition status changed #1513

Merged
merged 1 commit into from Mar 23, 2022

Conversation

mrlihanbo
Copy link

@mrlihanbo mrlihanbo commented Mar 22, 2022

Signed-off-by: lihanbo lihanbo2@huawei.com

What type of PR is this?
/kind bug

What this PR does / why we need it:
When execution controller update resource failed, the work's fully applied condition will be set to False, but the ManifestStatuses won't be changed(as updated failed). Under this circumstance,binding controller also need to aggregate work status.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

`karmada-controller-manager`: Fixed RB/CRB controller can't aggregate status in case of work condition update issue.

…tus changed

Signed-off-by: lihanbo <lihanbo2@huawei.com>
@karmada-bot karmada-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. labels Mar 22, 2022
@karmada-bot karmada-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 22, 2022
@mrlihanbo
Copy link
Author

To reproduce:
step1. create a nodeport service using 30000 nodePort in member1 cluster:

apiVersion: v1
kind: Service
metadata:
  name: my-service-member1
spec:
  type: NodePort
  selector:
    app: MyApp
  ports:
    - port: 80
      targetPort: 80
      nodePort: 30000

step2: create a nodeport service using 30001 nodePort in karmada

apiVersion: v1
kind: Service
metadata:
  name: my-service-karmada
spec:
  type: NodePort
  selector:
    app: MyApp
  ports:
    - port: 80
      targetPort: 80
      nodePort: 30001

step3: create propagation policy:

apiVersion: policy.karmada.io/v1alpha1
kind: PropagationPolicy
metadata:
  name: my-service
spec:
  resourceSelectors:
    - apiVersion: v1
      kind: Service
      name: my-service
  placement:
    clusterAffinity:
      clusterNames:
        - member1
        - member2

step4: update nodePort of karmada service to 30000. Then you will found the work is propagated faied, but status in resource binding is not correct.
work status:

status:
  conditions:
  - lastTransitionTime: "2022-03-22T01:16:31Z"
    message: 'Failed to apply all manifests (0/1): Service "my-service" is invalid:
      spec.ports[0].nodePort: Invalid value: 30000: provided port is already allocated'
    reason: AppliedFailed
    status: "False"
    type: Applied
  manifestStatuses:
  - identifier:
      kind: Service
      name: my-service
      namespace: default
      ordinal: 0
      resource: ""
      version: v1
    status:
      loadBalancer: {}

binding status:

status:
  aggregatedStatus:
  - applied: true
    clusterName: member2
    status:
      loadBalancer: {}
  - applied: true
    clusterName: member1
    status:
      loadBalancer: {}
  conditions:
  - lastTransitionTime: "2022-03-22T01:18:23Z"
    message: All works have been successfully applied
    reason: FullyAppliedSuccess
    status: "True"
    type: FullyApplied
  - lastTransitionTime: "2022-03-22T01:18:23Z"
    message: Binding has been scheduled
    reason: BindingScheduled
    status: "True"
    type: Scheduled

@mrlihanbo
Copy link
Author

/cc @XiShanYongYe-Chang

Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

/cc @RainbowMango

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 22, 2022
@Garrybest
Copy link
Member

/lgtm

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@mrlihanbo
Please help cherry-pick this patch to both release-1.0 and release-1.1.

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 23, 2022
@karmada-bot karmada-bot merged commit 3a5d6d1 into karmada-io:master Mar 23, 2022
karmada-bot added a commit that referenced this pull request Mar 23, 2022
…3-upstream-release-1.1

Automated cherry pick of #1513: bugfix: aggregate status to binding when work's applied condition status changed
karmada-bot added a commit that referenced this pull request Mar 23, 2022
…3-upstream-release-1.0

Automated cherry pick of #1513: bugfix: aggregate status to binding when work's applied condition status changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants