Skip to content

Commit

Permalink
merge main and fix conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Bacher <[email protected]>
  • Loading branch information
bacherfl committed Sep 27, 2023
2 parents 423cf19 + 98097e6 commit 668778e
Show file tree
Hide file tree
Showing 63 changed files with 1,180 additions and 103 deletions.
18 changes: 8 additions & 10 deletions .github/PULL_REQUEST_TEMPLATE/pr-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@ Please also provide information about any automatic tests that you added.
- [ ] My PR fulfills the Definition of Done of the corresponding issue and not more (or parts if the issue is separated
into multiple PRs)
- [ ] I used descriptive commit messages to help reviewers understand my thought process
- [ ] I signed off all my commits according to the Developer Certificate of Origin (DCO) (
see [Contribution Guide](https://github.com/keptn/lifecycle-toolkit/blob/main/CONTRIBUTING.md#submit-a-pull-request-))
- [ ] I signed off all my commits according to the Developer Certificate of Origin (DCO)
see [Contribution Guide](https://lifecycle.keptn.sh/contribute/docs/contribution-guidelines)
- [ ] My PR title is formatted according to the semantic PR conventions described in
the [Contribution Guide](https://github.com/keptn/lifecycle-toolkit/blob/main/CONTRIBUTING.md#submit-a-pull-request-)
the [Contribution Guide](https://lifecycle.keptn.sh/contribute/docs/contribution-guidelines)
- [ ] My code follows the style guidelines of this project (golangci-lint passes, YAMLLint passes)
- [ ] I regenerated the auto-generated docs for Helm and the CRD documentation (if applicable)
- [ ] I have performed a self-review of my code
- [ ] I have made corresponding changes to the documentation (if needed)
- [ ] My changes result in all-green PR checks (first-time contributors need to ask a maintainer to approve their test
runs)
- [ ] My changes result in all-green PR checks (first-time contributors need to ask a maintainer to approve their test runs)
- [ ] New and existing unit and integration tests pass locally with my changes

<!-- DOCS SECTION -->
Expand All @@ -54,13 +53,12 @@ Fixes # (issue)
- [ ] My PR fulfills the Definition of Done of the corresponding issue and not more (or parts if the issue is separated
into multiple PRs)
- [ ] I used descriptive commit messages to help reviewers understand my thought process
- [ ] I signed off all my commits according to the Developer Certificate of Origin (DCO) (
see [Contribution Guide](https://github.com/keptn/lifecycle-toolkit/blob/main/docs/CONTRIBUTING.md#developer-certification-of-origin-dco))
- [ ] I signed off all my commits according to the Developer Certificate of Origin (DCO)(
see [Contribution Guide](https://lifecycle.keptn.sh/contribute/docs/contribution-guidelines))
- [ ] My PR title is formatted according to the semantic PR conventions described in
the [Contribution Guide](https://github.com/keptn/lifecycle-toolkit/blob/main/CONTRIBUTING.md#submit-a-pull-request-)
the [Contribution Guide](https://lifecycle.keptn.sh/contribute/docs/contribution-guidelines)
- [ ] My content follows the style guidelines of this project (YAMLLint, markdown-lint)
- [ ] I regenerated the auto-generated docs for Helm and the CRD documentation (if applicable)
- [ ] I have performed a self-review of my content including grammar and typo errors and also checked the rendered page
from the Netlify deploy preview
- [ ] My changes result in all-green PR checks (first-time contributors need to ask a maintainer to approve their test
runs)
- [ ] My changes result in all-green PR checks (first-time contributors need to ask a maintainer to approve their test runs)
20 changes: 20 additions & 0 deletions .github/scripts/.helm-tests/default/result.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8388,3 +8388,23 @@ webhooks:
resources:
- analyses
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: 'metrics-webhook-service'
namespace: 'helmtests'
path: /validate-metrics-keptn-sh-v1alpha3-analysisdefinition
failurePolicy: Fail
name: vanalysisdefinition.kb.io
rules:
- apiGroups:
- metrics.keptn.sh
apiVersions:
- v1alpha3
operations:
- CREATE
- UPDATE
resources:
- analysisdefinitions
sideEffects: None
2 changes: 1 addition & 1 deletion .github/workflows/load-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
env:
GO_VERSION: "~1.20"
# renovate: datasource=github-tags depName=cloud-bulldozer/kube-burner
KUBE_BURNER_VERSION: "v1.7.7"
KUBE_BURNER_VERSION: "v1.7.8"
defaults:
run:
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
return releaseMatrix.length > 0 ? { config: releaseMatrix } : {};
build-release:
if: needs.release-please.outputs.releases-created == 'true'
if: needs.release-please.outputs.releases-created == 'true' && needs.release-please.outputs.build-matrix != '{}'
needs:
- release-please
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/security-scans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
echo "RUN_ID=$RUN_ID" >> $GITHUB_OUTPUT
- name: Download all artifacts from last successful build of main branch
uses: dawidd6/action-download-artifact@v2.27.0
uses: dawidd6/action-download-artifact@v2.28.0
id: download_artifacts_push
with:
# Download last successful artifact from a CI build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate-semantic-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Validate Pull Request
uses: amannn/action-semantic-pull-request@v5.2.0
uses: amannn/action-semantic-pull-request@v5.3.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ KUSTOMIZE ?= $(LOCALBIN)/kustomize
integration-test: # to run a single test by name use --test eg. --test=expose-keptn-metric
kubectl kuttl test --start-kind=false ./test/integration/ --config=kuttl-test.yaml
kubectl kuttl test --start-kind=false ./test/testmetrics/ --config=kuttl-test.yaml
kubectl kuttl test --start-kind=false ./test/testanalysis/ --config=kuttl-test.yaml
kubectl kuttl test --start-kind=false ./test/testcertificate/ --config=kuttl-test.yaml

.PHONY: integration-test-local #these tests should run on a real cluster!
integration-test-local: install-prometheus
kubectl kuttl test --start-kind=false ./test/integration/ --config=kuttl-test-local.yaml
kubectl kuttl test --start-kind=false ./test/testmetrics/ --config=kuttl-test-local.yaml
kubectl kuttl test --start-kind=false ./test/testanalysis/ --config=kuttl-test-local.yaml
kubectl kuttl test --start-kind=false ./test/testcertificate/ --config=kuttl-test-local.yaml

.PHONY: load-test
Expand Down
24 changes: 12 additions & 12 deletions docs/package-lock.json

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

Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,24 @@ webhooks:
- UPDATE
resources:
- analyses
sideEffects: None
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: 'metrics-webhook-service'
namespace: '{{ .Release.Namespace }}'
path: /validate-metrics-keptn-sh-v1alpha3-analysisdefinition
failurePolicy: Fail
name: vanalysisdefinition.kb.io
rules:
- apiGroups:
- metrics.keptn.sh
apiVersions:
- v1alpha3
operations:
- CREATE
- UPDATE
resources:
- analysisdefinitions
sideEffects: None
2 changes: 1 addition & 1 deletion klt-cert-manager/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/go-logr/logr v1.2.4
github.com/kelseyhightower/envconfig v1.4.0
github.com/pkg/errors v0.9.1
github.com/spf13/afero v1.9.5
github.com/spf13/afero v1.10.0
github.com/stretchr/testify v1.8.4
k8s.io/api v0.28.2
k8s.io/apiextensions-apiserver v0.28.2
Expand Down
4 changes: 2 additions & 2 deletions klt-cert-manager/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+Pymzi
github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM=
github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY=
github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
10 changes: 6 additions & 4 deletions lifecycle-operator/apis/lifecycle/v1alpha3/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@ const K8sRecommendedAppAnnotations = "app.kubernetes.io/part-of"
const K8sRecommendedManagedByAnnotations = "app.kubernetes.io/managed-by"
const PreDeploymentEvaluationAnnotation = "keptn.sh/pre-deployment-evaluations"
const PostDeploymentEvaluationAnnotation = "keptn.sh/post-deployment-evaluations"
const SchedulingGateRemoved = "keptn.sh/scheduling-gate-removed"
const TaskNameAnnotation = "keptn.sh/task-name"
const NamespaceEnabledAnnotation = "keptn.sh/lifecycle-toolkit"
const CreateAppTaskSpanName = "create_%s_app_task"
const CreateWorkloadTaskSpanName = "create_%s_deployment_task"
const CreateAppEvalSpanName = "create_%s_app_evaluation"
const CreateWorkloadEvalSpanName = "create_%s_deployment_evaluation"
const AppTypeAnnotation = "keptn.sh/app-type"
const KeptnGate = "keptn-prechecks-gate"

const MinKLTNameLen = 80
const MinKeptnNameLen = 80
const MaxK8sObjectLength = 253

type AppType string
Expand Down Expand Up @@ -176,17 +178,17 @@ const (

func GenerateTaskName(checkType CheckType, taskName string) string {
randomId := rand.Intn(99_999-10_000) + 10000
return operatorcommon.CreateResourceName(MaxK8sObjectLength, MinKLTNameLen, string(checkType), taskName, strconv.Itoa(randomId))
return operatorcommon.CreateResourceName(MaxK8sObjectLength, MinKeptnNameLen, string(checkType), taskName, strconv.Itoa(randomId))
}

func GenerateJobName(taskName string) string {
randomId := rand.Intn(99_999-10_000) + 10000
return operatorcommon.CreateResourceName(MaxK8sObjectLength, MinKLTNameLen, taskName, strconv.Itoa(randomId))
return operatorcommon.CreateResourceName(MaxK8sObjectLength, MinKeptnNameLen, taskName, strconv.Itoa(randomId))
}

func GenerateEvaluationName(checkType CheckType, evalName string) string {
randomId := rand.Intn(99_999-10_000) + 10000
return operatorcommon.CreateResourceName(MaxK8sObjectLength, MinKLTNameLen, string(checkType), evalName, strconv.Itoa(randomId))
return operatorcommon.CreateResourceName(MaxK8sObjectLength, MinKeptnNameLen, string(checkType), evalName, strconv.Itoa(randomId))
}

// MergeMaps merges two maps into a new map. If a key exists in both maps, the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func init() {
}

func (a KeptnApp) GetAppVersionName() string {
return operatorcommon.CreateResourceName(common.MaxK8sObjectLength, common.MinKLTNameLen, a.Name, a.Spec.Version, common.Hash(a.Generation))
return operatorcommon.CreateResourceName(common.MaxK8sObjectLength, common.MinKeptnNameLen, a.Name, a.Spec.Version, common.Hash(a.Generation))
}

func (a KeptnApp) SetSpanAttributes(span trace.Span) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func init() {
}

func (w KeptnWorkload) GetWorkloadInstanceName() string {
return operatorcommon.CreateResourceName(common.MaxK8sObjectLength, common.MinKLTNameLen, w.Name, w.Spec.Version)
return operatorcommon.CreateResourceName(common.MaxK8sObjectLength, common.MinKeptnNameLen, w.Name, w.Spec.Version)
}

func (w KeptnWorkload) SetSpanAttributes(span trace.Span) {
Expand Down
1 change: 1 addition & 0 deletions lifecycle-operator/config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ rules:
verbs:
- get
- list
- update
- watch
- apiGroups:
- ""
Expand Down

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

Loading

0 comments on commit 668778e

Please sign in to comment.