add and deploy bootstrap secrets#8
Conversation
| pub fn create_secret_from_files( | ||
| secret_name: &str, | ||
| key_files: &[(PathBuf, &str)], //[pathbuf, key type] | ||
| ) -> Result<Secret, Box<dyn Error>> { |
There was a problem hiding this comment.
nit: I'm thinking about whether it would be better to make this func more generic. I mean we pass the real key instead of key type.
There was a problem hiding this comment.
So we do have a generic create_secret() method that is called by create_secret_from_files. Is that what you mean? Or you want something different?
There was a problem hiding this comment.
oh. sorry for the confusion. I mean we have
validator-lab/src/k8s_helpers.rs
Line 26 in 1a22c6c
perhaps we could have the caller handle the key name instead of hardcoding it here 🤔
then we can have this one easier
pub enum SecretType {
Value { v: String },
File { path: PathBuf },
}
pub fn THE_PUB_CREATE_SECRET_FN_NAME (name: &str, hm: HashMap<String, SecretType>) {
let mut m: BTreeMap<String, String> = BTreeMap::new();
for (key, value) in &hm {
match value {
SecretType::Value { v: _ } => // insert into the btreemap directly
SecretType::File { path: _ } => // single file version of create_secret_from_files
}
}
create_secret(name, m)
}It's just an idea that came to mind. There's no need to update it unless we have such requests in our code 🙈
| .arg( | ||
| Arg::with_name("validator_lab_directory") | ||
| .long("validator-lab-dir") | ||
| .takes_value(true) | ||
| .required(true) | ||
| .help("Absolute path to validator lab directory. | ||
| e.g. /home/sol/validator-lab"), | ||
| ) |
There was a problem hiding this comment.
I think we're solving the issue of using this tool by an executable file. If we have this one, it also means we will always need to clone validator-labs. If we have a path cargo install for this tool in the future, it will be a little bit confused haha.
I'm thinking maybe just like the Dockerfile, we get those files in line 🙈
There was a problem hiding this comment.
I'm thinking maybe just like the Dockerfile, we get those files in line
oooh can you elaborate a little more please? Are you saying we should add those startup scripts inline? Like in the rust code much like the dockerfile is created inline?
There was a problem hiding this comment.
See this PR: #9. I hardcoded the scripts. Think what you're saying makes sense slash is the right approach. See: https://github.com/anza-xyz/validator-lab/pull/9/files#diff-42d26d9f54d52fc46e96e03003a53843bea5e35c56ce03ade3ee30d0654b2320
| solana_root_path: PathBuf, | ||
| docker_build: bool, | ||
| build_path: PathBuf, | ||
| _build_path: PathBuf, |
There was a problem hiding this comment.
yes! EDIT: actually it can be taken out pretty easily. Will update.
Summary of Changes
CARGO_MANIGEST_PATH8th PR in a series of PRs that will build out the monogon testing framework for deploying validator clusters on Kubernetes
Previous PRs: