Commit 24b40e3
committed
refactor: use a pointer for field skipAnalysis in CanarySpec
This refactor tries to fulfil a special use case fluxcd#1660: when a custom
controller uses the Flagger API to render the Canary object to
json/yaml, it makes sure the skipAnalysis field is rendered when the
value is "false", so that the field is always communicated to the k8s
API server.
Comparison is as follows:
before, when skipAnalysis is "false" the canary object is rendered as such:
```
apiVersion: flagger.app/v1beta1
kind: Canary
...
spec:
analysis:
...
```
After, it is as such:
```
apiVersion: flagger.app/v1beta1
kind: Canary
...
spec:
skipAnalysis: false # this is the field we expected
analysis:
...
```1 parent 133fdec commit 24b40e3
File tree
3 files changed
+13
-6
lines changed- pkg
- apis/flagger/v1beta1
- controller
3 files changed
+13
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
615 | 615 | | |
616 | 616 | | |
617 | 617 | | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
618 | 622 | | |
619 | 623 | | |
620 | 624 | | |
621 | | - | |
| 625 | + | |
| 626 | + | |
622 | 627 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| |||
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
129 | | - | |
| 130 | + | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| |||
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
151 | | - | |
| 152 | + | |
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
| |||
0 commit comments