Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
File renamed without changes.
5 changes: 3 additions & 2 deletions go/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ RUN --mount=type=cache,target=/root/go/pkg/mod,rw \
go mod download

# Copy the go source
COPY api api
COPY cmd cmd
COPY pkg pkg
COPY internal internal
COPY controller controller
# Build
# the GOARCH has not a default value to allow the binary be built according to the host where the command
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
Expand All @@ -30,7 +31,7 @@ ARG LDFLAGS
RUN --mount=type=cache,target=/root/go/pkg/mod,rw \
--mount=type=cache,target=/root/.cache/go-build,rw \
echo "Building on $BUILDPLATFORM -> linux/$TARGETARCH" && \
CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -ldflags "$LDFLAGS" -o manager controller/cmd/main.go
CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -ldflags "$LDFLAGS" -o manager cmd/controller/main.go

### STAGE 2: final image
# Use distroless as minimal base image to package the manager binary
Expand Down
8 changes: 4 additions & 4 deletions go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ endif
##@ Development

.PHONY: manifests
manifests: controller-gen generate ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
manifests: controller-gen generate ## Generate ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd paths="./..." output:crd:artifacts:config=config/crd/bases

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="controller/hack/boilerplate.go.txt" paths="./..."
$(CONTROLLER_GEN) object:headerFile="internal/controller/hack/boilerplate.go.txt" paths="./..."

.PHONY: fmt
fmt: ## Run go fmt against code.
Expand Down Expand Up @@ -94,7 +94,7 @@ build: bin/kagent-linux-amd64.sha256 bin/kagent-linux-arm64.sha256 bin/kagent-da

.PHONY: run
run: manifests generate fmt vet ## Run a controller from your host.
go run ./controller/cmd/main.go
go run ./cmd/controller/main.go

.PHONY: test
test:
Expand Down
2 changes: 1 addition & 1 deletion go/cli/internal/cli/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"
"strings"

"github.com/kagent-dev/kagent/go/controller/api/v1alpha1"
"github.com/kagent-dev/kagent/go/api/v1alpha1"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion go/cli/internal/cli/const_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"
"testing"

"github.com/kagent-dev/kagent/go/controller/api/v1alpha1"
"github.com/kagent-dev/kagent/go/api/v1alpha1"
)

