{"action":"opened","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/44676","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/44676/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/44676/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/44676/events","html_url":"https://github.com/kubernetes/kubernetes/issues/44676","id":222820416,"number":44676,"title":"initContainer - image not updated?","user":{"login":"gytisgreitai","id":1690228,"avatar_url":"https://avatars3.githubusercontent.com/u/1690228?v=3","gravatar_id":"","url":"https://api.github.com/users/gytisgreitai","html_url":"https://github.com/gytisgreitai","followers_url":"https://api.github.com/users/gytisgreitai/followers","following_url":"https://api.github.com/users/gytisgreitai/following{/other_user}","gists_url":"https://api.github.com/users/gytisgreitai/gists{/gist_id}","starred_url":"https://api.github.com/users/gytisgreitai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gytisgreitai/subscriptions","organizations_url":"https://api.github.com/users/gytisgreitai/orgs","repos_url":"https://api.github.com/users/gytisgreitai/repos","events_url":"https://api.github.com/users/gytisgreitai/events{/privacy}","received_events_url":"https://api.github.com/users/gytisgreitai/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-19T17:59:01Z","updated_at":"2017-04-19T17:59:01Z","closed_at":null,"body":"**Is this a request for help?** No\r\n\r\n\r\n**What keywords did you search in Kubernetes issues before filing this one?**\r\n\r\n- initContainers\r\n\r\n---\r\n\r\n**Is this a BUG REPORT or FEATURE REQUEST?** (choose one): BUG REPORT \r\n\r\n**Kubernetes version** :\r\n\r\n```\r\nClient Version: version.Info{Major:\"1\", Minor:\"6\", GitVersion:\"v1.6.0\", GitCommit:\"fff5156092b56e6bd60fff75aad4dc9de6b6ef37\", GitTreeState:\"clean\", BuildDate:\"2017-03-28T16:36:33Z\", GoVersion:\"go1.7.5\", Compiler:\"gc\", Platform:\"darwin/amd64\"}\r\nServer Version: version.Info{Major:\"1\", Minor:\"6\", GitVersion:\"v1.6.1\", GitCommit:\"b0b7a323cc5a4a2019b2e9520c21c7830b7f708e\", GitTreeState:\"clean\", BuildDate:\"2017-04-03T20:33:27Z\", GoVersion:\"go1.7.5\", Compiler:\"gc\", Platform:\"linux/amd64\"}\r\n```\r\n\r\n\r\n**Environment**:\r\n- **Cloud provider or hardware configuration**: GKE\r\n\r\n**What happened**:\r\n\r\nInitial template `b2b.yaml`:\r\n```\r\napiVersion: extensions/v1beta1\r\nkind: Deployment\r\nmetadata:\r\n  name: b2b-deployment\r\nspec:\r\n  replicas: 1\r\n  template:\r\n    metadata:\r\n      labels:\r\n        name: b2b\r\n    spec:\r\n      initContainers:\r\n        - name: b2b-liquibase\r\n          image: eu.gcr.io/project/b2b-liquibase:master-3\r\n          imagePullPolicy: Always\r\n          <...>\r\n      containers:\r\n      - name: cloudsql-proxy\r\n        image: gcr.io/cloudsql-docker/gce-proxy:1.09\r\n        <...>\r\n      - name: b2b\r\n        image: eu.gcr.io/project/b2b:master-3\r\n        imagePullPolicy: Always\r\n        <...>\r\n```\r\n\r\nafter doing `kubectl -n dev apply -f b2b.yaml`:\r\n\r\n```\r\n$ kubectl -n dev describe deployment b2b-deployment\r\nName:\t\t\tb2b-deployment\r\nNamespace:\t\tdev\r\nCreationTimestamp:\tWed, 19 Apr 2017 20:25:23 +0300\r\nLabels:\t\t\tname=b2b\r\nAnnotations:\t\tdeployment.kubernetes.io/revision=1\r\n\t\t\tkubectl.kubernetes.io/last-applied-configuration={\"apiVersion\":\"extensions/v1beta1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"name\":\"b2b-deployment\",\"namespace\":\"dev\"},\"spec\":{\"replicas\":1,\"te...\r\nSelector:\t\tname=b2b\r\nReplicas:\t\t1 desired | 1 updated | 1 total | 1 available | 0 unavailable\r\nStrategyType:\t\tRollingUpdate\r\nMinReadySeconds:\t0\r\nRollingUpdateStrategy:\t1 max unavailable, 1 max surge\r\nPod Template:\r\n  Labels:\tname=b2b\r\n  Init Containers:\r\n   b2b-liquibase:\r\n    Image:\teu.gcr.io/porject/b2b-liquibase:master-3\r\n    <...>\r\n  Containers:\r\n   cloudsql-proxy:\r\n    Image:\tgcr.io/cloudsql-docker/gce-proxy:1.09\r\n    <...>\r\n   b2b:\r\n    Image:\teu.gcr.io/tripcreatorcom/b2b:master-3\r\n    <...>\r\nConditions:\r\n  Type\t\tStatus\tReason\r\n  ----\t\t------\t------\r\n  Available \tTrue\tMinimumReplicasAvailable\r\nOldReplicaSets:\tb2b-deployment-3574832072 (1/1 replicas created)\r\nNewReplicaSet:\t<none>\r\nEvents:\r\n  FirstSeen\tLastSeen\tCount\tFrom\t\t\tSubObjectPath\tType\t\tReason\t\t\tMessage\r\n  ---------\t--------\t-----\t----\t\t\t-------------\t--------\t------\t\t\t-------\r\n  18s\t\t18s\t\t1\tdeployment-controller\t\t\tNormal\t\tScalingReplicaSet\tScaled up replica set b2b-deployment-3574832072 to 1\r\n```\r\n\r\nNow lets update both the `initContainer` and `container` image tag, so that `b2b.yaml` would look like this:\r\n\r\n```\r\napiVersion: extensions/v1beta1\r\nkind: Deployment\r\nmetadata:\r\n  name: b2b-deployment\r\nspec:\r\n  replicas: 1\r\n  template:\r\n    metadata:\r\n      labels:\r\n        name: b2b\r\n    spec:\r\n      initContainers:\r\n        - name: b2b-liquibase\r\n          image: eu.gcr.io/tripcreatorcom/b2b-liquibase:master-52-768e8feb8\r\n          imagePullPolicy: Always\r\n          <...>\r\n      containers:\r\n      - name: cloudsql-proxy\r\n        image: gcr.io/cloudsql-docker/gce-proxy:1.09\r\n        <...>\r\n      - name: b2b\r\n        image: eu.gcr.io/tripcreatorcom/b2b:master-52-768e8feb8\r\n        imagePullPolicy: Always\r\n       <...>\r\n```\r\nAnd lets check our deployment:\r\n\r\n```\r\n$ kubectl -n dev describe deployment b2b-deployment\r\nName:\t\t\tb2b-deployment\r\nNamespace:\t\tdev\r\nCreationTimestamp:\tWed, 19 Apr 2017 20:25:23 +0300\r\nLabels:\t\t\tname=b2b\r\nAnnotations:\t\tdeployment.kubernetes.io/revision=2\r\n\t\t\tkubectl.kubernetes.io/last-applied-configuration={\"apiVersion\":\"extensions/v1beta1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"name\":\"b2b-deployment\",\"namespace\":\"dev\"},\"spec\":{\"replicas\":1,\"te...\r\nSelector:\t\tname=b2b\r\nReplicas:\t\t1 desired | 1 updated | 1 total | 1 available | 0 unavailable\r\nStrategyType:\t\tRollingUpdate\r\nMinReadySeconds:\t0\r\nRollingUpdateStrategy:\t1 max unavailable, 1 max surge\r\nPod Template:\r\n  Labels:\tname=b2b\r\n  Init Containers:\r\n   b2b-liquibase:\r\n    Image:\teu.gcr.io/project/b2b-liquibase:master-3\r\n   <...>\r\n  Containers:\r\n   cloudsql-proxy:\r\n    Image:\tgcr.io/cloudsql-docker/gce-proxy:1.09\r\n   <...>\r\n   b2b:\r\n    Image:\teu.gcr.io/project/b2b:master-52-768e8feb8\r\n    <...>\r\nConditions:\r\n  Type\t\tStatus\tReason\r\n  ----\t\t------\t------\r\n  Available \tTrue\tMinimumReplicasAvailable\r\nOldReplicaSets:\tb2b-deployment-3370688208 (1/1 replicas created)\r\nNewReplicaSet:\t<none>\r\nEvents:\r\n  FirstSeen\tLastSeen\tCount\tFrom\t\t\tSubObjectPath\tType\t\tReason\t\t\tMessage\r\n  ---------\t--------\t-----\t----\t\t\t-------------\t--------\t------\t\t\t-------\r\n  12m\t\t12m\t\t1\tdeployment-controller\t\t\tNormal\t\tScalingReplicaSet\tScaled up replica set b2b-deployment-3574832072 to 1\r\n  11m\t\t11m\t\t1\tdeployment-controller\t\t\tNormal\t\tScalingReplicaSet\tScaled up replica set b2b-deployment-3370688208 to 1\r\n  11m\t\t11m\t\t1\tdeployment-controller\t\t\tNormal\t\tScalingReplicaSet\tScaled down replica set b2b-deployment-3574832072 to 0\r\n```\r\nAs you can see image for `b2b` has been updated to `master-52-768e8feb8` but for `initContainer` `b2b-liquibase` the image is still at `master-3`\r\n\r\n[According to docs](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/):\r\n\r\n> Changes to the Init Container spec are limited to the container image field. \r\n\r\nOr does this imply that image tag changes are ignored?\r\n\r\n**What you expected to happen**:\r\n\r\n`initContainer` `b2b-liquibase` tag should be `master-52-768e8feb8`\r\n\r\n"}}
{"actor":{"display_login":"gytisgreitai"}}