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

rollout support patchPodTemplateMetadata #157

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

zmberg
Copy link
Member

@zmberg zmberg commented Jul 4, 2023

Ⅰ. Describe what this PR does

Rollout add patchPodTemplateMetadata field.

Rollout will add labels[alicloud.service.tag]=gray in workload.spec.template, then the microservices governance solutions MSE and Isito can identify which pod is base version and which is grey version.

apiVersion: rollouts.kruise.io/v1alpha1
kind: Rollout
metadata:
  name: rollout-b
  annotations:
    rollouts.kruise.io/trafficrouting: mse-traffic
spec:
  objectRef:
    ...
  strategy:
    canary:
      steps:
      - pause: {}
        replicas: 1
      patchPodTemplateMetadata:
        labels:
          alicloud.service.tag: gray

@kruise-bot kruise-bot requested review from FillZpp and veophi July 4, 2023 07:41
@codecov-commenter
Copy link

codecov-commenter commented Jul 4, 2023

Codecov Report

Merging #157 (0b6156b) into master (7139171) will decrease coverage by 0.03%.
The diff coverage is 42.85%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master     #157      +/-   ##
==========================================
- Coverage   43.67%   43.65%   -0.03%     
==========================================
  Files          50       50              
  Lines        5259     5278      +19     
==========================================
+ Hits         2297     2304       +7     
- Misses       2575     2585      +10     
- Partials      387      389       +2     
Flag Coverage Δ
unittests 43.65% <42.85%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...chrelease/control/canarystyle/deployment/canary.go 53.93% <20.00%> (-7.41%) ⬇️
...hrelease/control/canarystyle/deployment/control.go 74.35% <100.00%> (ø)
pkg/controller/rollout/rollout_canary.go 42.95% <100.00%> (+0.20%) ⬆️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@zmberg zmberg force-pushed the patchPodTemplateMetadata branch 2 times, most recently from 6815f25 to 0b6156b Compare July 4, 2023 12:39
delete(dTemplate.Annotations, k)
}
}
if util.EqualIgnoreHash(dTemplate, &dClone.Spec.Template) {
Copy link
Member

Choose a reason for hiding this comment

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

dClone is deepcopy twice here, can we make a modified EqualIgnoreHash func e.g. EqualIgnoreMetadata(template1, template2 *v1.PodTemplateSpec, labels []string, annotations []string)

@@ -50,6 +50,10 @@ type ReleasePlan struct {
// FinalizingPolicy define the behavior of controller when phase enter Finalizing
// Defaults to "Immediate"
FinalizingPolicy FinalizingPolicyType `json:"finalizingPolicy,omitempty"`
// PatchPodTemplateMetadata indicates patch configuration(e.g. labels, annotations) to the canary deployment podTemplateSpec.metadata
// only support for canary deployment
Copy link
Member

Choose a reason for hiding this comment

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

is support for cloneset possible?

Copy link
Member Author

Choose a reason for hiding this comment

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

This still depends on the scenario, there is no canary workload for cloneSet, so it may be necessary to look at the scenario later

@zmberg zmberg force-pushed the patchPodTemplateMetadata branch from 0b6156b to 746c2c0 Compare July 5, 2023 11:15
@zmberg zmberg force-pushed the patchPodTemplateMetadata branch from 746c2c0 to 8b4aa86 Compare July 7, 2023 01:55
@furykerry
Copy link
Member

/lgtm

@furykerry
Copy link
Member

/approve

@kruise-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: furykerry

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

@kruise-bot kruise-bot merged commit bc014ea into openkruise:master Jul 10, 2023
@zmberg zmberg deleted the patchPodTemplateMetadata branch July 10, 2023 07:46
Kuromesi pushed a commit to Kuromesi/rollouts that referenced this pull request Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants