gitops 1.1.1__tar.gz → 1.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. gitops-1.1.2/.release-please-manifest.json +5 -0
  2. {gitops-1.1.1 → gitops-1.1.2}/CHANGELOG.md +7 -0
  3. {gitops-1.1.1 → gitops-1.1.2}/PKG-INFO +1 -1
  4. {gitops-1.1.1 → gitops-1.1.2}/charts/gitops/CHANGELOG.md +7 -0
  5. {gitops-1.1.1 → gitops-1.1.2}/charts/gitops/Chart.yaml +1 -1
  6. {gitops-1.1.1 → gitops-1.1.2}/charts/gitops/templates/deployment.yml +0 -2
  7. {gitops-1.1.1 → gitops-1.1.2}/gitops/__init__.py +1 -1
  8. gitops-1.1.2/gitops_server/version.py +1 -0
  9. {gitops-1.1.1 → gitops-1.1.2}/gitops_server/workers/deployer/deploy.py +52 -24
  10. {gitops-1.1.1 → gitops-1.1.2}/pyproject.toml +1 -1
  11. gitops-1.1.1/.release-please-manifest.json +0 -5
  12. gitops-1.1.1/gitops_server/version.py +0 -1
  13. {gitops-1.1.1 → gitops-1.1.2}/.dockerignore +0 -0
  14. {gitops-1.1.1 → gitops-1.1.2}/.github/workflows/release-please.yaml +0 -0
  15. {gitops-1.1.1 → gitops-1.1.2}/.github/workflows/test.yml +0 -0
  16. {gitops-1.1.1 → gitops-1.1.2}/.gitignore +0 -0
  17. {gitops-1.1.1 → gitops-1.1.2}/.mise.toml +0 -0
  18. {gitops-1.1.1 → gitops-1.1.2}/.pre-commit-config.yaml +0 -0
  19. {gitops-1.1.1 → gitops-1.1.2}/Dockerfile +0 -0
  20. {gitops-1.1.1 → gitops-1.1.2}/LICENSE +0 -0
  21. {gitops-1.1.1 → gitops-1.1.2}/README.md +0 -0
  22. {gitops-1.1.1 → gitops-1.1.2}/charts/gitops/.helmignore +0 -0
  23. {gitops-1.1.1 → gitops-1.1.2}/charts/gitops/README.md +0 -0
  24. {gitops-1.1.1 → gitops-1.1.2}/charts/gitops/templates/_helpers.tpl +0 -0
  25. {gitops-1.1.1 → gitops-1.1.2}/charts/gitops/templates/certificate.yml +0 -0
  26. {gitops-1.1.1 → gitops-1.1.2}/charts/gitops/templates/environment.yml +0 -0
  27. {gitops-1.1.1 → gitops-1.1.2}/charts/gitops/templates/ingress.yml +0 -0
  28. {gitops-1.1.1 → gitops-1.1.2}/charts/gitops/templates/issuer.yml +0 -0
  29. {gitops-1.1.1 → gitops-1.1.2}/charts/gitops/templates/secrets.yml +0 -0
  30. {gitops-1.1.1 → gitops-1.1.2}/charts/gitops/templates/service.yml +0 -0
  31. {gitops-1.1.1 → gitops-1.1.2}/charts/gitops/templates/serviceaccount.yaml +0 -0
  32. {gitops-1.1.1 → gitops-1.1.2}/charts/gitops/values.yaml +0 -0
  33. {gitops-1.1.1 → gitops-1.1.2}/docker-compose.yml +0 -0
  34. {gitops-1.1.1 → gitops-1.1.2}/gitops/common/__init__.py +0 -0
  35. {gitops-1.1.1 → gitops-1.1.2}/gitops/common/app.py +0 -0
  36. {gitops-1.1.1 → gitops-1.1.2}/gitops/common/utils.py +0 -0
  37. {gitops-1.1.1 → gitops-1.1.2}/gitops/core.py +0 -0
  38. {gitops-1.1.1 → gitops-1.1.2}/gitops/main.py +0 -0
  39. {gitops-1.1.1 → gitops-1.1.2}/gitops/py.typed +0 -0
  40. {gitops-1.1.1 → gitops-1.1.2}/gitops/settings.py +0 -0
  41. {gitops-1.1.1 → gitops-1.1.2}/gitops/shorthands.py +0 -0
  42. {gitops-1.1.1 → gitops-1.1.2}/gitops/utils/__init__.py +0 -0
  43. {gitops-1.1.1 → gitops-1.1.2}/gitops/utils/apps.py +0 -0
  44. {gitops-1.1.1 → gitops-1.1.2}/gitops/utils/async_runner.py +0 -0
  45. {gitops-1.1.1 → gitops-1.1.2}/gitops/utils/cli.py +0 -0
  46. {gitops-1.1.1 → gitops-1.1.2}/gitops/utils/exceptions.py +0 -0
  47. {gitops-1.1.1 → gitops-1.1.2}/gitops/utils/images.py +0 -0
  48. {gitops-1.1.1 → gitops-1.1.2}/gitops/utils/kube.py +0 -0
  49. {gitops-1.1.1 → gitops-1.1.2}/gitops/utils/tags.py +0 -0
  50. {gitops-1.1.1 → gitops-1.1.2}/gitops/utils/yaml.py +0 -0
  51. {gitops-1.1.1 → gitops-1.1.2}/gitops_server/CHANGELOG.md +0 -0
  52. {gitops-1.1.1 → gitops-1.1.2}/gitops_server/README.md +0 -0
  53. {gitops-1.1.1 → gitops-1.1.2}/gitops_server/__init__.py +0 -0
  54. {gitops-1.1.1 → gitops-1.1.2}/gitops_server/app.py +0 -0
  55. {gitops-1.1.1 → gitops-1.1.2}/gitops_server/main.py +0 -0
  56. {gitops-1.1.1 → gitops-1.1.2}/gitops_server/settings.py +0 -0
  57. {gitops-1.1.1 → gitops-1.1.2}/gitops_server/types.py +0 -0
  58. {gitops-1.1.1 → gitops-1.1.2}/gitops_server/utils/__init__.py +0 -0
  59. {gitops-1.1.1 → gitops-1.1.2}/gitops_server/utils/git.py +0 -0
  60. {gitops-1.1.1 → gitops-1.1.2}/gitops_server/utils/github.py +0 -0
  61. {gitops-1.1.1 → gitops-1.1.2}/gitops_server/utils/slack.py +0 -0
  62. {gitops-1.1.1 → gitops-1.1.2}/gitops_server/workers/__init__.py +0 -0
  63. {gitops-1.1.1 → gitops-1.1.2}/gitops_server/workers/deployer/__init__.py +0 -0
  64. {gitops-1.1.1 → gitops-1.1.2}/gitops_server/workers/deployer/hooks.py +0 -0
  65. {gitops-1.1.1 → gitops-1.1.2}/gitops_server/workers/deployer/worker.py +0 -0
  66. {gitops-1.1.1 → gitops-1.1.2}/gitops_server/workers/status_updater/__init__.py +0 -0
  67. {gitops-1.1.1 → gitops-1.1.2}/gitops_server/workers/status_updater/worker.py +0 -0
  68. {gitops-1.1.1 → gitops-1.1.2}/release-please-config.json +0 -0
  69. {gitops-1.1.1 → gitops-1.1.2}/release.py +0 -0
  70. {gitops-1.1.1 → gitops-1.1.2}/ruff.toml +0 -0
  71. {gitops-1.1.1 → gitops-1.1.2}/secrets.example.env +0 -0
  72. {gitops-1.1.1 → gitops-1.1.2}/setup.cfg +0 -0
  73. {gitops-1.1.1 → gitops-1.1.2}/tests/__init__.py +0 -0
  74. {gitops-1.1.1 → gitops-1.1.2}/tests/conftest.py +0 -0
  75. {gitops-1.1.1 → gitops-1.1.2}/tests/sample_data.py +0 -0
  76. {gitops-1.1.1 → gitops-1.1.2}/tests/test_app.py +0 -0
  77. {gitops-1.1.1 → gitops-1.1.2}/tests/test_core.py +0 -0
  78. {gitops-1.1.1 → gitops-1.1.2}/tests/test_deploy.py +0 -0
  79. {gitops-1.1.1 → gitops-1.1.2}/tests/test_git.py +0 -0
  80. {gitops-1.1.1 → gitops-1.1.2}/tests/test_gitops_server.py +0 -0
  81. {gitops-1.1.1 → gitops-1.1.2}/tests/test_utils.py +0 -0
  82. {gitops-1.1.1 → gitops-1.1.2}/tests/utils.py +0 -0
  83. {gitops-1.1.1 → gitops-1.1.2}/tests/webhook_sample_data.py +0 -0
  84. {gitops-1.1.1 → gitops-1.1.2}/uv.lock +0 -0
