diff --git a/backend/src/main/kotlin/me/sujanpoudel/playdeals/jobs/AndroidAppDetailScrapper.kt b/backend/src/main/kotlin/me/sujanpoudel/playdeals/jobs/AndroidAppDetailScrapper.kt index aaee7de..b530e10 100644 --- a/backend/src/main/kotlin/me/sujanpoudel/playdeals/jobs/AndroidAppDetailScrapper.kt +++ b/backend/src/main/kotlin/me/sujanpoudel/playdeals/jobs/AndroidAppDetailScrapper.kt @@ -63,6 +63,7 @@ class AppDetailScrapper( val app = loggingExecutionTime("$SIMPLE_NAME:: scrapping app details $packageName") { getAppDetail(packageName) }.getOrElse { + repository.delete(packageName) throw RuntimeException("AppDetailScrapper failed to scrap details ${it.message}") } @@ -121,10 +122,9 @@ class AppDetailScrapper( id = packageName, name = combined.getValue(Value.TITLE), icon = combined.getValue(Value.ICON), - images = - (combined.getValue(Value.SCREENSHOTS_LIST) as JsonArray).mapNotNull { - getValue(it as JsonArray, Value.SCREENSHOTS_URL.path.toTypedArray()) as? String - }, + images = (combined.getValue(Value.SCREENSHOTS_LIST) as JsonArray).mapNotNull { + getValue(it as JsonArray, Value.SCREENSHOTS_URL.path.toTypedArray()) as? String + }, normalPrice = normalPrice, currency = combined.getValue(Value.CURRENCY) as String, currentPrice = currentPrice, @@ -132,10 +132,9 @@ class AppDetailScrapper( downloads = combined.getValue(Value.INSTALLS), storeUrl = "https://play.google.com/store/apps/details?id=$packageName", category = combined.getValue(Value.GENRE) as String, - offerExpiresIn = - combined.getValueOrNull(Value.OFFER_END_TIME)?.let { - OffsetDateTime.ofInstant(Instant.ofEpochSecond(it.toLong()), ZoneOffset.UTC) - }, + offerExpiresIn = combined.getValueOrNull(Value.OFFER_END_TIME)?.let { + OffsetDateTime.ofInstant(Instant.ofEpochSecond(it.toLong()), ZoneOffset.UTC) + }, source = Constants.DealSources.APP_DEAL_SUBREDDIT, ) } diff --git a/helm/backend/templates/traefik-https-redirect-middleware.yaml b/helm/backend/templates/traefik-https-redirect-middleware.yaml index 0dd13a3..a84b60b 100644 --- a/helm/backend/templates/traefik-https-redirect-middleware.yaml +++ b/helm/backend/templates/traefik-https-redirect-middleware.yaml @@ -2,7 +2,6 @@ apiVersion: traefik.containo.us/v1alpha1 kind: Middleware metadata: name: redirect-https - namespace: {{ .Values.namespace }} spec: redirectScheme: scheme: https diff --git a/helm/service-account/templates/serviceaccount-secret.yaml b/helm/service-account/templates/serviceaccount-secret.yaml index b031e77..e3f64ef 100644 --- a/helm/service-account/templates/serviceaccount-secret.yaml +++ b/helm/service-account/templates/serviceaccount-secret.yaml @@ -2,7 +2,6 @@ apiVersion: v1 kind: Secret metadata: name: sa-{{ .Values.serviceAccountName }}-token - namespace: {{ .Values.namespace }} annotations: kubernetes.io/service-account.name: sa-{{ .Values.serviceAccountName }} type: kubernetes.io/service-account-token diff --git a/helm/service-account/templates/serviceaccount.yaml b/helm/service-account/templates/serviceaccount.yaml index 2a575d5..9ead65d 100644 --- a/helm/service-account/templates/serviceaccount.yaml +++ b/helm/service-account/templates/serviceaccount.yaml @@ -2,4 +2,3 @@ apiVersion: v1 kind: ServiceAccount metadata: name: sa-{{ .Values.serviceAccountName }} - namespace: {{ .Values.namespace }} diff --git a/justfile b/justfile index f39a89f..64dfef4 100644 --- a/justfile +++ b/justfile @@ -45,7 +45,8 @@ helm-upgrade imageTag=tag: --set firebaseAdminAuthCredential=$FIREBASE_ADMIN_AUTH_CREDENTIALS \ --set forexApiKey=$FOREX_API_KEY \ --set image.tag={{imageTag}} \ - --set image.repository={{imageRepo}} + --set image.repository={{imageRepo}} \ + --set namespace={{namespace}} # Uninstalls the helm chart helm-delete: