Skip to content

Commit

Permalink
fix: 1.15.3 (#190)
Browse files Browse the repository at this point in the history
* feat: cron job template field (#132) (#133)

* feat: cron job template field

* fix: dep update

* feat: deprecate args (#130)

* feat: add args mode

* fix: add args mode type

* fix: change artifact support

* fix: upload variables file (#135)

* add tests for develop branch (#136)

* add check fir release branch (#137)

* comment out the automatic merge of release branch for now

* fix release branch naming

* fix typo

* fix path for goreleaser file

* rename release branch (#142)

* ci: parametrize alpine (#144)

* parametrize alpine image

* fix: ttl for trigger condition (#143)

* ci: rename gh token var (#145)

* rename gh token var

* fix: add missing var for alpine image for arm64 arch

* fix: remove empty username and token (#147)

* ci: add docker registry description (#146)

* ci: add GH action to update readme for Docker registry

* ci: add workflow dispatch (#149)

* fix: support external secrets for tests (#148)

* fix: support external secrets for tests

* fix: support external secrets for test suite

* fix: rename interface method

* fix: test mock

* feat: webhook templlate and headers (#152)

* feat: webhook templlate and headers

* fix: description typo

* fix: secret check (#153)

* fix: secret check

* fix: remove wrong condition

* feat: provide known condition types (#155)

* feat: provide known condition types

* fix: rename util method

* feat: parallel testsuite (#109)

* feat: test suite v3

* feat: test suite v3 client and watcher

* fix: dep update

* Update config/crd/bases/tests.testkube.io_tests.yaml

Co-authored-by: nicufk <[email protected]>

* fix: conversion typo

* fix: test suite v3 sample

* fix: use proper informer version

* fix: v3 informer

* fix: typo func name

* add a separate workflow to test parallel testsuite images

* add a separate workflow to test parallel testsuite images

* fix: typo test suite version

* fix: make steps optional

* fix: sync recent changes

* fix: solve merge errors

* fix: rename fields

* fix: tune crd fields

* fix: rename vars and methods

* fix: refresh mock

* fix: rename vars

* fix: duration format

* fix: change test suite step object

* fix: secret var check

* fix: modify test suite example v3

* fix: update delay type

---------

Co-authored-by: nicufk <[email protected]>
Co-authored-by: ypoplavs <[email protected]>

* fix: remove run secrets as well (#139)

debug

fix: on deletion do not quit if something related to test could not be deleted, put in a single error

fix: remove logging and improve errors

fix: delete dependency error and delete test first

* feat: postrun script (#156)

* fix: post run scipt model

* fix: add postrun script to crd

* ci: remove release branch creation in helm-charts repo (#157)

* feat: probe conditions (#158)

* feat: probe spec model

* feat: test trigger crd with probes

* fix: refactor probe definition

* fix: unit tests

* fix: don't remove non Testkube secrets (#160)

* feat: remove outdated description (#164)

* fix: image registry (#166)

* feat: basic test execution crd (#165)

* feat: basic test execution crd

* feat: test execution CRD spec

* fix: test execution client

* fix: remove output

* fix: update status method

* fix: update get method

* feat: test execution reconciler

* fix: url port

* fix: test name

* fix: ignore status update

* feat: test suite execution core

* feat: test suite execution crd

* feat: add unit tests

* fix: test status

* fix: remove not used structure

* fix: api url typo

* fix: running context

* fix: generation field

* fix: remove unused fields

* fix: examples

* fix: use go 1.21 (#169)

* fix: context typo (#171)

* feat: artifact bucket (#170)

* feat: artifact bucket

* fix: generate

* fix: rename field

* feat: test field (#172)

* feat: test field

* fix: tags

* feat: template crd (#173)

* featL template crd

* feat: add delete by labels

* feat: use cronjob reference

* fix: add warnings

* fix: error message

* feat: adjust uri descrription (#174)

* feat: adjust uri descrription

* fix: adjust header description

* feat: trigger concurrency policy (#175)

* feat: trigger concurrency policy

* fix: make policy optional

* fix: policy validation

* Added slaves field in executor CRD to add slaves configuration (#177)

* Added slaves field in executor CRD to add slaves configuration

Signed-off-by: hiteshwani <[email protected]>

* Discard changes

Signed-off-by: hiteshwani <[email protected]>

* Fixed trivial review comments

Signed-off-by: Aman Parauliya <[email protected]>

---------

Signed-off-by: hiteshwani <[email protected]>
Signed-off-by: Aman Parauliya <[email protected]>
Co-authored-by: Aman Parauliya <[email protected]>

* feat: update operator to use latest kubebuilder layout (#178)

* update operator to use latest kubebuilder layout

* update dependencies

* update dependencies

* remove some unused fields from CRDs

* fix failing test

* fix invalid reference (#179)

* fix mocks (#180)

* fix: make test fields optional (#181)

* feat: execute post run script before scraping field (#183)

* feat: execute post run script before scraping field

* fix: pragma

* feat: regex field (#186)

* feat: regex field

* fix: validate regex

* fix: visibility for secrets (#187)

---------

Signed-off-by: hiteshwani <[email protected]>
Signed-off-by: Aman Parauliya <[email protected]>
Co-authored-by: Lilla Vass <[email protected]>
Co-authored-by: ypoplavs <[email protected]>
Co-authored-by: ypoplavs <[email protected]>
Co-authored-by: nicufk <[email protected]>
Co-authored-by: hiteshwani <[email protected]>
Co-authored-by: Aman Parauliya <[email protected]>
Co-authored-by: Dejan Zele Pejchev <[email protected]>
  • Loading branch information
8 people authored Oct 25, 2023
1 parent d0faa1e commit 5870193
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 8 deletions.
44 changes: 44 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,50 @@ resources:
kind: Template
path: github.com/kubeshop/testkube-operator/api/template/v1
version: v1
- api:
crdVersion: v1
namespaced: true
domain: testkube.io
group: tests
kind: Test
path: github.com/kubeshop/testkube-operator/api/tests/v2
version: v2
- api:
crdVersion: v1
namespaced: true
controller: true
domain: testkube.io
group: tests
kind: TestSuite
path: github.com/kubeshop/testkube-operator/api/testsuite/v3
version: v3
- api:
crdVersion: v1
namespaced: true
controller: true
domain: testkube.io
group: tests
kind: TestExecution
path: github.com/kubeshop/testkube-operator/api/testexecution/v1
version: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: testkube.io
group: tests
kind: TestSuiteExecution
path: github.com/kubeshop/testkube-operator/api/testsuiteexecution/v1
version: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: testkube.io
group: tests
kind: Template
path: github.com/kubeshop/testkube-operator/api/template/v1
version: v1
- api:
crdVersion: v1
namespaced: true
Expand Down
2 changes: 1 addition & 1 deletion api/testsuite/v1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1 contains API Schema definitions for the test sources v1 API group
// Package v1 contains API Schema definitions for the test suites v1 API group
// +kubebuilder:object:generate=true
// +groupName=tests.testkube.io
package v1
Expand Down
2 changes: 2 additions & 0 deletions api/testtriggers/v1/testtrigger_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ const (
type TestTriggerSelector struct {
// Name selector is used to identify a Kubernetes Object based on the metadata name
Name string `json:"name,omitempty"`
// kubernetes resource name regex
NameRegex string `json:"nameRegex,omitempty"`
// Namespace of the Kubernetes object
Namespace string `json:"namespace,omitempty"`
// LabelSelector is used to identify a group of Kubernetes Objects based on their metadata labels
Expand Down
6 changes: 6 additions & 0 deletions config/crd/bases/tests.testkube.io_testtriggers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ spec:
description: Name selector is used to identify a Kubernetes Object
based on the metadata name
type: string
nameRegex:
description: kubernetes resource name regex
type: string
namespace:
description: Namespace of the Kubernetes object
type: string
Expand Down Expand Up @@ -295,6 +298,9 @@ spec:
description: Name selector is used to identify a Kubernetes Object
based on the metadata name
type: string
nameRegex:
description: kubernetes resource name regex
type: string
namespace:
description: Namespace of the Kubernetes object
type: string
Expand Down
9 changes: 5 additions & 4 deletions internal/controller/testtriggers/testtrigger_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,14 @@ func (v *Validator) validateSelector(fld *field.Path, selector testtriggerv1.Tes
isLabelSelectorEmpty = isEmpty
}

if selector.Name != "" && selector.LabelSelector != nil {
verr := field.Duplicate(fld, "either name or label selector can be used")
if (selector.Name != "" && selector.LabelSelector != nil) || (selector.NameRegex != "" && selector.LabelSelector != nil) ||
(selector.Name != "" && selector.NameRegex != "") {
verr := field.Duplicate(fld, "either name, name regex or label selector can be used")
allErrs = append(allErrs, verr)
}

if selector.Name == "" && isLabelSelectorEmpty {
verr := field.Invalid(fld, selector, "neither name nor label selector is specified")
if selector.Name == "" && selector.NameRegex == "" && isLabelSelectorEmpty {
verr := field.Invalid(fld, selector, "neither name, name regex nor label selector is specified")
allErrs = append(allErrs, verr)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,14 @@ func TestValidator_validateSelector(t *testing.T) {
assert.Empty(t, verrs)
})

t.Run("error when neither name nor label selector are specified", func(t *testing.T) {
t.Run("error when neither name, name regex nor label selector are specified", func(t *testing.T) {
t.Parallel()

fld := field.NewPath("spec").Child("testSelector")
selector := testtriggerv1.TestTriggerSelector{LabelSelector: &metav1.LabelSelector{}}
verrs := v.validateSelector(fld, selector)
assert.Len(t, verrs, 1)
assert.ErrorContains(t, verrs[0], "neither name nor label selector is specified")
assert.ErrorContains(t, verrs[0], "neither name, name regex nor label selector is specified")
})

t.Run("error when invalid labels are specified", func(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions pkg/client/tests/v3/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const (
var testSecretDefaultLabels = map[string]string{
"testkube": testkubeTestSecretLabel,
"testkubeSecretType": "variables",
"visibility": "testkube",
}

//go:generate mockgen -source=./test.go -destination=./mock_tests.go -package=tests "github.com/kubeshop/testkube-operator/pkg/client/tests/v3" Interface
Expand Down
1 change: 1 addition & 0 deletions pkg/client/testsuites/v3/testsuites.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const (
var testsuiteSecretDefaultLabels = map[string]string{
"testkube": testkubeTestsuiteSecretLabel,
"testkubeSecretType": "variables",
"visibility": "testkube",
}

//go:generate mockgen -destination=./mock_testsuites.go -package=v3 "github.com/kubeshop/testkube-operator/pkg/client/testsuites/v3" Interface
Expand Down
2 changes: 1 addition & 1 deletion pkg/secret/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func NewSpec(id, namespace, label string, labels, stringData map[string]string)
ObjectMeta: metav1.ObjectMeta{
Name: id,
Namespace: namespace,
Labels: map[string]string{"testkube": label},
Labels: map[string]string{"testkube": label, "visibility": "testkube"},
},
Type: v1.SecretTypeOpaque,
StringData: stringData,
Expand Down

0 comments on commit 5870193

Please sign in to comment.