-
Notifications
You must be signed in to change notification settings - Fork 416
feat: add git-based skill fetching with shared auth and lightweight init image #1365
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
Changes from all commits
654c187
1403147
3f038a3
476948b
293a3cb
e429b6f
00cabf6
7be1251
fa869d8
c417226
2dc4dd8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -156,7 +156,7 @@ celerybeat.pid | |
| # Environments | ||
| python/.env | ||
| .venv | ||
| env/ | ||
| .env/ | ||
| venv/ | ||
| ENV/ | ||
| env.bak/ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| ### Stage 0: build krane | ||
| FROM golang:1.25-alpine AS krane-builder | ||
|
|
||
| ENV KRANE_VERSION=v0.20.7 | ||
| WORKDIR /build | ||
|
|
||
| RUN apk add --no-cache git && \ | ||
| git clone --depth 1 --branch $KRANE_VERSION \ | ||
| https://github.com/google/go-containerregistry.git | ||
|
|
||
| WORKDIR /build/go-containerregistry/cmd/krane | ||
|
|
||
| RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /build/krane . | ||
|
|
||
| FROM alpine:3.21 | ||
|
|
||
| RUN apk add --no-cache git | ||
| COPY --from=krane-builder /build/krane /usr/local/bin/krane |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,16 +69,51 @@ type AgentSpec struct { | |
| AllowedNamespaces *AllowedNamespaces `json:"allowedNamespaces,omitempty"` | ||
| } | ||
|
|
||
| // +kubebuilder:validation:AtLeastOneOf=refs,gitRefs | ||
| type SkillForAgent struct { | ||
| // Fetch images insecurely from registries (allowing HTTP and skipping TLS verification). | ||
| // Meant for development and testing purposes only. | ||
| // +optional | ||
| InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"` | ||
|
|
||
| // The list of skill images to fetch. | ||
| // +kubebuilder:validation:MinItems=1 | ||
| // +kubebuilder:validation:MaxItems=20 | ||
| // +kubebuilder:validation:MinItems=1 | ||
| // +optional | ||
| Refs []string `json:"refs,omitempty"` | ||
|
|
||
| // Reference to a Secret containing git credentials. | ||
| // Applied to all gitRefs entries. | ||
| // The secret should contain a `token` key for HTTPS auth, | ||
| // or `ssh-privatekey` for SSH auth. | ||
| // +optional | ||
| GitAuthSecretRef *corev1.LocalObjectReference `json:"gitAuthSecretRef,omitempty"` | ||
EItanya marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // Git repositories to fetch skills from. | ||
| // +kubebuilder:validation:MaxItems=20 | ||
EItanya marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // +kubebuilder:validation:MinItems=1 | ||
| // +optional | ||
| GitRefs []GitRepo `json:"gitRefs,omitempty"` | ||
| } | ||
|
|
||
| // GitRepo specifies a single Git repository to fetch skills from. | ||
| type GitRepo struct { | ||
| // URL of the git repository (HTTPS or SSH). | ||
| // +kubebuilder:validation:Required | ||
| URL string `json:"url"` | ||
|
|
||
| // Git reference: branch name, tag, or commit SHA. | ||
| // +optional | ||
| // +kubebuilder:default="main" | ||
| Ref string `json:"ref,omitempty"` | ||
|
|
||
| // Subdirectory within the repo to use as the skill root. | ||
| // +optional | ||
| Path string `json:"path,omitempty"` | ||
|
|
||
| // Name for the skill directory under /skills. Defaults to the repo name. | ||
| // +optional | ||
| Name string `json:"name,omitempty"` | ||
|
Comment on lines
+105
to
+116
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Take a peek at https://github.com/kubernetes-sigs/kube-api-linter/. All +optional fields should be a pointer to a string. We can also take this opportunity to define simple validation checks too, e.g. minLength, patterns, etc. |
||
| } | ||
|
|
||
| // +kubebuilder:validation:XValidation:rule="!has(self.systemMessage) || !has(self.systemMessageFrom)",message="systemMessage and systemMessageFrom are mutually exclusive" | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.