Skip to content

Commit 4c03594

Browse files
committed
refactor: adapt for the autonomy command
1 parent 3723b80 commit 4c03594

File tree

5 files changed

+24
-6
lines changed

5 files changed

+24
-6
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

implementations/rust/ockam/ockam_command/src/zone/common_args.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ impl ZoneConfigArg {
3636
}
3737
}
3838
None => {
39-
let paths = vec![PathBuf::from("./ockam.yaml"), PathBuf::from("./ockam.yml")];
39+
let paths = vec![
40+
PathBuf::from("./autonomy.yaml"),
41+
PathBuf::from("./autonomy.yml"),
42+
PathBuf::from("./ockam.yaml"),
43+
PathBuf::from("./ockam.yml"),
44+
];
4045
for path in paths {
4146
if path.try_exists().into_diagnostic()? {
4247
return Ok(path);

implementations/rust/ockam/ockam_command/src/zone/deploy.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,21 @@ impl Command<ZoneConfig> for DeployCommand {
112112

113113
impl DeployCommand {
114114
fn parse_zone_config(&self) -> Result<ZoneConfig> {
115-
let zone_config_path = self.zone.zone_config.as_deref().unwrap_or("./ockam.yaml");
116-
ZoneConfig::from_file(zone_config_path)
115+
let zone_config_path = match self.zone.zone_config.as_deref() {
116+
Some(path) => path.to_string(),
117+
None => {
118+
let paths = vec!["./autonomy.yaml", "./autonomy.yml", "./ockam.yaml", "./ockam.yml"];
119+
let mut found_path = "./autonomy.yaml"; // default preferred
120+
for path in paths {
121+
if std::path::Path::new(path).exists() {
122+
found_path = path;
123+
break;
124+
}
125+
}
126+
found_path.to_string()
127+
}
128+
};
129+
ZoneConfig::from_file(&zone_config_path)
117130
}
118131

119132
async fn process_images(
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
The path to the Zone configuration file, in yaml or json format.
2-
If not set, the `./ockam.yaml` file from the current directory will be used.
2+
If not set, will look for config files in this order: `./autonomy.yaml`, `./autonomy.yml`.

implementations/rust/ockam/ockam_command/src/zone/zone_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ impl ZoneConfig {
390390
pub fn get_http_url(&self, cluster_name: &str) -> Option<String> {
391391
if self.get_main_pod().ok()?.public {
392392
Some(format!(
393-
"https://{}-{}.ai.ockam.network",
393+
"https://{}-{}.cluster.autonomy.computer",
394394
cluster_name, self.name
395395
))
396396
} else {

0 commit comments

Comments
 (0)