Open TomQunChaoA opened 1 year ago
In your code, you can drop the logic here to satisfy your need. An alternative way is to add a featuregate to switch off this function.
I am afraid you have to modify vela's code to match your logic.
I guess I have noticed this effects myself, @TomQunChaoA in my issue #6272. And it is not possible to add pause like here https://github.com/openkruise/rollouts/blob/56d17bcee8b0bd2b444591f556e53e0e9b8804cf/test/e2e/test_data/rollout/rollout_canary_base.yaml, the admission controller don't allow it
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: canary-demo
namespace: default
annotations:
app.oam.dev/publishVersion: v2
spec:
components:
- name: canary-demo
properties:
objects:
- apiVersion: apps/v1
kind: Deployment
metadata:
name: canary-demo
spec:
replicas: 5
selector:
matchLabels:
app: demo
template:
metadata:
labels:
app: demo
spec:
containers:
- image: barnett/canarydemo:v2
name: demo
ports:
- containerPort: 8090
- apiVersion: v1
kind: Service
metadata:
labels:
app: demo
name: canary-demo
namespace: default
spec:
ports:
- name: http
port: 8090
protocol: TCP
targetPort: 8090
selector:
app: demo
- apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
labels:
app: demo
name: canary-demo
namespace: default
spec:
ingressClassName: nginx
rules:
- host: canary-demo.com
http:
paths:
- backend:
service:
name: canary-demo
port:
number: 8090
path: /version
pathType: ImplementationSpecific
type: k8s-objects
traits:
- type: kruise-rollout
properties:
canary:
steps:
# The first batch of Canary releases 20% Pods, and 20% traffic imported to the new version, require manual confirmation before subsequent releases are completed
- weight: 20
pause: {}
# The second batch of Canary releases 90% Pods, and 90% traffic imported to the new version.
- weight: 90
trafficRoutings:
- type: ingress
$ vela up -f canary-demo-v2.yaml
Applying an application in vela K8s object format...
error: cannot update object: admission webhook "validating.core.oam.dev.v1beta1.applications" denied the request: field "schematic": Invalid value error encountered, cannot evaluate trait "kruise-rollout": invalid template of trait kruise-rollout after merge with parameter and context: parameter.canary.steps.0.pause: field not allowed (and 9 more errors).
My own kruise-rollout' implementation integrating with kubevela has several workflow-step definition, including apply rollout object, patch rollout status and remove rollout objects. But I found that the kubevela will patch all managed rollout objects' status, to make them continue to upgrade, which makes my workflow-step definition can't work as expection.
I found the code do this action here https://github.com/kubevela/kubevela/blob/release-1.5/pkg/rollout/rollout.go#L141
Can I strip the function safely? or just comment the code above, Is there some other function depends on this function, or cause some crash of the vela core application