@@ -97,10 +97,6 @@ func preRunJoin(flags *JoinCmdFlags) error {
97
97
98
98
flags .isAirgap = flags .airgapBundle != ""
99
99
100
- // set the umask to 022 so that we can create files/directories with 755 permissions
101
- // this does not return an error - it returns the previous umask
102
- _ = syscall .Umask (0o022 )
103
-
104
100
return nil
105
101
}
106
102
@@ -234,12 +230,6 @@ func runJoinVerifyAndPrompt(name string, flags JoinCmdFlags, jcmd *kotsadm.JoinC
234
230
return fmt .Errorf ("unable to write runtime config: %w" , err )
235
231
}
236
232
237
- if err := os .Chmod (runtimeconfig .EmbeddedClusterHomeDirectory (), 0755 ); err != nil {
238
- // don't fail as there are cases where we can't change the permissions (bind mounts, selinux, etc...),
239
- // and we handle and surface those errors to the user later (host preflights, checking exec errors, etc...)
240
- logrus .Debugf ("unable to chmod embedded-cluster home dir: %s" , err )
241
- }
242
-
243
233
// check to make sure the version returned by the join token is the same as the one we are running
244
234
if strings .TrimPrefix (jcmd .EmbeddedClusterVersion , "v" ) != strings .TrimPrefix (versions .Version , "v" ) {
245
235
return fmt .Errorf ("embedded cluster version mismatch - this binary is version %q, but the cluster is running version %q" , versions .Version , jcmd .EmbeddedClusterVersion )
@@ -266,6 +256,16 @@ func initializeJoin(ctx context.Context, name string, flags JoinCmdFlags, jcmd *
266
256
spinner := spinner .Start ()
267
257
spinner .Infof ("Initializing" )
268
258
259
+ // set the umask to 022 so that we can create files/directories with 755 permissions
260
+ // this does not return an error - it returns the previous umask
261
+ _ = syscall .Umask (0o022 )
262
+
263
+ if err := os .Chmod (runtimeconfig .EmbeddedClusterHomeDirectory (), 0755 ); err != nil {
264
+ // don't fail as there are cases where we can't change the permissions (bind mounts, selinux, etc...),
265
+ // and we handle and surface those errors to the user later (host preflights, checking exec errors, etc...)
266
+ logrus .Debugf ("unable to chmod embedded-cluster home dir: %s" , err )
267
+ }
268
+
269
269
logrus .Debugf ("materializing %s binaries" , name )
270
270
if err := materializeFiles (flags .airgapBundle ); err != nil {
271
271
spinner .Errorf ("Initialization failed" )
0 commit comments