@@ -0,0 +1,5 @@
1
+ {
2
+ ".": "1.1.2",
3
+ "gitops_server": "0.15.1",
4
+ "charts/gitops": "1.1.2"
5
+ }
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.1.2](https://github.com/uptick/gitops/compare/gitops-v1.1.1...gitops-v1.1.2) (2025-02-14)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **helm:** if a roll back is required; rollback before upgrading ([762cdb3](https://github.com/uptick/gitops/commit/762cdb388162c6b8645ec01f0d1c94c20d948b9f))
9
+
3
10
  ## [1.1.1](https://github.com/uptick/gitops/compare/gitops-v1.1.0...gitops-v1.1.1) (2025-01-24)
4
11
 
5
12
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitops
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: Manage multiple apps across one or more k8s clusters.
5
5
  Author-email: Jarek Głowacki <jarekwg@gmail.com>
6
6
  License-File: LICENSE
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.1.2](https://github.com/uptick/gitops/compare/helm-v1.1.1...helm-v1.1.2) (2025-02-14)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * remove gitops resource limits ([fcd9680](https://github.com/uptick/gitops/commit/fcd9680f6e94e5cb7a286c269aeaa1626c95a181))
9
+
3
10
  ## [1.1.1](https://github.com/uptick/gitops/compare/helm-v1.1.0...helm-v1.1.1) (2025-01-24)
4
11
 
5
12
 
@@ -2,4 +2,4 @@ apiVersion: v1
2
2
  appVersion: "1.0"
3
3
  description: GitOps Server Helm chart.
4
4
  name: gitops
5
- version: 1.1.1
5
+ version: 1.1.2
@@ -40,8 +40,6 @@ spec:
40
40
  resources:
41
41
  requests:
42
42
  memory: "750Mi"
43
- limits:
44
- memory: "1500Mi"
45
43
 
46
44
  envFrom:
47
45
  - configMapRef:
@@ -6,7 +6,7 @@ from gitops.utils.apps import App, get_app_details, get_apps
6
6
 
7
7
  from .utils.cli import success, warning
8
8
 
9
- __version__ = "1.1.1"
9
+ __version__ = "1.1.2"
10
10
 
11
11
 
12
12
  # Checking gitops version matches cluster repo version.
@@ -0,0 +1 @@
1
+ __version__ = "1.1.2"
@@ -11,7 +11,7 @@ from opentelemetry import trace
11
11
 
12
12
  from gitops.common.app import App
13
13
  from gitops_server import settings
14
- from gitops_server.types import AppDefinitions, UpdateAppResult
14
+ from gitops_server.types import AppDefinitions, RunOutput, UpdateAppResult
15
15
  from gitops_server.utils import get_repo_name_from_url, github, run, slack
16
16
  from gitops_server.utils.git import temp_repo
17
17
 
@@ -133,6 +133,17 @@ class Deployer:
133
133
  )
134
134
  return update_result
135
135
 
136
+ async def rollback_deployment(self, app: App) -> None:
137
+ with tracer.start_as_current_span("rollback_deployment", attributes={"app": app.name}):
138
+ logger.warning(
139
+ "Rolling back %s deployment due to previous failed helm install",
140
+ app.name,
141
+ )
142
+ await run(
143
+ f"helm rollback --namespace={app.namespace} {app.name}",
144
+ suppress_errors=True,
145
+ )
146
+
136
147
  async def update_app_deployment(self, app: App) -> UpdateAppResult | None:
137
148
  app.set_value("deployment.labels.gitops/deploy_id", self.deploy_id)
138
149
  app.set_value("deployment.labels.gitops/status", github.STATUSES.in_progress)
@@ -155,6 +166,40 @@ class Deployer:
155
166
  os.fsync(cfg.fileno())
156
167
 
157
168
  with tracer.start_as_current_span("helm_upgrade"):
169
+
170
+ async def upgrade_helm_git() -> RunOutput:
171
+ result = await run(
172
+ "helm secrets upgrade --create-namespace"
173
+ f" --history-max {MAX_HELM_HISTORY}"
174
+ " --install"
175
+ " --timeout=600s"
176
+ f"{' --set skip_migrations=true' if self.skip_migrations else ''}"
177
+ f" -f {cfg.name}"
178
+ f" --namespace={app.namespace}"
179
+ f" {app.name}"
180
+ f" {chart_folder_path}",
181
+ suppress_errors=True,
182
+ )
183
+ return result
184
+
185
+ result = await upgrade_helm_git()
186
+ if result["exit_code"] != 0 and "is in progress" in result["output"]:
187
+ await self.rollback_deployment(app)
188
+ result = await upgrade_helm_git()
189
+
190
+ elif app.chart.type == "helm":
191
+ span.set_attribute("gitops.chart.type", "helm")
192
+ with tempfile.NamedTemporaryFile(suffix=".yml") as cfg:
193
+ cfg.write(json.dumps(app.values).encode())
194
+ cfg.flush()
195
+ os.fsync(cfg.fileno())
196
+ chart_version_arguments = f" --version={app.chart.version}" if app.chart.version else ""
197
+ with tracer.start_as_current_span("helm_repo_add"):
198
+ await run(f"helm repo add {app.chart.helm_repo} {app.chart.helm_repo_url}")
199
+
200
+ with tracer.start_as_current_span("helm_upgrade"):
201
+
202
+ async def upgrade_helm_chart() -> RunOutput:
158
203
  result = await run(
159
204
  "helm secrets upgrade --create-namespace"
160
205
  f" --history-max {MAX_HELM_HISTORY}"
@@ -164,32 +209,15 @@ class Deployer:
164
209
  f" -f {cfg.name}"
165
210
  f" --namespace={app.namespace}"
166
211
  f" {app.name}"
167
- f" {chart_folder_path}",
212
+ f" {app.chart.helm_chart} {chart_version_arguments}",
168
213
  suppress_errors=True,
169
214
  )
170
- elif app.chart.type == "helm":
171
- span.set_attribute("gitops.chart.type", "helm")
172
- with tempfile.NamedTemporaryFile(suffix=".yml") as cfg:
173
- cfg.write(json.dumps(app.values).encode())
174
- cfg.flush()
175
- os.fsync(cfg.fileno())
176
- chart_version_arguments = f" --version={app.chart.version}" if app.chart.version else ""
177
- with tracer.start_as_current_span("helm_repo_add"):
178
- await run(f"helm repo add {app.chart.helm_repo} {app.chart.helm_repo_url}")
215
+ return result
179
216
 
180
- with tracer.start_as_current_span("helm_upgrade"):
181
- result = await run(
182
- "helm secrets upgrade --create-namespace"
183
- f" --history-max {MAX_HELM_HISTORY}"
184
- " --install"
185
- " --timeout=600s"
186
- f"{' --set skip_migrations=true' if self.skip_migrations else ''}"
187
- f" -f {cfg.name}"
188
- f" --namespace={app.namespace}"
189
- f" {app.name}"
190
- f" {app.chart.helm_chart} {chart_version_arguments}",
191
- suppress_errors=True,
192
- )
217
+ result = await upgrade_helm_chart()
218
+ if result["exit_code"] != 0 and "is in progress" in result["output"]:
219
+ await self.rollback_deployment(app)
220
+ result = await upgrade_helm_chart()
193
221
  else:
194
222
  logger.warning("Local is not implemented yet")
195
223
  return None
@@ -1,7 +1,7 @@
1
1
 
2
2
  [project]
3
3
  name = "gitops"
4
- version = "1.1.1"
4
+ version = "1.1.2"
5
5
  description = "Manage multiple apps across one or more k8s clusters."
6
6
  requires-python = ">=3.12"
7
7
  readme = "README.md"
@@ -1,5 +0,0 @@
1
- {
2
- ".": "1.1.1",
3
- "gitops_server": "0.15.1",
4
- "charts/gitops": "1.1.1"
5
- }
@@ -1 +0,0 @@
1
- __version__ = "1.1.1"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes