diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d2163a..0773cdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [v1.1.3] - 2026-04-24 + +### Added +- Ingress labels in helm chart (`deploy/helm`). +- `main_test.go` for profiling test. + +### Changed +- Owner name and repo path. + ## [v1.1.1] - 2026-03-07 ### Fixed diff --git a/Dockerfile b/Dockerfile index 5a4d9ec..f8491f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ WORKDIR /app COPY go.mod go.sum ./ RUN go mod download COPY . . -ARG VERSION="v1.0.0" +ARG VERSION="v1.1.3" RUN go build -v -ldflags="-s -w -X 'apatit/internal/version.Version=${VERSION}'" -o /app/apatit ./cmd/apatit FROM alpine:3.21 @@ -13,7 +13,7 @@ RUN apk add --no-cache ca-certificates LABEL org.opencontainers.image.title="APATIT (Advanced Ping-Admin Tasks Indicators Transducer)" LABEL org.opencontainers.image.description="Transducer for Tasks Indicators from https://ping-admin.com/" -LABEL org.opencontainers.image.source="https://github.com/ostrovok-tech/apatit" +LABEL org.opencontainers.image.source="https://github.com/emergingtravel/apatit" LABEL org.opencontainers.image.version="${VERSION}" COPY --from=build /app/apatit /usr/local/bin/apatit diff --git a/LICENSE b/LICENSE index 7f3ccb3..fe192e8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 Ostrovok! Tech +Copyright (c) 2026 Emerging Travel Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 8739e4f..6ba9e73 100644 --- a/README.md +++ b/README.md @@ -39,14 +39,14 @@ docker run --rm -d \ -p 8080:8080 \ -e API_KEY=your-api-key \ -e TASK_IDS=1,2,3 \ - ghcr.io/ostrovok-tech/apatit:latest + ghcr.io/emergingtravel/apatit:latest ``` ### From Source 1. Clone the repository: ```bash -git clone https://github.com/ostrovok-tech/apatit.git +git clone https://github.com/emergingtravel/apatit.git cd apatit ``` @@ -183,6 +183,6 @@ apatit/ ## Support -For issues and feature requests, please use the [GitHub Issues](https://github.com/ostrovok-tech/apatit/issues) page. +For issues and feature requests, please use the [GitHub Issues](https://github.com/emergingtravel/apatit/issues) page. diff --git a/cmd/apatit/main_test.go b/cmd/apatit/main_test.go new file mode 100644 index 0000000..9942c5e --- /dev/null +++ b/cmd/apatit/main_test.go @@ -0,0 +1,39 @@ +package main + +import ( + "context" + "errors" + "testing" + "time" + + "apatit/internal/config" +) + +// TestApplication_Profile run APATIT for profiling. +func TestApplication_Profile(t *testing.T) { + + const profileDuration = 120 * time.Second + + ctx, cancel := context.WithTimeout(context.Background(), profileDuration) + defer cancel() + + t.Logf("Starting application for profiling, duration: %s", profileDuration) + + cfg, err := config.New() + if err != nil { + t.Fatalf("Failed to load configuration: %v", err) + } + + app, err := newApp(cfg) + if err != nil { + t.Fatalf("Application initialization failed: %v", err) + } + + if err := app.Run(ctx); err != nil { + if !errors.Is(err, context.Canceled) { + t.Errorf("Application terminated with an unexpected error: %v", err) + } + } + + t.Logf("Application ran for %s. Profiling test finished.", profileDuration) +} diff --git a/deploy/helm/Chart.yaml b/deploy/helm/Chart.yaml index 9914d85..72ff531 100644 --- a/deploy/helm/Chart.yaml +++ b/deploy/helm/Chart.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v2 name: apatit description: Set of exporters for https://ping-admin.com/ @@ -6,11 +7,11 @@ keywords: - prometheus - ping-admin sources: - - https://github.com/ostrovok-tech/apatit + - https://github.com/emergingtravel/apatit - https://ping-admin.com/ maintainers: - - name: Ostrovok! Tech - url: https://github.com/ostrovok-tech + - name: Emerging Travel Inc. + url: https://github.com/emergingtravel type: application version: 1.0.0 appVersion: "1.0.0" diff --git a/deploy/helm/README.md b/deploy/helm/README.md index c4025d1..6e74925 100644 --- a/deploy/helm/README.md +++ b/deploy/helm/README.md @@ -10,7 +10,7 @@ APATIT is a Prometheus exporter that collects metrics from ping-admin.com monito - Kubernetes 1.19+ - Helm 3.0+ -- Access to the container image: `ghcr.io/ostrovok-tech/apatit` +- Access to the container image: `ghcr.io/emergingtravel/apatit` ## Installation @@ -42,7 +42,7 @@ The following table lists the configurable parameters and their default values. | Parameter | Description | Default | |-----------|-------------|---------| | `replicaCount` | Number of replicas | `1` | -| `image.repository` | Container image repository | `ghcr.io/ostrovok-tech/apatit` | +| `image.repository` | Container image repository | `ghcr.io/emergingtravel/apatit` | | `image.tag` | Container image tag (defaults to chart appVersion) | `""` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `imagePullSecrets` | Secrets for pulling images from private registries | `[]` | @@ -321,13 +321,13 @@ This chart is configured with security best practices: ## Links -- [Source Code](https://github.com/ostrovok-tech/apatit) +- [Source Code](https://github.com/emergingtravel/apatit) - [ping-admin.com](https://ping-admin.com/) - [Helm Documentation](https://helm.sh/docs/) ## Maintainers -- **Ostrovok! Tech** - [GitHub](https://github.com/ostrovok-tech) +- **Emerging Travel Inc.** - [GitHub](https://github.com/emergingtravel) ## License diff --git a/deploy/helm/templates/ingress.yaml b/deploy/helm/templates/ingress.yaml index de81b64..d5f5e87 100644 --- a/deploy/helm/templates/ingress.yaml +++ b/deploy/helm/templates/ingress.yaml @@ -5,6 +5,9 @@ metadata: name: {{ include "apatit.fullname" . }} labels: {{- include "apatit.labels" . | nindent 4 }} + {{- with .Values.ingress.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} {{- with .Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/deploy/helm/values.yaml b/deploy/helm/values.yaml index 738cbd5..b9dedd2 100644 --- a/deploy/helm/values.yaml +++ b/deploy/helm/values.yaml @@ -1,3 +1,4 @@ +--- # Default values for APATIT. # This is a YAML-formatted file. # Declare variables to be passed into your templates. @@ -7,20 +8,21 @@ replicaCount: 1 # This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/ image: - repository: ghcr.io/ostrovok-tech/apatit + repository: ghcr.io/emergingtravel/apatit # This sets the pull policy for images. pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "" -# This is for the secretes for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ +# This is for the secretes for pulling an image from a private repository +# More information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ imagePullSecrets: [] # This is to override the chart name. nameOverride: "" fullnameOverride: "" # This is for setting Kubernetes Annotations to a Pod. -# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ podAnnotations: {} # prometheus.io/scrape: "true" # prometheus.io/port: "8080" @@ -56,6 +58,9 @@ service: ingress: enabled: false className: "" + labels: {} + # my-custom-label: my-value + # environment: prod annotations: {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" @@ -81,7 +86,8 @@ resources: cpu: 100m memory: 128Mi -# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ +# This is to setup the liveness and readiness probes +# More information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ livenessProbe: httpGet: path: /metrics @@ -112,9 +118,9 @@ affinity: {} # Set variables as secret envSecrets: - - name: # API_KEY - secretName: # ping-admin-secret - secretKey: # readonly-api-key + - name: # API_KEY + secretName: # ping-admin-secret + secretKey: # readonly-api-key # App configuration env: {} @@ -122,6 +128,7 @@ env: {} # TASK_IDS: "" # Task IDs from table ID Column https://ping-admin.com/tasks/ # LISTEN_ADDRESS: ":8080" # LOG_LEVEL: "info" + # LOCATIONS_FILE: "locations.json" # ENG_MP_NAMES: "true" # REFRESH_INTERVAL: 3m # API_UPDATE_DELAY: 4m @@ -136,6 +143,7 @@ args: [] # - "--task-ids=" # Task IDs from table ID Column https://ping-admin.com/tasks/" # - "--listen-address=:8080" # - "--log-level=info" + # - "--locations-file=locations.json" # - "--eng-mp-names=true" # - "--refresh-interval=3m" # - "--api-update-delay=4m" diff --git a/internal/version/version.go b/internal/version/version.go index b52bfb3..44e65dc 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -5,8 +5,8 @@ package version // Example: go build -ldflags "-X 'apatit/internal/version.Version=1.1.0'" var ( Name = "apatit" - Version = "v1.0.0" - Owner = "ostrovok.tech" + Version = "v1.1.3" + Owner = "emerging.travel" ) const (