Skip to content

Commit 831808e

Browse files
authored
fix(sync): use inline base_url env for auth (#89)
* fix(sync): use inline base_url env for auth Signed-off-by: Xuhui zhang <xuhui@juicedata.io> * fix(sync): use inline base_url env for auth Signed-off-by: Xuhui zhang <xuhui@juicedata.io> --------- Signed-off-by: Xuhui zhang <xuhui@juicedata.io>
1 parent be7e844 commit 831808e

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

pkg/utils/sync.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,7 @@ func parseJuiceFSSyncSink(jfs *juicefsiov1.SyncSinkJuiceFS, syncName, ref string
149149
authCmd = append(authCmd, "--secret-key", fmt.Sprintf("$%s", key))
150150
}
151151
if jfs.ConsoleUrl != "" {
152-
pss.Envs = append(pss.Envs, corev1.EnvVar{
153-
Name: "BASE_URL",
154-
Value: jfs.ConsoleUrl,
155-
})
152+
pss.PrepareCommand += fmt.Sprintf("BASE_URL=%s ", jfs.ConsoleUrl)
156153
}
157154
for _, opt := range jfs.AuthOptions {
158155
opt = strings.TrimPrefix(opt, "--")

pkg/utils/sync_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,8 @@ func TestParseSyncSink(t *testing.T) {
161161
},
162162
},
163163
},
164-
{
165-
Name: "BASE_URL",
166-
Value: "http://127.0.0.1:8080/static",
167-
},
168164
},
169-
PrepareCommand: "juicefs auth volume --token $JUICEFS_TO_TOKEN --option1 --option2",
165+
PrepareCommand: "BASE_URL=http://127.0.0.1:8080/static juicefs auth volume --token $JUICEFS_TO_TOKEN --option1 --option2",
170166
},
171167
wantErr: false,
172168
},

0 commit comments

Comments
 (0)