Skip to content

Commit

Permalink
Merge branch 'main' into ausias/include-system-env-vars
Browse files Browse the repository at this point in the history
  • Loading branch information
ausias-armesto committed Feb 23, 2024
2 parents 646dc83 + cacc486 commit c544d1e
Show file tree
Hide file tree
Showing 43 changed files with 2,350 additions and 603 deletions.
4 changes: 3 additions & 1 deletion Dockerfile.controller
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager
FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY --from=builder /workspace/manager .
USER nonroot:nonroot

# as defined by distroless for nonroot
USER 65532:65532

ENTRYPOINT ["/manager"]
2 changes: 2 additions & 0 deletions Dockerfile.starter
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
FROM radial/busyboxplus:curl

# as defined by distroless for nonroot
USER 65532:65532
COPY --from=redboxoss/scuttle:latest /scuttle /bin/scuttle
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Current Operator version
VERSION ?= 0.0.12
VERSION ?= 0.0.13
# Default bundle image tag
BUNDLE_IMG ?= k6-controller-bundle:$(VERSION)
# Options for 'bundle-build'
Expand Down
1 change: 1 addition & 0 deletions api/v1alpha1/k6_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type Pod struct {
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
ServiceAccountName string `json:"serviceAccountName,omitempty"`
SecurityContext corev1.PodSecurityContext `json:"securityContext,omitempty"`
ContainerSecurityContext corev1.SecurityContext `json:"containerSecurityContext,omitempty"`
EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"`
ReadinessProbe *corev1.Probe `json:"readinessProbe,omitempty"`
LivenessProbe *corev1.Probe `json:"livenessProbe,omitempty"`
Expand Down
12 changes: 11 additions & 1 deletion api/v1alpha1/k6conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ const (
// - if True, it's after successful starter but before all runners have finished
TestRunRunning = "TestRunRunning"

// TeardownExecuted indicates whether the `teardown()` has been executed on one of the runners.
// This condition can be used only in PLZ test runs.
TeardownExecuted = "TeardownExecuted"

// CloudTestRun indicates if this test run is supposed to be a cloud test run
// (i.e. with `--out cloud` option).
// - if empty / Unknown, the type of test is unknown yet
Expand Down Expand Up @@ -71,13 +75,19 @@ func Initialize(k6 TestRunI) {
Reason: "TestRunPreparation",
Message: "",
},
metav1.Condition{
Type: TeardownExecuted,
Status: metav1.ConditionFalse,
LastTransitionTime: t,
Reason: "TeardownExecutedFalse",
Message: "",
},
}

UpdateCondition(k6, CloudTestRunAborted, metav1.ConditionFalse)

// PLZ test run case
if len(k6.GetSpec().TestRunID) > 0 {
UpdateCondition(k6, CloudTestRun, metav1.ConditionTrue)
UpdateCondition(k6, CloudPLZTestRun, metav1.ConditionTrue)
UpdateCondition(k6, CloudTestRunCreated, metav1.ConditionTrue)
UpdateCondition(k6, CloudTestRunFinalized, metav1.ConditionFalse)
Expand Down
11 changes: 11 additions & 0 deletions api/v1alpha1/testruni.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
runtime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -31,3 +32,13 @@ func TestRunID(k6 TestRunI) string {
}
return k6.GetStatus().TestRunID
}

func ListOptions(k6 TestRunI) *client.ListOptions {
selector := labels.SelectorFromSet(map[string]string{
"app": "k6",
"k6_cr": k6.NamespacedName().Name,
"runner": "true",
})

return &client.ListOptions{LabelSelector: selector, Namespace: k6.NamespacedName().Namespace}
}
1 change: 1 addition & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c544d1e

Please sign in to comment.