Commit Graph

23 Commits

Author SHA1 Message Date
Tero Saarni
96306f144a Set permissions on volume before publishing update
This change fixes a race condition that was caused by setting the file owner,
group and mode non-atomically, after the updated files had been published.

Users who were running non-root containers, without GID 0 permissions, and
had removed read permissions from other users by setting defaultMode: 0440 or
similar, were getting intermittent permission denied errors when accessing
files on secret or configmap volumes or service account tokens on projected
volumes during update.
2022-12-24 07:59:41 +02:00
Davanum Srinivas
a9593d634c
Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-07-26 13:14:05 -04:00
Claudiu Belu
82a9fb9d0e subatomic: Creates the symlinks to user-visible files later
When creating a symlink on Windows, if the target does not exist, the created
file is just a regular "symlink" file. But, if the target ultimately ends up being
a folder, then that symlink file is not valid, it must be a "symlinkd" in order to function
properly. Because the symlink file is not valid, the pods having that volume will fail to start.

Creating the user-visible files after the timestamped and data folders have been created
addresses this issue.
2021-01-06 04:10:28 -08:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
Shihang Zhang
3db7275b54 set proper file permission for projected service account volume 2020-05-04 18:25:23 -07:00
chenyaqi01
66be69bb0e replace bytes.Compare() with bytes.Equal() 2019-09-27 10:08:49 +08:00
Travis Rhoden
78d109e201 Always use filepath.Join instead of path.Join
This patch cleans up pkg/util/mount/* and pkg/util/volume/* to always
use filepath.Join instead of path.Join. filepath.Join is preferred
because path.Join can have issues on Windows.
2019-04-29 09:56:05 -06:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
Cheng Pan
a5c4f341d7 fix golint issue for pkg/volume/util 2018-09-10 21:24:35 +00:00
Pengfei Ni
f12b8eb497 Fix use visible files creation for windows 2018-04-16 11:12:17 +08:00
Kubernetes Submit Queue
b684a282e5
Merge pull request #50724 from allencloud/fix-incorrect-comparison-log
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix incorrect comparison in /pkg/volume error message

Signed-off-by: allencloud <allen.sun@daocloud.io>



**What this PR does / why we need it**:
This PR fixes incorrect error message when there is comparison.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
NONE

**Special notes for your reviewer**:
NONE

**Release note**:

```release-note
NONE
```
2018-02-26 20:34:37 -08:00
Joel Smith
b4e0923785 Rework method of updating atomic-updated data volumes
This change affects the way that secret, configmap, downwardAPI and projected
volumes (which all use the same underlying code) implement their data update
functionality.

* Instead of creating a subdirectory hierarchy that itself
  will contain symlinks to each actual data file, create only
  symlinks to items in the root of the volume, whether they
  be files or directories.
* Rather than comparing the user-visible data directory
  to see if an update is needed, compare with the current
  version of the data directory.
* Fix data dir timestamp format year
* Create ..data symlink even when a data volume has no data so
  consumers can have simplified update watch logic.
2018-01-17 12:09:20 -07:00
allencloud
f63d828745 fix incorrect comparison in /pkg/volume error message
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-08-27 08:38:19 +08:00
Di Xu
a76ccf5a5a use built-in path separator instead of hard coded 2017-07-09 23:24:34 +08:00
deads2k
6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Jitendra Bhurat
66a1ef25e0
Fixing Volumes on Windows 2016-11-01 15:48:37 -04:00
Jedrzej Nowak
f0988b95e7 Typos and englishify pkg/volume 2016-10-03 22:39:33 +02:00
Rodrigo Campos
568f4c2e63 Add mode permission bits to configmap, secrets and downwardAPI
This implements the proposal in:
docs/proposals/secret-configmap-downwarapi-file-mode.md

Fixes: #28317.

The mounttest image is updated so it returns the permissions of the linked file
and not the symlink itself.
2016-08-17 14:44:41 -04:00
David McMahon
ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Paul Morie
e838ff2893 Make ConfigMap volume readable as non-root 2016-04-05 12:20:52 -04:00
Paul Morie
26471d5723 Remove sentinel file from atomic writer 2016-02-27 16:09:06 -05:00
Paul Morie
f8d58ac708 Make flake in configMap update e2e easier to debug 2016-02-19 15:01:20 -05:00
Paul Morie
b750ea678f Generalize atomically updating projections into volumes 2016-02-10 03:19:52 -05:00