Skip to content

Commit 8da376e

Browse files
committed
remove http scheme check
1 parent 0cafeec commit 8da376e

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

crates/stackable-operator/src/crd/git_sync/v1alpha2_impl.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ impl GitSyncResources {
181181
Some(tls) => {
182182
match &tls.verification {
183183
TlsVerification::None {} => {
184-
// "http.sslverify=false" will be set later in the shell script
185-
ensure!(scheme == "http", SchemeMismatchSnafu { scheme });
184+
// We can't check the scheme for http here as github redirects to https and any PAT-based credentials will require https.
185+
// "http.sslverify=false" will be set later in the shell script.
186186
None
187187
}
188188
TlsVerification::Server(TlsServerVerification {
@@ -200,11 +200,7 @@ impl GitSyncResources {
200200
}
201201
}
202202
}
203-
None => {
204-
// Check the scheme but http.sslverify will *not* be set.
205-
ensure!(scheme == "http", SchemeMismatchSnafu { scheme });
206-
None
207-
}
203+
None => None,
208204
};
209205

210206
if git_sync.tls.tls_ca_cert_secret_class().is_some() {
@@ -1408,9 +1404,9 @@ name: ca-cert-0
14081404
}
14091405

14101406
#[rstest]
1411-
// http with tls/null --> deactivate: Ok
1407+
// https with tls/null --> deactivate: Ok
14121408
#[case(
1413-
"http://github.com/stackabletech/repo1",
1409+
"https://github.com/stackabletech/repo1",
14141410
r#"
14151411
tls: null
14161412
"#,
@@ -1430,9 +1426,9 @@ name: ca-cert-0
14301426
"#,
14311427
false
14321428
)]
1433-
// http with tls/None: Ok
1429+
// https with tls/None: Ok
14341430
#[case(
1435-
"http://github.com/stackabletech/repo1",
1431+
"https://github.com/stackabletech/repo1",
14361432
r#"
14371433
tls:
14381434
verification:

0 commit comments

Comments
 (0)