Skip to content
Closed
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
21 changes: 21 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: CI
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]

Expand Down Expand Up @@ -38,6 +39,11 @@ jobs:
e2e:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
packages: write
env:
IMAGE: ghcr.io/${{ github.repository }}
steps:
- name: Checkout
uses: actions/checkout@v6
Expand Down Expand Up @@ -81,3 +87,18 @@ jobs:

- name: Run e2e tests
run: make buildimg deploy-bink e2e V=1

- name: Push to GHCR
if: github.event_name == 'push'
run: |
podman login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
podman push bootc-operator:dev ${{ env.IMAGE }}:dev
podman push bootc-operator:dev ${{ env.IMAGE }}:${{ github.sha }}

if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
podman push bootc-operator:dev ${{ env.IMAGE }}:${{ github.ref_name }}
fi

if [[ "${{ github.ref }}" == refs/heads/main ]]; then
podman push bootc-operator:dev ${{ env.IMAGE }}:latest
fi
5 changes: 2 additions & 3 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ RUN --mount=type=cache,id=gomod,target=/root/go/pkg/mod \
go build -o daemon ./cmd/daemon/

FROM quay.io/fedora/fedora-minimal:44
WORKDIR /
COPY --from=builder /workspace/manager /workspace/daemon .
COPY --from=builder /workspace/manager /workspace/daemon /usr/local/bin/
USER 65532:65532
ENTRYPOINT ["/manager"]
ENTRYPOINT ["manager"]
4 changes: 2 additions & 2 deletions config/daemon/daemon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ spec:
containers:
- name: daemon
command:
- /daemon
image: controller:latest
- daemon
image: ghcr.io/jlebon/bootc-operator:latest
env:
- name: NODE_NAME
valueFrom:
Expand Down
4 changes: 2 additions & 2 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ spec:
type: RuntimeDefault
containers:
- command:
- /manager
- manager
args:
- --leader-elect
- --health-probe-bind-address=:8081
image: controller:latest
image: ghcr.io/jlebon/bootc-operator:latest
name: manager
ports:
- containerPort: 8081
Expand Down
9 changes: 0 additions & 9 deletions config/samples/bootc_v1alpha1_bootcnode.yaml

This file was deleted.

22 changes: 17 additions & 5 deletions config/samples/bootc_v1alpha1_bootcnodepool.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
# This sample pool targets all worker nodes. All optional fields are shown
# commented out with default or example values.
apiVersion: node.bootc.dev/v1alpha1
kind: BootcNodePool
metadata:
labels:
app.kubernetes.io/name: bootc-operator
app.kubernetes.io/managed-by: kustomize
name: bootcnodepool-sample
name: workers
spec:
# TODO(user): Add fields here
nodeSelector:
matchLabels:
node-role.kubernetes.io/worker: ""
image:
ref: ghcr.io/alicefr/bink/node:latest

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we still don't support the tag, we should reference the digest

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Would be nice to have a sample that works here. But the bink/node image has no fixed tag anyway so there's no digest to use. I think I'll just add a comment there for now to say that tags are not supported yet and you'd use a digest.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# rollout:
# maxUnavailable: 1 # default
# paused: false # default
# drainTimeoutSeconds: 300 # example; default: no timeout
# disruption:
# rebootPolicy: AllowSoftReboot # example; default: RebootOnly
# pullSecretRef: # example; default: none
# name: my-pull-secret
# namespace: bootc-operator
3 changes: 0 additions & 3 deletions config/samples/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
## Append samples of your project ##
resources:
- bootc_v1alpha1_bootcnodepool.yaml
- bootc_v1alpha1_bootcnode.yaml
# +kubebuilder:scaffold:manifestskustomizesamples
28 changes: 7 additions & 21 deletions test/e2e/e2eutil/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ func WithLabel(key, value string) NodeOption {
}

// AddNode provisions a worker node via bink, waits for it to be Ready,
// labels it with LabelE2ETest, and registers cleanup to remove it.
// Returns the node name.
// and returns the node name. The node is labeled with LabelE2ETest
// (and any extra labels from WithLabel).
func (e *Env) AddNode(t *testing.T, opts ...NodeOption) string {
t.Helper()

Expand All @@ -123,8 +123,12 @@ func (e *Env) AddNode(t *testing.T, opts ...NodeOption) string {

nodeName := e.generateNodeName(t)

// Provision the node.
// Provision the node with labels applied at join time.
args := []string{"node", "add", nodeName, "--cluster-name", e.clusterName, "--control-plane", "controller"}
args = append(args, "--label", LabelE2ETest+"="+e.testID)
for k, v := range cfg.labels {
args = append(args, "--label", k+"="+v)
}
if cfg.memory > 0 {
args = append(args, "--memory", fmt.Sprintf("%d", cfg.memory))
}
Expand All @@ -141,24 +145,6 @@ func (e *Env) AddNode(t *testing.T, opts ...NodeOption) string {
// Wait for Ready.
waitForNodeReady(t, e.Client, nodeName)

// Label with test ID (replace with --label` once available:
// https://github.com/alicefr/bink/issues/23).
var node corev1.Node
if err := e.Client.Get(context.Background(), client.ObjectKey{Name: nodeName}, &node); err != nil {
t.Fatalf("getting node %q for labeling: %v", nodeName, err)
}
patch := client.StrategicMergeFrom(node.DeepCopy())
if node.Labels == nil {
node.Labels = map[string]string{}
}
node.Labels[LabelE2ETest] = e.testID
for k, v := range cfg.labels {
node.Labels[k] = v
}
if err := e.Client.Patch(context.Background(), &node, patch); err != nil {
t.Fatalf("labeling node %q: %v", nodeName, err)
}

return nodeName
}

Expand Down