Commit d00dec78 authored by k8s-merge-robot's avatar k8s-merge-robot

Merge pull request #26397 from euank/fixReadOnlyRootfsPanic

Automatic merge from submit-queue rkt: Fix panic in setting ReadOnlyRootFS What the title says. I wish this method were broken out in a reasonably unit testable way. fixing this panic is more important for the second though, testing will come in a later commit. I observed the panic in a `./hack/local-up-cluster.sh` run with rkt as the container runtime. This is also the panic that's failing our jenkins against master ([recent run](https://console.cloud.google.com/m/cloudstorage/b/rktnetes-jenkins/o/logs/kubernetes-e2e-gce/1946/artifacts/jenkins-e2e-minion-group-qjh3/kubelet.log for the log output of a recent run)) cc @tmrts @yifan-gu
parents 825cd920 ecfd8f72
...@@ -767,10 +767,9 @@ func (r *Runtime) newAppcRuntimeApp(pod *api.Pod, podIP string, c api.Container, ...@@ -767,10 +767,9 @@ func (r *Runtime) newAppcRuntimeApp(pod *api.Pod, podIP string, c api.Container,
} }
ra := appcschema.RuntimeApp{ ra := appcschema.RuntimeApp{
Name: convertToACName(c.Name), Name: convertToACName(c.Name),
Image: appcschema.RuntimeImage{ID: *hash}, Image: appcschema.RuntimeImage{ID: *hash},
App: imgManifest.App, App: imgManifest.App,
ReadOnlyRootFS: *c.SecurityContext.ReadOnlyRootFilesystem,
Annotations: []appctypes.Annotation{ Annotations: []appctypes.Annotation{
{ {
Name: *appctypes.MustACIdentifier(k8sRktContainerHashAnno), Name: *appctypes.MustACIdentifier(k8sRktContainerHashAnno),
...@@ -783,6 +782,10 @@ func (r *Runtime) newAppcRuntimeApp(pod *api.Pod, podIP string, c api.Container, ...@@ -783,6 +782,10 @@ func (r *Runtime) newAppcRuntimeApp(pod *api.Pod, podIP string, c api.Container,
}, },
} }
if c.SecurityContext != nil && c.SecurityContext.ReadOnlyRootFilesystem != nil {
ra.ReadOnlyRootFS = *c.SecurityContext.ReadOnlyRootFilesystem
}
if mnt != nil { if mnt != nil {
ra.Annotations = append(ra.Annotations, appctypes.Annotation{ ra.Annotations = append(ra.Annotations, appctypes.Annotation{
Name: *appctypes.MustACIdentifier(k8sRktTerminationMessagePathAnno), Name: *appctypes.MustACIdentifier(k8sRktTerminationMessagePathAnno),
......
Markdown is supported
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