Unverified Commit 010ac081 authored by OpenShift Merge Robot's avatar OpenShift Merge Robot Committed by GitHub
Browse files

Merge pull request #620 from sgreene570/bz-1954892-ingress-canary-priority-class

Bug 1954892: canary: Add priority class to canary daemonset 
parents 455fbd0e 0fb9e908
......@@ -10,6 +10,7 @@ spec:
annotations:
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
spec:
priorityClassName: system-cluster-critical
containers:
- name: serve-healthcheck-canary
# Image and command are set at runtime
......
// Code generated by go-bindata. DO NOT EDIT.
// sources:
// assets/canary/daemonset.yaml (1.155kB)
// assets/canary/daemonset.yaml (1.204kB)
// assets/canary/namespace.yaml (212B)
// assets/canary/route.yaml (456B)
// assets/canary/service.yaml (331B)
......@@ -102,7 +102,7 @@ func (fi bindataFileInfo) Sys() interface{} {
return nil
}
var _assetsCanaryDaemonsetYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x53\x4d\x6f\xdb\x46\x10\xbd\xf3\x57\x0c\x2c\x14\x69\x81\x4a\x51\x7a\x28\x84\xbd\xc6\x29\x6a\xa0\x71\x84\xca\xe9\x7d\xbc\x7c\x12\x17\x5a\xce\x6c\x67\x87\xb6\x85\xa2\xff\xbd\x20\x2d\x39\x8c\x11\x14\xe1\x85\xe4\xec\x7b\x6f\xbe\xde\x2e\xe8\x77\xe4\xac\xf4\xa9\x40\x6a\x97\xf6\x4e\x37\x72\x30\xd4\x4a\xef\x59\xd8\x4e\xd4\x32\x7a\x95\x0a\x6f\x16\xb4\x2b\x88\x69\x9f\x22\x3d\x70\x1e\x50\x89\x0d\x54\xe1\xc4\x4e\x36\x88\xa7\x1e\xcd\x31\x49\x1b\xe8\x7a\x22\xed\xe0\x0d\x97\xf4\x17\xac\x26\x95\x40\x5c\x4a\x7d\xfb\xf0\xae\x59\x90\x70\x0f\x62\x69\xa7\x8f\x5a\x38\xe2\x1b\x5a\xab\xa6\x16\xc4\xd0\x10\x15\xd3\xa9\xa6\x6b\x70\x9b\x93\x60\x87\xa8\xd2\xd6\x40\xbf\xae\xd7\x0d\x91\xa3\x2f\x99\x1d\x23\x94\xa8\x87\x73\xcb\xce\xcf\x7f\x44\x2c\xa2\xce\x9e\x54\xea\x25\x44\xe4\x6c\x07\xf8\xea\x51\xed\x98\x95\xdb\x95\x5e\xda\x5f\x25\x7d\xdb\xb3\xf0\x01\x3d\xc4\x03\xbd\xf9\xe7\x0a\xfb\x3d\xa2\x5f\x05\xba\xda\x1a\xf6\x30\x43\x7b\x3d\x58\x92\xc3\x2e\x76\x68\x87\x9c\xe4\x70\xf5\xef\x9b\x49\xfa\x52\xf0\xf8\x44\x15\xe7\x24\xb0\x59\xda\xe5\xd4\x70\xa0\x0a\x7b\xc0\xb2\x03\x67\xef\x62\x87\x78\x5c\xc6\x69\xda\x2f\x40\xa2\x05\xdd\xf4\x7c\x78\x9e\x52\xd4\xbe\x1f\xdf\xdf\x98\xf7\x17\x42\x1a\xe1\xdb\x21\xe7\xad\xe6\x14\x4f\x81\x6e\xf6\xb7\xea\x5b\x43\x85\xf8\x0c\xe7\xb0\x3e\xc9\x34\x90\x8f\xa8\x75\x24\x9d\x09\xbf\x71\xce\xf7\x1c\x8f\x77\xfa\x87\x1e\xea\x27\xf9\x60\xa6\x36\x63\x16\x35\x9f\x35\x33\xb6\xf3\xd2\xe4\x56\xcd\x03\x6d\xd6\x9b\xf5\xec\x7c\xda\x9c\x6b\xd4\x1c\xe8\xee\xfd\xf6\x7f\x99\x9b\xcd\xe6\xbb\x98\x86\xaa\x83\x45\x7c\x55\xc8\x18\xfe\x7b\x40\xf5\x57\x51\xa2\x58\x86\x40\xef\xd6\xfd\xab\x70\x8f\x5e\xed\x14\xe8\x97\xf5\xc7\x74\x3e\x12\x6d\xb1\x43\x46\x74\xb5\x2f\x2a\xc7\xe1\x1e\x26\x70\xd4\xd1\x19\x5a\x03\xe5\x24\xc3\xd3\xf9\xdc\x35\xc3\x5e\x7b\x6b\x49\xcf\x8e\x09\x74\xab\x67\x8b\xcc\xf7\x74\xc4\x29\x4c\xc9\x96\xa6\x19\xab\xaf\x13\x24\xd9\x1b\xcf\xc0\x5a\x46\x7d\xb5\x40\x1f\x9e\x52\xf5\xda\x10\x0d\xa5\x65\xc7\xce\x8d\x1d\x87\xd3\x73\x5a\x3f\x15\x04\xfa\x53\xf3\x68\xc6\xcf\x13\x60\x8a\xdb\x3c\x72\xa9\x70\x41\xb7\xea\x08\x74\xd7\xe1\x7c\xbb\xa7\x65\x8c\x58\x18\x99\x0e\xd2\x56\xf2\x0e\x54\x60\x11\xe2\xa3\x0b\x87\xf2\x42\xfe\x71\x90\x9c\x8e\x98\x10\x2d\x4a\xd6\xd3\x78\x53\x66\x12\x3f\xd3\x63\x97\x62\x77\x51\x6a\xf5\x51\x7e\x5a\x9d\xe9\x3d\x3f\x7d\x16\x7e\xe0\x94\xf9\x3e\x63\xdc\xcc\x0f\xcd\x7f\x01\x00\x00\xff\xff\xb3\xea\xf3\x05\x83\x04\x00\x00")
var _assetsCanaryDaemonsetYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x54\xd1\x6e\xe3\x36\x10\x7c\xd7\x57\x2c\x62\x14\xd7\x02\xb5\xcf\xd7\x87\xc2\xe0\x6b\x72\x45\x03\xf4\x72\x46\x9d\xeb\xfb\x86\x1a\x5b\x84\x49\x2e\xbb\x5c\x25\x11\x8a\xfe\x7b\x21\xd9\xce\xe9\x82\xa0\x38\xbd\x48\x5a\xce\x0c\x77\x39\x23\x2d\xe8\x77\xc4\x28\xf4\xb9\x20\xd7\x2e\xec\x8d\x6e\xf3\x41\x51\x2b\x5d\x73\x66\x1d\xa8\x65\x24\xc9\x15\xd6\x2c\x68\x57\xe0\xc3\x3e\x78\x7a\xe4\xd8\xa3\x12\x2b\xa8\xc2\x88\x8d\xb4\xcf\x16\x12\x9a\x63\xc8\xad\xa3\x9b\x89\xb4\x83\x35\x5c\xc2\x5f\xd0\x1a\x24\x3b\xe2\x52\xea\xfb\xc7\x0f\xcd\x82\x32\x27\x10\xe7\x76\x7a\xa8\x85\x3d\xde\xd0\x5a\x35\xb5\xc0\xbb\x86\xa8\xa8\x4c\x3d\xdd\x80\xdb\x18\x32\x76\xf0\x92\xdb\xea\xe8\xd7\xf5\xba\x21\x32\xa4\x12\xd9\x30\x42\x89\x12\x8c\x5b\x36\x3e\xbd\x11\x71\xce\x62\x6c\x41\x72\xbd\x94\x88\x8c\xf5\x00\x5b\x3d\x89\x1e\xa3\x70\xbb\x92\xcb\xf8\xab\x20\xef\x13\x67\x3e\x20\x21\x9b\xa3\x77\xff\x5c\x61\xbf\x87\xb7\x2b\x47\x57\x5b\xc5\x1e\xaa\x68\x6f\x7a\x0d\xf9\xb0\xf3\x1d\xda\x3e\x86\x7c\xb8\xfa\xf7\xdd\x24\x7d\x69\x78\xbc\x8a\x06\xd1\x60\xc3\x75\xe4\x5a\xef\x38\xc1\x51\x1d\xaa\x21\x2d\x7d\xec\xab\x41\x97\x5e\x83\x05\xcf\xf1\x4c\xf0\x92\x8d\x43\x86\xce\xfa\x5c\x4e\x27\xe4\xa8\x42\x1f\xb1\xec\xc0\xd1\x3a\xdf\xc1\x1f\x97\x7e\xb2\xe7\x05\x48\xb4\xa0\xdb\xc4\x87\xd3\xb1\x7a\x49\x69\xbc\xbf\x61\xd0\x57\x42\x18\xe1\xdb\x3e\xc6\xad\xc4\xe0\x07\x47\xb7\xfb\x3b\xb1\xad\xa2\x22\xdb\x0c\x67\xd0\x14\xf2\x74\x82\x9f\x50\xeb\x48\x3a\x13\x7e\xe3\x18\x1f\xd8\x1f\xef\xe5\x0f\x39\xd4\xcf\xf9\xa3\xaa\xe8\x8c\x59\x44\x6d\x36\xcc\x38\xce\xcb\x90\x5b\x51\x73\xb4\x59\x6f\xd6\xb3\xf5\xc9\x6a\x13\x2f\xd1\xd1\xfd\xf5\xf6\x7f\x99\x9b\xcd\xe6\xbb\x98\x8a\x2a\xbd\x7a\x7c\xd3\xc8\x58\xfe\xbb\x47\xb5\x57\x55\x22\x5f\x7a\x47\x1f\xd6\xe9\x55\x39\x21\x89\x0e\x8e\x7e\x59\x7f\x0a\xe7\xa5\x2c\x2d\x76\x88\xf0\x26\xfa\x55\xe5\xd8\x3f\x40\x33\x0c\x75\x8c\x92\x54\x47\x31\xe4\xfe\xf9\xbc\x6e\x12\xa1\xaf\xc3\xb8\xa4\x53\xc4\x1c\xdd\xc9\x39\x53\x73\x9f\x8e\x18\xdc\xb4\xd9\x52\x25\x62\xf5\xed\x06\x21\xef\x95\x67\x60\x29\xa3\xbe\xa8\xa3\x8f\xcf\xa1\x5a\x6d\x88\xfa\xd2\xb2\x61\x67\xca\x86\xc3\x70\xda\xd6\x86\x02\x47\x7f\x4a\x1c\xd3\xfb\x65\x02\x4c\x75\x9d\x57\x2e\x1d\x2e\xe8\x4e\x0c\x8e\xee\x3b\x9c\x7f\x07\x93\x19\x23\x16\x4a\x2a\x7d\x6e\x2b\x59\x07\x2a\x50\x8f\x6c\x63\x0a\xfb\xf2\x42\xfe\xb1\xcf\x31\x1c\x31\x21\x5a\x94\x28\xc3\xf8\x69\xcd\x24\x7e\xa6\xa7\x2e\xf8\xee\xa2\xd4\xca\x53\xfe\x69\x75\xa6\x27\x7e\xfe\x92\xf9\x91\x43\xe4\x87\x88\xd1\x99\x1f\x9a\xff\x02\x00\x00\xff\xff\x7f\x06\xab\x60\xb4\x04\x00\x00")
func assetsCanaryDaemonsetYamlBytes() ([]byte, error) {
return bindataRead(
......@@ -117,8 +117,8 @@ func assetsCanaryDaemonsetYaml() (*asset, error) {
return nil, err
}
info := bindataFileInfo{name: "assets/canary/daemonset.yaml", size: 1155, mode: os.FileMode(420), modTime: time.Unix(1, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd2, 0x34, 0xc7, 0xbb, 0x1d, 0xd2, 0x60, 0x9b, 0x8b, 0x21, 0xd2, 0xa5, 0x42, 0x21, 0xbe, 0x4e, 0x49, 0x98, 0x30, 0x61, 0x8f, 0x72, 0x2, 0x53, 0x11, 0x11, 0x12, 0xf5, 0x46, 0x4b, 0x3c, 0xac}}
info := bindataFileInfo{name: "assets/canary/daemonset.yaml", size: 1204, mode: os.FileMode(420), modTime: time.Unix(1, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6f, 0x50, 0x50, 0x70, 0xab, 0xbf, 0x75, 0xeb, 0xc6, 0x46, 0xbf, 0xbe, 0x7a, 0x12, 0xf6, 0x47, 0x1, 0xa8, 0xed, 0x8b, 0x6c, 0x4f, 0xe2, 0x9f, 0xe2, 0x7f, 0x47, 0x7b, 0x5a, 0xc4, 0x7b, 0x18}}
return a, nil
}
......
......@@ -131,6 +131,11 @@ func canaryDaemonSetChanged(current, expected *appsv1.DaemonSet) (bool, *appsv1.
changed = true
}
if current.Spec.Template.Spec.PriorityClassName != expected.Spec.Template.Spec.PriorityClassName {
updated.Spec.Template.Spec.PriorityClassName = expected.Spec.Template.Spec.PriorityClassName
changed = true
}
if !changed {
return false, nil
}
......
......@@ -65,7 +65,12 @@ func TestDesiredCanaryDaemonSet(t *testing.T) {
}
if !cmp.Equal(nodeSelector, expectedNodeSelector) {
t.Errorf("expected daemonset node selector to be %q, but got %q", expectedNodeSelector, nodeSelector)
}
priorityClass := daemonset.Spec.Template.Spec.PriorityClassName
expectedPriorityClass := "system-cluster-critical"
if !cmp.Equal(priorityClass, expectedPriorityClass) {
t.Errorf("expected daemonset priority class to be %q, but got %q", expectedPriorityClass, priorityClass)
}
tolerations := daemonset.Spec.Template.Spec.Tolerations
......@@ -144,6 +149,13 @@ func TestCanaryDaemonsetChanged(t *testing.T) {
},
expect: true,
},
{
description: "if canary daemonset priority class changed",
mutate: func(ds *appsv1.DaemonSet) {
ds.Spec.Template.Spec.PriorityClassName = "my-priority-class"
},
expect: true,
},
}
for _, tc := range testCases {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment