Commit Graph

57 Commits

Author SHA1 Message Date
raul 6e71215180 Add azure webhook support 2024-01-16 12:34:46 +01:00
Alejandro Ruiz 7c512f66a5 Replace mocks with new generic/fake package
* remove unnecessary mocks
2024-01-12 16:21:03 +01:00
Alejandro Ruiz cc95fddcdd Remove unused websocket-based webhooks 2024-01-12 16:21:03 +01:00
Mario Manno 2ac0a49328 Bump to wrangler/v2 2024-01-12 16:21:03 +01:00
raul 935bcfd37b
Bump to year 2024 and change copyright to SUSE 2024-01-03 17:26:28 +01:00
Raul Cabello Martin a029097851
Add http proxy env vars to containers and initContainers created by GitJob (#380) 2023-12-15 09:17:38 +01:00
Raul Cabello Martin 1d4a2bbab9
Add SecurityContext to deployment and init container (#331)
* Add SecurityContext to deployment and init container
2023-10-16 14:58:36 +02:00
dependabot[bot] 4c06e24a74
chore(deps): Bump golang.org/x/net from 0.13.0 to 0.17.0 in /pkg/apis
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.13.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.13.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-12 14:11:50 +00:00
Alejandro Ruiz 9304b01c92
Use a separate Go module for pkg/apis (#326) 2023-10-09 09:30:37 +02:00
Raul Cabello Martin 873e7ba2a8
Remove tekton for cloning git repos (#302)
* Remove tekton

Tekton was used to clone a git repository in an init container. This
is replaced  by an internal tool called gitcloner that uses go-git to clone the
repositories.

gitcloner is a cli tool that clones a specific branch of a git
repository.

GitJob uses gitcloner in an init-container to clone a git repository
into a emptyDir volume. Then the job container uses this emptyDir volume
that contains the repo cloned
2023-09-20 11:31:14 +02:00
raul ede7c2e991
replace github.com/pkg/errors with errors 2023-08-22 12:14:24 +02:00
raul 38609d760a
Create git repos for integration tests programatically 2023-08-22 12:14:24 +02:00
raul fd01173117
Use go-git for getting the latest commit
Remove the git shell out command. Use go-git instead.
2023-08-22 12:14:19 +02:00
Mario Manno 75c0c1db16
Fix gitrepo retry failed jobs (#286)
Add propagationPolicy to delete job

Deleting jobs via the API does not remove their pods. This PR adds the
propagationPolicy to both delete request, the ForceUpdateGeneration one,
which previously didn't work and the new one, which is used to retrigger
failed jobs.

* Revert "Merge pull request #272 from rancher/add-default-ttl"
* Remove unused context value
* Add debug logging to job controller
* Remove the job cache from apply, so jobs can be recreated
2023-08-10 08:44:19 +02:00
Mario Manno ea7c7c9c73 Add default ttl for jobs of 24h 2023-07-21 14:45:31 +02:00
Mario Manno bae51dbf19 Delete job so retry happens, if forcing or job failed 2023-07-19 13:04:42 +02:00
Mario Manno fb72780c8b Remove gosec warning for git exec 2023-04-21 11:56:27 +02:00
Mario Manno e156ce7a32 Remove pprof and fix linter warnings
Add more linters, but still not the full set from fleet/fleet.
2023-04-21 10:57:10 +02:00
Tim Hardeck 1b974c1856
Update generated code after Wrangler bump to 1.1.1 2023-03-08 09:22:53 +01:00
Mario Manno e12d292f36 Git validation for URLs was too strict
Git URLs (see man git-url) can be in "scp-like" syntax and net/url
cannot parse that.
2023-01-25 10:45:01 +01:00
Mario Manno bf6029c98d fixup! Add validation to git params 2023-01-24 16:51:09 +01:00
Mario Manno 48108ed7c7 Add validation to git params
Co-authored-by: Paulo Gomes <paulo.gomes@suse.com>
2023-01-24 11:11:04 +01:00
Mario Manno 33b3892c46 Import git ls-remote helper from wrangler
Make all funcs private, delete unused code from wrangler.
2023-01-24 11:06:59 +01:00
Tim Hardeck 235b3ff202
Update year in Rancher Labs copyright statement
to prevent drone from failing.
2023-01-02 10:23:02 +01:00
Tim Hardeck bf72b51624
Retry git repo updates after errors
to allow git repos to be usable after short network outages or similar
issues.

Without this change it was necessary to manually force an update to
make the gitrepo reusable again.
2022-11-28 11:44:43 +01:00
Mario Manno d21a9dc19b Add double-dash to job's args
Otherwise tekton-entrypoint will parse some of the options
2022-08-16 18:27:55 +02:00
Guilherme Macedo 997c1a98bd
Update Go to v1.17 and specify exact tags for SLE-BCI images (#50)
Signed-off-by: Guilherme Macedo <guilherme.macedo@suse.com>
2022-06-01 17:13:39 +02:00
raulcabello 3909640697 Update copyright year to 2022 by running go generate 2022-01-26 17:48:03 +01:00
Daishan 73501bd0e1 Add ability to update gitjob with branch in webhook payload
Today in gitjob's webhook design, it takes incoming webhook payload and
find the gitjob that matches the repo url regarding of which branch the
commit is coming from. This will cause a problem where a single webhook
event will trigger update on every branch of gitjob. This commit adds
the ability to read branch/tag from payload and only update gitjob that
matches branch in the payload. It also adds the ability to read from tag
so that tag event is separated from push event.
2021-11-02 14:22:21 -07:00
Nick Gerace 09e4aa2add Generate both apiext v1 and v1beta1 CRDs 2021-07-27 16:44:52 -04:00
Daishan d463c21619 Update gitjob crd to v1 2021-05-21 18:30:21 -07:00
Daishan ef5fe7ff24 Add webhook support 2021-04-08 13:50:37 -07:00
Daishan 3ee45bd7ba Update wrangler 2021-04-06 16:29:21 -07:00
bgoareguer 171cf63340
Add support for HTTP_PROXY variables when fetching public Helm charts (#25)
* Add support for HTTP_PROXY variables when fetching public Helm charts

Co-authored-by: Bertrand Goareguer <bertrand.goareguer@orange.com>
2021-01-21 09:20:11 -07:00
Daishan dfbcffa7af Add user 1000 2021-01-08 14:08:57 -07:00
Daishan 7cf1feba18 Go generate 2021-01-07 11:38:25 -07:00
Daishan 69cedcf781 Fix custom ca cert and insecureSkipTls
This PR fixed several things:
1. Support cabundle to be specified for git repo
2. Fix insecureSkipTLS is wrong
3. Fix bug where git repo has extra port
2020-12-10 21:37:57 -07:00
Timofey Ilinykh 5b1ff60fdb
Wire http proxy settings to clone container 2020-11-03 01:32:39 +01:00
Daishan 731c348657 Update wrangler, fix http and ssh auth 2020-10-19 17:47:24 -07:00
Darren Shepherd 61ca363a77
Merge pull request #13 from StrongMonkey/add-force-update-generation
Use forceUpdateGeneration for force-update job
2020-10-02 16:01:09 -07:00
Daishan 19f6e7ec6a Update wrangler to inclide ls-remote fix, add profile 2020-10-02 15:52:40 -07:00
Daishan 4f8a971073 Update wrangler to v0.7.2 2020-10-02 14:59:43 -07:00
Daishan 1b9cc0b1ce Use forceUpdateGeneration for force-update job
Use field(int64) forceUpdateGeneration to replace forceUpdate timestamp
to control when it should re-run the job.
2020-10-01 11:27:36 -07:00
Daishan f81893a4f0 Remove no delete 2020-09-30 23:49:22 -07:00
Daishan df1abf1be1 Mark gitjob to active if job completes 2020-09-30 16:15:33 -07:00
Daishan 9223171f73 Set termination message and stall condition 2020-09-28 10:27:20 -07:00
Daishan 44b2fbc506 Make tekton images configrable 2020-09-17 12:38:14 -07:00
Daishan 4d862e306b Add custom column, forceUpdate 2020-08-28 09:04:48 -07:00
Daishan d705dae227 More kstatus, use new wrangler git library 2020-08-27 12:39:58 -07:00
Daishan 3feee6d7cc Add kstatus, sync job to gitjob, webhook auto-creation 2020-08-20 13:01:45 -07:00