File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
crates/stackable-operator/src/crd/git_sync Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,9 @@ pub enum Error {
4444 AddVolumeMount {
4545 source : crate :: builder:: pod:: container:: Error ,
4646 } ,
47+
48+ #[ snafu( display( "failed to declare unique credentials" ) ) ]
49+ MultipleCredentials ,
4750}
4851
4952impl GitSync {
@@ -114,6 +117,11 @@ impl GitSyncResources {
114117 let mut resources = GitSyncResources :: default ( ) ;
115118
116119 for ( i, git_sync) in git_syncs. iter ( ) . enumerate ( ) {
120+ if git_sync. credentials_secret . is_some ( ) && git_sync. ssh_secret . is_some ( ) {
121+ // Gitsync will not allow the declaration of both ssh-key and password/token credentials
122+ return Err ( Error :: MultipleCredentials ) ;
123+ }
124+
117125 let mut env_vars = vec ! [ ] ;
118126 if let Some ( git_credentials_secret) = & git_sync. credentials_secret {
119127 env_vars. push ( GitSyncResources :: env_var_from_secret (
You can’t perform that action at this time.
0 commit comments