|
1 | 1 | # test case for aggregating status of Bucket |
2 | 2 | # case1. Bucket with two status items |
| 3 | +# case2. Bucket with no status items |
| 4 | +# case3. Bucket with stale member |
| 5 | +# case4. Bucket condition merging with different reasons |
| 6 | +# case5. Bucket ignores empty url |
| 7 | +# case6. Bucket with different artifacts picks last one |
3 | 8 |
|
4 | 9 | name: "Bucket with two status items" |
5 | 10 | description: "Test aggregating status of Bucket with two status items" |
@@ -78,3 +83,203 @@ statusItems: |
78 | 83 | resourceTemplateGeneration: 1 |
79 | 84 | operation: AggregateStatus |
80 | 85 | output: |
| 86 | + aggregatedStatus: |
| 87 | + apiVersion: source.toolkit.fluxcd.io/v1beta2 |
| 88 | + kind: Bucket |
| 89 | + metadata: |
| 90 | + name: sample |
| 91 | + namespace: test-bucket |
| 92 | + generation: 1 |
| 93 | + spec: |
| 94 | + provider: generic |
| 95 | + interval: 5m0s |
| 96 | + bucketName: podinfo |
| 97 | + endpoint: minio.minio.svc.cluster.local:9000 |
| 98 | + timeout: 60s |
| 99 | + insecure: true |
| 100 | + secretRef: |
| 101 | + name: fake-minio-credentials |
| 102 | + status: |
| 103 | + conditions: |
| 104 | + - type: Reconciling |
| 105 | + status: "True" |
| 106 | + reason: ProgressingWithRetry |
| 107 | + message: "member1=building artifact, member3=building artifact" |
| 108 | + observedGeneration: 1 |
| 109 | + lastTransitionTime: "2023-04-29T14:02:31Z" |
| 110 | + - type: Ready |
| 111 | + status: "False" |
| 112 | + reason: AuthenticationFailed |
| 113 | + message: "member1=invalid 'fake-secret' secret data: required fields 'accesskey' and 'secretkey', member3=invalid 'fake-secret' secret data: required fields 'accesskey' and 'secretkey'" |
| 114 | + observedGeneration: 1 |
| 115 | + lastTransitionTime: "2023-04-29T14:02:31Z" |
| 116 | + - type: FetchFailed |
| 117 | + status: "True" |
| 118 | + reason: AuthenticationFailed |
| 119 | + message: "member1=invalid 'fake-secret' secret data: required fields 'accesskey' and 'secretkey', member3=invalid 'fake-secret' secret data: required fields 'accesskey' and 'secretkey'" |
| 120 | + observedGeneration: 1 |
| 121 | + lastTransitionTime: "2023-04-29T14:01:44Z" |
| 122 | + observedGeneration: 0 |
| 123 | + url: "" |
| 124 | +--- |
| 125 | +name: "Bucket with no status items" |
| 126 | +description: "AggregateStatus initializes empty status when no members exist" |
| 127 | +desiredObj: |
| 128 | + apiVersion: source.toolkit.fluxcd.io/v1beta2 |
| 129 | + kind: Bucket |
| 130 | + metadata: |
| 131 | + name: sample |
| 132 | + namespace: test-bucket |
| 133 | + generation: 3 |
| 134 | +operation: AggregateStatus |
| 135 | +output: |
| 136 | + aggregatedStatus: |
| 137 | + apiVersion: source.toolkit.fluxcd.io/v1beta2 |
| 138 | + kind: Bucket |
| 139 | + metadata: |
| 140 | + name: sample |
| 141 | + namespace: test-bucket |
| 142 | + generation: 3 |
| 143 | + status: |
| 144 | + url: "" |
| 145 | + observedGeneration: 3 |
| 146 | +--- |
| 147 | +name: "Bucket with stale member" |
| 148 | +description: "observedGeneration should not advance if any member is stale" |
| 149 | +desiredObj: |
| 150 | + apiVersion: source.toolkit.fluxcd.io/v1beta2 |
| 151 | + kind: Bucket |
| 152 | + metadata: |
| 153 | + name: sample |
| 154 | + namespace: test-bucket |
| 155 | + generation: 5 |
| 156 | + status: |
| 157 | + observedGeneration: 4 |
| 158 | +statusItems: |
| 159 | + - status: |
| 160 | + generation: 5 |
| 161 | + observedGeneration: 5 |
| 162 | + resourceTemplateGeneration: 5 |
| 163 | + - status: |
| 164 | + generation: 5 |
| 165 | + observedGeneration: 4 |
| 166 | + resourceTemplateGeneration: 5 |
| 167 | +operation: AggregateStatus |
| 168 | +output: |
| 169 | + aggregatedStatus: |
| 170 | + apiVersion: source.toolkit.fluxcd.io/v1beta2 |
| 171 | + kind: Bucket |
| 172 | + metadata: |
| 173 | + name: sample |
| 174 | + namespace: test-bucket |
| 175 | + generation: 5 |
| 176 | + status: |
| 177 | + observedGeneration: 4 |
| 178 | + url: "" |
| 179 | +--- |
| 180 | +name: "Bucket condition merging with different reasons" |
| 181 | +description: "Conditions with same type but different reasons are not merged" |
| 182 | +desiredObj: |
| 183 | + apiVersion: source.toolkit.fluxcd.io/v1beta2 |
| 184 | + kind: Bucket |
| 185 | + metadata: |
| 186 | + name: sample |
| 187 | + namespace: test-bucket |
| 188 | +statusItems: |
| 189 | + - clusterName: member1 |
| 190 | + status: |
| 191 | + conditions: |
| 192 | + - type: Ready |
| 193 | + status: "True" |
| 194 | + reason: Succeeded |
| 195 | + message: ok |
| 196 | + - clusterName: member2 |
| 197 | + status: |
| 198 | + conditions: |
| 199 | + - type: Ready |
| 200 | + status: "False" |
| 201 | + reason: Failed |
| 202 | + message: error |
| 203 | +operation: AggregateStatus |
| 204 | +output: |
| 205 | + aggregatedStatus: |
| 206 | + apiVersion: source.toolkit.fluxcd.io/v1beta2 |
| 207 | + kind: Bucket |
| 208 | + metadata: |
| 209 | + name: sample |
| 210 | + namespace: test-bucket |
| 211 | + generation: 0 |
| 212 | + status: |
| 213 | + conditions: |
| 214 | + - type: Ready |
| 215 | + status: "True" |
| 216 | + reason: Succeeded |
| 217 | + message: member1=ok |
| 218 | + - type: Ready |
| 219 | + status: "False" |
| 220 | + reason: Failed |
| 221 | + message: member2=error |
| 222 | + observedGeneration: 0 |
| 223 | + url: "" |
| 224 | +--- |
| 225 | +name: "Bucket ignores empty url" |
| 226 | +description: "Empty url fields are ignored during aggregation" |
| 227 | +desiredObj: |
| 228 | + apiVersion: source.toolkit.fluxcd.io/v1beta2 |
| 229 | + kind: Bucket |
| 230 | + metadata: |
| 231 | + name: sample |
| 232 | + namespace: test-bucket |
| 233 | +statusItems: |
| 234 | + - status: |
| 235 | + url: "" |
| 236 | + - status: |
| 237 | + url: http://bucket/valid |
| 238 | +operation: AggregateStatus |
| 239 | +output: |
| 240 | + aggregatedStatus: |
| 241 | + apiVersion: source.toolkit.fluxcd.io/v1beta2 |
| 242 | + kind: Bucket |
| 243 | + metadata: |
| 244 | + name: sample |
| 245 | + namespace: test-bucket |
| 246 | + generation: 0 |
| 247 | + status: |
| 248 | + observedGeneration: 0 |
| 249 | + url: http://bucket/valid |
| 250 | +--- |
| 251 | +name: "Bucket with different artifacts picks last one" |
| 252 | +description: "AggregateStatus should pick the last artifact when members report different artifacts" |
| 253 | +desiredObj: |
| 254 | + apiVersion: source.toolkit.fluxcd.io/v1beta2 |
| 255 | + kind: Bucket |
| 256 | + metadata: |
| 257 | + name: sample |
| 258 | + namespace: test-bucket |
| 259 | + generation: 1 |
| 260 | +statusItems: |
| 261 | + - clusterName: member1 |
| 262 | + status: |
| 263 | + artifact: |
| 264 | + path: artifact-a.tar.gz |
| 265 | + revision: rev-a |
| 266 | + - clusterName: member2 |
| 267 | + status: |
| 268 | + artifact: |
| 269 | + path: artifact-b.tar.gz |
| 270 | + revision: rev-b |
| 271 | +operation: AggregateStatus |
| 272 | +output: |
| 273 | + aggregatedStatus: |
| 274 | + apiVersion: source.toolkit.fluxcd.io/v1beta2 |
| 275 | + kind: Bucket |
| 276 | + metadata: |
| 277 | + name: sample |
| 278 | + namespace: test-bucket |
| 279 | + generation: 1 |
| 280 | + status: |
| 281 | + artifact: |
| 282 | + path: artifact-b.tar.gz |
| 283 | + revision: rev-b |
| 284 | + observedGeneration: 0 |
| 285 | + url: "" |
0 commit comments