Skip to content

Commit 4e1eeeb

Browse files
authored
Merge pull request #8827 from jackyalbo/jacky-fix1
Removing kube_pv_chown
2 parents bf6a967 + c6de9eb commit 4e1eeeb

File tree

6 files changed

+3
-157
lines changed

6 files changed

+3
-157
lines changed

.github/workflows/jest-unit-tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414

1515
- name: Run Jest Unit Test
1616
run: |
17+
sudo apt-get update --fix-missing
1718
sudo apt-get -y install nasm libcap-dev
1819
npm install
1920
npm run build

src/deploy/NVA_build/NooBaa.Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
ARG CENTOS_VER=9
22
FROM noobaa-base AS server_builder
33

4-
RUN mkdir -p /noobaa_init_files && \
5-
cp -p ./build/Release/kube_pv_chown /noobaa_init_files
4+
RUN mkdir -p /noobaa_init_files
65

76
COPY . ./
87
ARG GIT_COMMIT
@@ -139,12 +138,7 @@ RUN chmod 775 /noobaa_init_files && \
139138
chmod -R g=u /noobaa_init_files/
140139

141140
COPY --from=server_builder /kubectl /usr/local/bin/kubectl
142-
COPY --from=server_builder ./noobaa_init_files/kube_pv_chown /noobaa_init_files
143-
RUN mkdir -m 777 /root/node_modules && \
144-
chown root:root /noobaa_init_files/kube_pv_chown && \
145-
chmod 750 /noobaa_init_files/kube_pv_chown && \
146-
chmod u+s /noobaa_init_files/kube_pv_chown
147-
141+
RUN mkdir -m 777 /root/node_modules
148142
COPY --from=noobaa-base /root/node_modules /root/node_modules
149143

150144
###############

src/deploy/NVA_build/noobaa_core.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ spec:
275275
- name: init-mongo
276276
image: noobaa/noobaa-core:5.0.1
277277
imagePullPolicy: IfNotPresent
278-
# command: ['/noobaa_init_files/kube_pv_chown', 'server']
279278
command: ["/noobaa_init_files/noobaa_init.sh", "init_mongo"]
280279
volumeMounts:
281280
- mountPath: /mongo_data

src/deploy/NVA_build/noobaa_init.sh

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ RUN_INIT=${1}
44
NOOBAA_SUPERVISOR="/data/noobaa_supervisor.conf"
55
NOOBAA_DATA_VERSION="/data/noobaa_version"
66
NOOBAA_PACKAGE_PATH="/root/node_modules/noobaa-core/package.json"
7-
KUBE_PV_CHOWN="/noobaa_init_files/kube_pv_chown"
87

98
update_services_autostart() {
109
local programs=(webserver bg_workers hosted_agents s3rver)
@@ -143,18 +142,7 @@ prepare_server_pvs() {
143142
}
144143

145144
prepare_mongo_pv() {
146-
local main_dir="/mongo_data"
147145
local shard_dir="/mongo_data/mongo/cluster/shard1"
148-
local recursive_file="/mongo_data/recursive_file"
149-
local dir_id=$(stat -c '%u' ${main_dir})
150-
local current_id=$(id -u)
151-
152-
# change ownership and permissions of mongo db path
153-
if [ "${dir_id}" != "${current_id}" ] || [ ! -f ${recursive_file} ]; then
154-
echo "uid change has been identified - will change from uid: ${dir_id} to new uid: ${current_id}"
155-
time ${KUBE_PV_CHOWN} mongo ${current_id}
156-
touch ${recursive_file}
157-
fi
158146

159147
if [ ! -d ${shard_dir} ]; then
160148
echo "creating shard directory: ${shard_dir}"
@@ -164,19 +152,6 @@ prepare_mongo_pv() {
164152
fi
165153
}
166154

167-
prepare_postgres_pv() {
168-
local dir="/var/lib/pgsql"
169-
local dir_id=$(stat -c '%u' ${dir})
170-
local current_id=$(id -u)
171-
172-
# change ownership and permissions of mongo db path
173-
if [ "${dir_id}" != "${current_id}" ]
174-
then
175-
echo "uid change has been identified - will change from uid: ${dir_id} to new uid: ${current_id}"
176-
time ${KUBE_PV_CHOWN} postgres ${current_id}
177-
fi
178-
}
179-
180155
init_endpoint() {
181156
fix_non_root_user
182157

@@ -200,18 +175,6 @@ init_noobaa_server() {
200175
init_noobaa_agent() {
201176
fix_non_root_user
202177

203-
local dir="/noobaa_storage"
204-
mkdir -p ${dir}
205-
local dir_id=$(stat -c '%u' ${dir})
206-
local current_id=$(id -u)
207-
208-
# change ownership and permissions of noobaa_storage path
209-
if [ "${dir_id}" != "${current_id}" ]
210-
then
211-
echo "uid change has been identified - will change from uid: ${dir_id} to new uid: ${current_id}"
212-
time ${KUBE_PV_CHOWN} agent ${current_id}
213-
fi
214-
215178
cd /root/node_modules/noobaa-core/
216179
prepare_agent_conf
217180
run_internal_process node --unhandled-rejections=warn ./src/agent/agent_cli
@@ -230,9 +193,6 @@ then
230193
elif [ "${RUN_INIT}" == "init_mongo" ]
231194
then
232195
prepare_mongo_pv
233-
elif [ "${RUN_INIT}" == "init_postgres" ]
234-
then
235-
prepare_postgres_pv
236196
elif [ "${RUN_INIT}" == "db_migrate" ]
237197
then
238198
migrate_dbs

src/native/nb_native.gyp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,5 @@
115115
'util/tpool.cpp',
116116
'util/tpool.h',
117117
],
118-
}, {
119-
'target_name': 'kube_pv_chown',
120-
'type': 'executable',
121-
'sources': [
122-
'tools/kube_pv_chown.cpp'
123-
]
124118
}],
125119
}

src/native/tools/kube_pv_chown.cpp

Lines changed: 0 additions & 102 deletions
This file was deleted.

0 commit comments

Comments
 (0)