func TestGetModelProvider(t *testing.T) {
Expand Down
33 changes: 33 additions & 0 deletions go/cmd/controller/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
Copyright 2025.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package main

import (
"github.com/kagent-dev/kagent/go/internal/httpserver/auth"
"github.com/kagent-dev/kagent/go/pkg/app"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
_ "k8s.io/client-go/plugin/pkg/client/auth"
)

// nolint:gocyclo
func main() {
authorizer := &auth.NoopAuthorizer{}
authenticator := &auth.UnsecureAuthenticator{}
app.Start(authenticator, authorizer)
}
3 changes: 0 additions & 3 deletions go/controller/.dockerignore

This file was deleted.

134 changes: 0 additions & 134 deletions go/controller/README.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"

"github.com/kagent-dev/kagent/go/controller/api/v1alpha2"
"github.com/kagent-dev/kagent/go/api/v1alpha2"
"github.com/kagent-dev/kagent/go/internal/a2a"
"github.com/kagent-dev/kagent/go/internal/httpserver/auth"
common "github.com/kagent-dev/kagent/go/internal/utils"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ import (
"sigs.k8s.io/controller-runtime/pkg/predicate"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

"github.com/kagent-dev/kagent/go/controller/api/v1alpha2"
"github.com/kagent-dev/kagent/go/controller/internal/reconciler"
"github.com/kagent-dev/kagent/go/api/v1alpha2"
"github.com/kagent-dev/kagent/go/internal/controller/reconciler"
v1alpha1 "github.com/kagent-dev/kmcp/api/v1alpha1"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"time"

"github.com/kagent-dev/kagent/go/controller/internal/reconciler"
"github.com/kagent-dev/kagent/go/internal/controller/reconciler"
"github.com/kagent-dev/kmcp/api/v1alpha1"

"k8s.io/apimachinery/pkg/runtime"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package controller
import (
"context"

"github.com/kagent-dev/kagent/go/controller/internal/reconciler"
"github.com/kagent-dev/kagent/go/internal/controller/reconciler"

"k8s.io/apimachinery/pkg/runtime"
"k8s.io/utils/ptr"
Expand All @@ -29,7 +29,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/predicate"

agentv1alpha1 "github.com/kagent-dev/kagent/go/controller/api/v1alpha1"
agentv1alpha1 "github.com/kagent-dev/kagent/go/api/v1alpha1"
)

// MemoryController reconciles a Memory object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package controller
import (
"context"

"github.com/kagent-dev/kagent/go/controller/internal/reconciler"
"github.com/kagent-dev/kagent/go/internal/controller/reconciler"

v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand All @@ -34,7 +34,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/predicate"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

"github.com/kagent-dev/kagent/go/controller/api/v1alpha2"
"github.com/kagent-dev/kagent/go/api/v1alpha2"
)

var (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
"k8s.io/utils/ptr"
"trpc.group/trpc-go/trpc-a2a-go/server"

"github.com/kagent-dev/kagent/go/controller/api/v1alpha2"
"github.com/kagent-dev/kagent/go/controller/internal/a2a"
"github.com/kagent-dev/kagent/go/controller/translator"
"github.com/kagent-dev/kagent/go/api/v1alpha2"
"github.com/kagent-dev/kagent/go/internal/controller/a2a"
"github.com/kagent-dev/kagent/go/internal/controller/translator"
"github.com/kagent-dev/kagent/go/internal/database"
"github.com/kagent-dev/kagent/go/internal/utils"
"github.com/kagent-dev/kagent/go/internal/version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"context"
"time"

"github.com/kagent-dev/kagent/go/controller/api/v1alpha2"
"github.com/kagent-dev/kagent/go/controller/internal/reconciler"
"github.com/kagent-dev/kagent/go/api/v1alpha2"
"github.com/kagent-dev/kagent/go/internal/controller/reconciler"

"k8s.io/apimachinery/pkg/runtime"
"k8s.io/utils/ptr"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package controller
import (
"context"

"github.com/kagent-dev/kagent/go/controller/internal/reconciler"
"github.com/kagent-dev/kagent/go/internal/controller/reconciler"
v1 "k8s.io/api/core/v1"

"k8s.io/apimachinery/pkg/runtime"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"strconv"
"strings"

"github.com/kagent-dev/kagent/go/controller/api/v1alpha2"
"github.com/kagent-dev/kagent/go/api/v1alpha2"
"github.com/kagent-dev/kagent/go/internal/adk"
"github.com/kagent-dev/kagent/go/internal/utils"
"github.com/kagent-dev/kagent/go/internal/version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/stretchr/testify/require"
"sigs.k8s.io/yaml"

"github.com/kagent-dev/kagent/go/controller/api/v1alpha2"
"github.com/kagent-dev/kagent/go/controller/translator"
"github.com/kagent-dev/kagent/go/api/v1alpha2"
"github.com/kagent-dev/kagent/go/internal/controller/translator"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
Expand Down
2 changes: 1 addition & 1 deletion go/internal/database/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"slices"
"time"

"github.com/kagent-dev/kagent/go/controller/api/v1alpha2"
"github.com/kagent-dev/kagent/go/api/v1alpha2"
"gorm.io/gorm"
"trpc.group/trpc-go/trpc-a2a-go/protocol"
)
Expand Down
2 changes: 1 addition & 1 deletion go/internal/database/fake/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sort"
"sync"

"github.com/kagent-dev/kagent/go/controller/api/v1alpha2"
"github.com/kagent-dev/kagent/go/api/v1alpha2"
"github.com/kagent-dev/kagent/go/internal/database"
"gorm.io/gorm"
"trpc.group/trpc-go/trpc-a2a-go/protocol"
Expand Down
4 changes: 2 additions & 2 deletions go/internal/httpserver/handlers/agents.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"net/http"

"github.com/go-logr/logr"
"github.com/kagent-dev/kagent/go/controller/api/v1alpha2"
"github.com/kagent-dev/kagent/go/controller/translator"
"github.com/kagent-dev/kagent/go/api/v1alpha2"
"github.com/kagent-dev/kagent/go/internal/controller/translator"
"github.com/kagent-dev/kagent/go/internal/httpserver/auth"
"github.com/kagent-dev/kagent/go/internal/httpserver/errors"
"github.com/kagent-dev/kagent/go/internal/utils"
Expand Down
2 changes: 1 addition & 1 deletion go/internal/httpserver/handlers/agents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/fake"

"github.com/kagent-dev/kagent/go/controller/api/v1alpha2"
"github.com/kagent-dev/kagent/go/api/v1alpha2"
"github.com/kagent-dev/kagent/go/internal/adk"
"github.com/kagent-dev/kagent/go/internal/database"
database_fake "github.com/kagent-dev/kagent/go/internal/database/fake"
Expand Down
Loading
Loading