Description of problem: When using oc 3.7 VS server 3.8, oc annotate fails if: The resource existing annotations have at least one annotation AND the annotation name in command line includes slash. It can succeed given the resource existing annotation is empty. Version-Release number of selected component (if applicable): oc v3.7.14 kubernetes v1.7.6+a08f5eeb62 features: Basic-Auth GSSAPI Kerberos SPNEGO Server https://host-8-245-66.host.centralci.eng.rdu2.redhat.com:8443 openshift v3.8.18 kubernetes v1.8.1+0d5291c How reproducible: always Steps to Reproduce: 1. create pod/svc/route $ oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/routing/caddy-docker.json $ oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/routing/edge/service_unsecure.json $ oc expose svc service-unsecure 2. check the annotation of the route (ensure the route has one annotation) $ oc get route -o yaml apiVersion: v1 items: - apiVersion: v1 kind: Route metadata: annotations: openshift.io/host.generated: "true" <--snip--> 3. add another annotation to route oc annotate route service-unsecure router.openshift.io/haproxy.health.check.interval=400ms The Route "service-unsecure" is invalid: metadata.annotations: Invalid value: "router.openshift.io~1haproxy.health.check.interval": name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') Actual results: failed and show errors Expected results: succeed Additional info: no issue when both client and server are 3.8, or both are 3.7.
I am no longer able to replicate this in 3.9. Steps taken: ``` $ oc version oc v3.9.0-alpha.2+fcbb58a-113-dirty kubernetes v1.9.1+a0ce1bc657 features: Basic-Auth GSSAPI Kerberos SPNEGO Server https://127.0.0.1:8443 openshift v3.9.0-alpha.2+d73139f kubernetes v1.9.0-beta1 $ oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/routing/caddy-docker.json $ oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/routing/edge/service_unsecure.json $ oc expose svc service-unsecure $ oc get route service-unsecure -o jsonpath='{.metadata.annotations}' map[openshift.io/host.generated:true]% $ oc annotate route service-unsecure router.openshift.io/haproxy.health.check.interval=400ms $ oc get route service-unsecure -o jsonpath='{.metadata.annotations}' map[router.openshift.io/haproxy.health.check.interval:400ms openshift.io/host.generated:true] ```
Verified on oc v3.9.0-0.21.0 $ oc annotate route service-unsecure error: at least one annotation update is required See 'oc annotate -h' for help and examples. $ oc annotate route service-unsecure test=abc route "service-unsecure" annotated $ oc get route -o yaml apiVersion: v1 items: - apiVersion: v1 kind: Route metadata: annotations: openshift.io/host.generated: "true" test: abc creationTimestamp: 2018-01-19T02:58:19Z labels: name: service-unsecure name: service-unsecure ...
Sorry I have to reassigned this one because: oc v3.7.23 does not work for the key name with slash (server version: openshift v3.9.0-0.21.0), this should be a compatibility issue. # oc annotate route route-edge openshift.io/host.generated=false --overwrite The Route "route-edge" is invalid: metadata.annotations: Invalid value: "openshift.io~1host.generated": name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') (compared to oc v3.9.0-0.21.0) $ oc annotate route service-unsecure openshift.io/host.generated=false --overwrite route "service-unsecure" annotated $ oc get route -o yaml apiVersion: v1 items: - apiVersion: v1 kind: Route metadata: annotations: openshift.io/host.generated: "false"
> Sorry I have to reassigned this one because: oc v3.7.23 does not work for the key name with slash (server version: openshift v3.9.0-0.21.0), this should be a compatibility issue. We have a +1/-1 compatibility support between server and client. This works with a 3.8 client against a 3.9 server as well. I will go ahead and backport this fix to 3.7, but it should not block this bugzilla. Moving back to ON_QA
Will have a check when the above pr1016 is merged.
Test against oc v3.7.36 and it's reproduced: $ ./oc annotate route service-unsecure router.openshift.io/haproxy.health.check.interval=400ms The Route "service-unsecure" is invalid: metadata.annotations: Invalid value: "router.openshift.io~1haproxy.health.check.interval": name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') oc v3.9.4 does not reproduced. Both are tested on openshift v3.9.4 Since this is a compatible issue for client/server sides, it should be fixed on oc 3.7.z instead of oc 3.9 As per comment 10, update the status to MODIFIED.
*** Bug 1569095 has been marked as a duplicate of this bug. ***