mirror of
https://github.com/bapung/gitea-runner-operator.git
synced 2026-06-21 23:48:43 +00:00
Compare commits
3 Commits
license-to
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 776a3fbd7f | |||
| e6755bf2ba | |||
| 6298940adb |
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026 bapung
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -185,3 +185,7 @@ The default runner image uses `dind-rootless`. This requires the pod to run with
|
|||||||
- Helm Chart
|
- Helm Chart
|
||||||
- Custom Runner Job Spec definition
|
- Custom Runner Job Spec definition
|
||||||
- Push mode using Webhook trigger
|
- Push mode using Webhook trigger
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
||||||
|
|||||||
@@ -1,17 +1,23 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2026.
|
Copyright 2026 bapung.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
you may not use this file except in compliance with the License.
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
You may obtain a copy of the License at
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
See the License for the specific language governing permissions and
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
limitations under the License.
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Package v1alpha1 contains API Schema definitions for the gitea v1alpha1 API group.
|
// Package v1alpha1 contains API Schema definitions for the gitea v1alpha1 API group.
|
||||||
|
|||||||
@@ -1,17 +1,23 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2026.
|
Copyright 2026 bapung.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
you may not use this file except in compliance with the License.
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
You may obtain a copy of the License at
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
See the License for the specific language governing permissions and
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
limitations under the License.
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package v1alpha1
|
package v1alpha1
|
||||||
|
|||||||
@@ -1,19 +1,25 @@
|
|||||||
//go:build !ignore_autogenerated
|
//go:build !ignore_autogenerated
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright 2026.
|
Copyright 2026 bapung.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
you may not use this file except in compliance with the License.
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
You may obtain a copy of the License at
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
See the License for the specific language governing permissions and
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
limitations under the License.
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Code generated by controller-gen. DO NOT EDIT.
|
// Code generated by controller-gen. DO NOT EDIT.
|
||||||
|
|||||||
26
cmd/main.go
26
cmd/main.go
@@ -1,17 +1,23 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2026.
|
Copyright 2026 bapung.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
you may not use this file except in compliance with the License.
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
You may obtain a copy of the License at
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
See the License for the specific language governing permissions and
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
limitations under the License.
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|||||||
@@ -1,15 +1,21 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2026.
|
Copyright 2026 bapung.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
you may not use this file except in compliance with the License.
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
You may obtain a copy of the License at
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
See the License for the specific language governing permissions and
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
limitations under the License.
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
*/
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
|
|||||||
@@ -1,17 +1,23 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2026.
|
Copyright 2026 bapung.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
you may not use this file except in compliance with the License.
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
You may obtain a copy of the License at
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
See the License for the specific language governing permissions and
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
limitations under the License.
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package controller
|
package controller
|
||||||
|
|||||||
@@ -1,17 +1,23 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2026.
|
Copyright 2026 bapung.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
you may not use this file except in compliance with the License.
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
You may obtain a copy of the License at
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
See the License for the specific language governing permissions and
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
limitations under the License.
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package controller
|
package controller
|
||||||
|
|||||||
@@ -1,17 +1,23 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2026.
|
Copyright 2026 bapung.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
you may not use this file except in compliance with the License.
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
You may obtain a copy of the License at
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
See the License for the specific language governing permissions and
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
limitations under the License.
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package controller
|
package controller
|
||||||
|
|||||||
@@ -1,17 +1,23 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2026.
|
Copyright 2026 bapung.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
you may not use this file except in compliance with the License.
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
You may obtain a copy of the License at
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
See the License for the specific language governing permissions and
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
limitations under the License.
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package gitea
|
package gitea
|
||||||
@@ -125,6 +131,9 @@ func (c *HTTPClient) GetRunnerStats(
|
|||||||
) (*RunnerStats, error) {
|
) (*RunnerStats, error) {
|
||||||
switch scope {
|
switch scope {
|
||||||
case v1alpha1.RunnerGroupScopeRepo:
|
case v1alpha1.RunnerGroupScopeRepo:
|
||||||
|
if user != "" {
|
||||||
|
return c.getRunnerStatsForRepo(ctx, giteaURL, authToken, user, repo, labels)
|
||||||
|
}
|
||||||
return c.getRunnerStatsForRepo(ctx, giteaURL, authToken, org, repo, labels)
|
return c.getRunnerStatsForRepo(ctx, giteaURL, authToken, org, repo, labels)
|
||||||
case v1alpha1.RunnerGroupScopeOrg:
|
case v1alpha1.RunnerGroupScopeOrg:
|
||||||
return c.getRunnerStatsForOrg(ctx, giteaURL, authToken, org, labels)
|
return c.getRunnerStatsForOrg(ctx, giteaURL, authToken, org, labels)
|
||||||
|
|||||||
@@ -1,17 +1,23 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2026.
|
Copyright 2026 bapung.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
you may not use this file except in compliance with the License.
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
You may obtain a copy of the License at
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
See the License for the specific language governing permissions and
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
limitations under the License.
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package gitea
|
package gitea
|
||||||
@@ -74,6 +80,21 @@ func TestHTTPClient_GetRunnerStats(t *testing.T) {
|
|||||||
expectedQueued: 0, // No runner capabilities provided -> no match
|
expectedQueued: 0, // No runner capabilities provided -> no match
|
||||||
expectedError: false,
|
expectedError: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "repo scope (user owned)",
|
||||||
|
scope: v1alpha1.RunnerGroupScopeRepo,
|
||||||
|
user: "testuser",
|
||||||
|
repo: "testrepo",
|
||||||
|
labels: []string{"linux"},
|
||||||
|
mockResponse: ActionWorkflowJobsResponse{
|
||||||
|
TotalCount: 1,
|
||||||
|
Jobs: []ActionWorkflowJob{
|
||||||
|
{ID: 1, Status: "queued", Labels: []string{"linux"}},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
expectedQueued: 1,
|
||||||
|
expectedError: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "global scope with specific labels",
|
name: "global scope with specific labels",
|
||||||
scope: v1alpha1.RunnerGroupScopeGlobal,
|
scope: v1alpha1.RunnerGroupScopeGlobal,
|
||||||
@@ -129,9 +150,13 @@ func TestHTTPClient_GetRunnerStats(t *testing.T) {
|
|||||||
expectedPath := ""
|
expectedPath := ""
|
||||||
switch tt.scope {
|
switch tt.scope {
|
||||||
case v1alpha1.RunnerGroupScopeRepo:
|
case v1alpha1.RunnerGroupScopeRepo:
|
||||||
expectedPath = "/api/v1/repos/testorg/testrepo/actions/jobs"
|
owner := tt.org
|
||||||
|
if tt.user != "" {
|
||||||
|
owner = tt.user
|
||||||
|
}
|
||||||
|
expectedPath = "/api/v1/repos/" + owner + "/" + tt.repo + "/actions/jobs"
|
||||||
case v1alpha1.RunnerGroupScopeOrg:
|
case v1alpha1.RunnerGroupScopeOrg:
|
||||||
expectedPath = "/api/v1/orgs/testorg/actions/jobs"
|
expectedPath = "/api/v1/orgs/" + tt.org + "/actions/jobs"
|
||||||
case v1alpha1.RunnerGroupScopeGlobal:
|
case v1alpha1.RunnerGroupScopeGlobal:
|
||||||
expectedPath = "/api/v1/admin/actions/jobs"
|
expectedPath = "/api/v1/admin/actions/jobs"
|
||||||
case v1alpha1.RunnerGroupScopeUser:
|
case v1alpha1.RunnerGroupScopeUser:
|
||||||
|
|||||||
@@ -1,17 +1,23 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2026.
|
Copyright 2026 bapung.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
you may not use this file except in compliance with the License.
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
You may obtain a copy of the License at
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
See the License for the specific language governing permissions and
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
limitations under the License.
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package e2e
|
package e2e
|
||||||
|
|||||||
@@ -1,17 +1,23 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2026.
|
Copyright 2026 bapung.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
you may not use this file except in compliance with the License.
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
You may obtain a copy of the License at
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
See the License for the specific language governing permissions and
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
limitations under the License.
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package e2e
|
package e2e
|
||||||
|
|||||||
@@ -1,17 +1,23 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2026.
|
Copyright 2026 bapung.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
you may not use this file except in compliance with the License.
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
You may obtain a copy of the License at
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
See the License for the specific language governing permissions and
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
limitations under the License.
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package utils
|
package utils
|
||||||
|
|||||||
Reference in New Issue
Block a user