Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement v1beta2 api #259

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
12e74a1
feat: support for services v2
shreddedbacon Jan 5, 2024
f1317d0
chore: remove pendingmessage functionality
shreddedbacon Jan 5, 2024
c5c260a
feat: support for passing new env service info to api
shreddedbacon Jan 9, 2024
b32c8eb
refactor: move v1beta1 related functions into their own api or contro…
shreddedbacon Jan 9, 2024
e7e1823
feat: add v1beta2 api
shreddedbacon Jan 9, 2024
f7e12fd
refactor: remove resources after theyve completed reconciling
shreddedbacon Jan 24, 2024
b273daa
refactor: tidy up fmt and make metrics more available
shreddedbacon Mar 15, 2024
812c208
Merge branch 'main' into v1beta2-api
shreddedbacon Apr 5, 2024
9dfae27
chore: port #249 into v1beta2 controller
shreddedbacon Apr 5, 2024
acf3e74
chore: bump dependencies
shreddedbacon Apr 8, 2024
a786ef6
chore: merge branch 'main' into v1beta2-api
shreddedbacon May 1, 2024
0edaad6
Merge pull request #247 from uselagoon/v1beta2-api
shreddedbacon May 2, 2024
8c201c5
chore: merge v1beta2 and merge conflict fixes
shreddedbacon May 2, 2024
5de8e7b
chore: minor formatting fixes
shreddedbacon May 2, 2024
d1b45f2
fix: v1beta1 crd changes
shreddedbacon May 2, 2024
48f4ee4
test: add main-v1beta2
shreddedbacon May 2, 2024
710e627
Merge pull request #246 from uselagoon/remove-pendingmessages-feature
shreddedbacon May 2, 2024
71190f6
chore: merge main-v1beta2 fix initial conflicts
shreddedbacon May 2, 2024
7d5190e
fix: add environment services changes to v1beta2 controller and other…
shreddedbacon May 2, 2024
099d915
Merge pull request #248 from uselagoon/environment-services
shreddedbacon May 2, 2024
dbc3f2f
chore: merge main fix conflicts
shreddedbacon Jul 28, 2024
3b81a92
chore: merge branch 'main' into main-v1beta2
shreddedbacon Jul 29, 2024
7393510
chore: remove harbor 2.1.x and under support
shreddedbacon Jun 7, 2024
34e136f
chore: merge main fix conflict
shreddedbacon Aug 1, 2024
56a2e9e
chore: merge branch 'main' into main-v1beta2
shreddedbacon Aug 8, 2024
9c569f2
chore: add project/environment ids as envvars to builds and tasks
shreddedbacon Sep 11, 2024
1f2279d
Merge pull request #263 from uselagoon/v1beta2-env-project-ids
shreddedbacon Sep 16, 2024
6fcd8f6
Merge pull request #242 from uselagoon/remove-harbor-2.1.x-support
shreddedbacon Oct 1, 2024
407b91f
refactor: use status conditions to store build status
shreddedbacon Oct 2, 2024
5c11cc3
Merge pull request #265 from uselagoon/buildcrd-status-fields
shreddedbacon Oct 14, 2024
407232f
chore: bump go and other versions
shreddedbacon Oct 14, 2024
91a9226
Merge pull request #266 from uselagoon/go-1.22-updates
shreddedbacon Oct 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/remote-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
pull_request:
branches:
- main
- main-v1beta2

jobs:
test-suite:
Expand Down Expand Up @@ -51,7 +52,7 @@ jobs:
- name: Setup correct Go version
uses: actions/setup-go@v2
with:
go-version: '1.20'
go-version: '1.22'
- name: Install kubebuilder
run: |
#kubebuilder
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.20-alpine AS builder
FROM golang:1.22-alpine AS builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=false"
CRD_OPTIONS ?= "crd"

CONTROLLER_NAMESPACE ?= lagoon-builddeploy

Expand Down Expand Up @@ -102,7 +102,7 @@ ifeq (, $(shell which controller-gen))
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
cd $$CONTROLLER_GEN_TMP_DIR ;\
go mod init tmp ;\
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.6.2 ;\
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.2 ;\
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
}
CONTROLLER_GEN=$(GOBIN)/controller-gen
Expand Down
6 changes: 6 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ domain: lagoon.sh
multigroup: true
repo: github.com/uselagoon/remote-controller
resources:
- group: crd
kind: LagoonBuild
version: v1beta2
- group: crd
kind: LagoonTask
version: v1beta2
- group: crd
kind: LagoonBuild
version: v1beta1
Expand Down
105 changes: 105 additions & 0 deletions apis/lagoon/v1beta1/helpers_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
package v1beta1

import (
"testing"
)

func TestCheckLagoonVersion(t *testing.T) {
type args struct {
build *LagoonBuild
checkVersion string
}
tests := []struct {
name string
args args
want bool
}{
{
name: "test1",
args: args{
build: &LagoonBuild{
Spec: LagoonBuildSpec{
Project: Project{
Variables: LagoonVariables{
Project: []byte(`[{"name":"LAGOON_SYSTEM_CORE_VERSION","value":"v2.12.0","scope":"internal_system"}]`),
},
},
},
},
checkVersion: "2.12.0",
},
want: true,
},
{
name: "test2",
args: args{
build: &LagoonBuild{
Spec: LagoonBuildSpec{
Project: Project{
Variables: LagoonVariables{
Project: []byte(`[{"name":"LAGOON_SYSTEM_CORE_VERSION","value":"v2.11.0","scope":"internal_system"}]`),
},
},
},
},
checkVersion: "2.12.0",
},
want: false,
},
{
name: "test3",
args: args{
build: &LagoonBuild{
Spec: LagoonBuildSpec{
Project: Project{
Variables: LagoonVariables{
Project: []byte(`[]`),
},
},
},
},
checkVersion: "2.12.0",
},
want: false,
},
{
name: "test4",
args: args{
build: &LagoonBuild{
Spec: LagoonBuildSpec{
Project: Project{
Variables: LagoonVariables{
Project: []byte(`[{"name":"LAGOON_SYSTEM_CORE_VERSION","value":"v2.12.0","scope":"internal_system"}]`),
},
},
},
},
checkVersion: "v2.12.0",
},
want: true,
},
{
name: "test5",
args: args{
build: &LagoonBuild{
Spec: LagoonBuildSpec{
Project: Project{
Variables: LagoonVariables{
Project: []byte(`[{"name":"LAGOON_SYSTEM_CORE_VERSION","value":"v2.11.0","scope":"internal_system"}]`),
},
},
},
},
checkVersion: "v2.12.0",
},
want: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := CheckLagoonVersion(tt.args.build, tt.args.checkVersion); got != tt.want {
t.Errorf("CheckLagoonVersion() = %v, want %v", got, tt.want)
}
})
}
}
Loading
Loading