diff --git a/lib/aws/charts/q-application/templates/deployment.j2.yaml b/lib/aws/charts/q-application/templates/deployment.j2.yaml index ccfb8b3e..493507dd 100644 --- a/lib/aws/charts/q-application/templates/deployment.j2.yaml +++ b/lib/aws/charts/q-application/templates/deployment.j2.yaml @@ -41,9 +41,9 @@ spec: automountServiceAccountToken: false terminationGracePeriodSeconds: 60 securityContext: {} - {%- if is_registry_name %} + {%- if is_registry_secret %} imagePullSecrets: - - name: {{ registry_name }} + - name: {{ registry_secret }} {%- endif %} containers: - name: {{ name }} diff --git a/lib/aws/charts/q-application/templates/statefulset.j2.yaml b/lib/aws/charts/q-application/templates/statefulset.j2.yaml index 5130d768..e59639e1 100644 --- a/lib/aws/charts/q-application/templates/statefulset.j2.yaml +++ b/lib/aws/charts/q-application/templates/statefulset.j2.yaml @@ -40,9 +40,9 @@ spec: automountServiceAccountToken: false terminationGracePeriodSeconds: 60 securityContext: {} - {%- if is_registry_name %} + {%- if is_registry_secret %} imagePullSecrets: - - name: {{ registry_name }} + - name: {{ registry_secret }} {%- endif %} containers: - name: {{ name }} diff --git a/lib/digitalocean/charts/q-application/templates/deployment.j2.yaml b/lib/digitalocean/charts/q-application/templates/deployment.j2.yaml index ccfb8b3e..493507dd 100644 --- a/lib/digitalocean/charts/q-application/templates/deployment.j2.yaml +++ b/lib/digitalocean/charts/q-application/templates/deployment.j2.yaml @@ -41,9 +41,9 @@ spec: automountServiceAccountToken: false terminationGracePeriodSeconds: 60 securityContext: {} - {%- if is_registry_name %} + {%- if is_registry_secret %} imagePullSecrets: - - name: {{ registry_name }} + - name: {{ registry_secret }} {%- endif %} containers: - name: {{ name }} diff --git a/lib/digitalocean/charts/q-application/templates/statefulset.j2.yaml b/lib/digitalocean/charts/q-application/templates/statefulset.j2.yaml index dd6ae5be..fa405187 100644 --- a/lib/digitalocean/charts/q-application/templates/statefulset.j2.yaml +++ b/lib/digitalocean/charts/q-application/templates/statefulset.j2.yaml @@ -40,9 +40,9 @@ spec: automountServiceAccountToken: false terminationGracePeriodSeconds: 60 securityContext: {} - {%- if is_registry_name %} + {%- if is_registry_secret %} imagePullSecrets: - - name: {{ registry_name }} + - name: {{ registry_secret }} {%- endif %} containers: - name: {{ name }} diff --git a/src/build_platform/mod.rs b/src/build_platform/mod.rs index 145480c4..8758a33d 100644 --- a/src/build_platform/mod.rs +++ b/src/build_platform/mod.rs @@ -61,9 +61,10 @@ pub struct Image { pub name: String, pub tag: String, pub commit_id: String, - // registry name where the image has been pushed - // (this is not mandatory; only used by DOCR implementation today) + // registry name where the image has been pushed: Optional pub registry_name: Option, + // registry secret to pull image: Optional + pub registry_secret: Option, // complete registry URL where the image has been pushed pub registry_url: Option, } diff --git a/src/cloud_provider/aws/application.rs b/src/cloud_provider/aws/application.rs index 2f85b021..e891bda7 100644 --- a/src/cloud_provider/aws/application.rs +++ b/src/cloud_provider/aws/application.rs @@ -173,11 +173,11 @@ impl Service for Application { match self.image.registry_name.as_ref() { Some(registry_name) => { - context.insert("is_registry_name", &true); - context.insert("registry_name", registry_name); + context.insert("is_registry_secret", &true); + context.insert("registry_secret", registry_name); } None => { - context.insert("is_registry_name", &false); + context.insert("is_registry_secret", &false); } }; diff --git a/src/cloud_provider/digitalocean/application.rs b/src/cloud_provider/digitalocean/application.rs index c21d112a..f82668ce 100644 --- a/src/cloud_provider/digitalocean/application.rs +++ b/src/cloud_provider/digitalocean/application.rs @@ -178,11 +178,11 @@ impl Service for Application { match self.image.registry_name.as_ref() { Some(registry_name) => { - context.insert("is_registry_name", &true); - context.insert("registry_name", registry_name); + context.insert("is_registry_secret", &true); + context.insert("registry_secret", registry_name); } None => { - context.insert("is_registry_name", &false); + context.insert("is_registry_secret", &false); } }; diff --git a/src/cloud_provider/service.rs b/src/cloud_provider/service.rs index f04520d4..b6366984 100644 --- a/src/cloud_provider/service.rs +++ b/src/cloud_provider/service.rs @@ -355,8 +355,9 @@ where Ok(lines) => lines, Err(err) => { error!( - "error while retrieving debug logs from database {}; error: {:?}", - service.name(), + "error while retrieving debug logs from {} {}; error: {:?}", + service.service_type().name(), + service.name_with_id(), err ); Vec::new() diff --git a/src/container_registry/docr.rs b/src/container_registry/docr.rs index 7dad1b25..eaf3178a 100644 --- a/src/container_registry/docr.rs +++ b/src/container_registry/docr.rs @@ -163,7 +163,9 @@ impl DOCR { }; let mut image = image.clone(); - image.registry_name = Some(registry_name); + image.registry_name = Some(registry_name.clone()); + // on DOCR registry secret is the same as registry name + image.registry_secret = Some(registry_name); image.registry_url = Some(dest); Ok(PushResult { image }) diff --git a/src/models.rs b/src/models.rs index e3e9f858..26434b30 100644 --- a/src/models.rs +++ b/src/models.rs @@ -289,6 +289,7 @@ impl Application { tag: self.commit_id.clone(), commit_id: self.commit_id.clone(), registry_name: None, + registry_secret: None, registry_url: None, } } @@ -700,6 +701,7 @@ impl ExternalService { tag: self.commit_id.clone(), commit_id: self.commit_id.clone(), registry_name: None, + registry_secret: None, registry_url: None, } } diff --git a/src/object_storage/spaces.rs b/src/object_storage/spaces.rs index 61896f70..90c3bbf2 100644 --- a/src/object_storage/spaces.rs +++ b/src/object_storage/spaces.rs @@ -52,7 +52,6 @@ impl Spaces { S: Into, X: AsRef, { - // Digital ocean doesn't implement any space download, it use the generic AWS SDK let region = Region::Custom { name: self.region.clone(), endpoint: format!("https://{}.digitaloceanspaces.com", self.region), @@ -136,7 +135,7 @@ impl ObjectStorage for Spaces { let workspace_directory = crate::fs::workspace_directory( self.context().workspace_root_dir(), self.context().execution_id(), - format!("object-storage/s3/{}", self.name()), + format!("object-storage/spaces/{}", self.name()), ); let file_path = format!("{}/{}/{}", workspace_directory, bucket_name, object_key); @@ -164,7 +163,10 @@ impl ObjectStorage for Spaces { Err(err) => { debug!("{:?}", err); - warn!("Can't download object '{}'. Let's retry...", object_key); + warn!( + "Can't download object '{}'/'{}'. Let's retry...", + bucket_name, object_key + ); OperationResult::Retry(err) }