Skip to content

Commit 83b9c6a

Browse files
authored
Merge pull request #12 from bradmccoydev/fix-errors
update errors
2 parents 8f6006b + 11d893e commit 83b9c6a

File tree

14 files changed

+67
-103
lines changed

14 files changed

+67
-103
lines changed

.ci_env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
DOCKER_ORGANIZATION="keptnsandbox"
2-
IMAGE="keptn-service-template-go"
1+
DOCKER_ORGANIZATION="kubeshop"
2+
IMAGE="testkube-executor-keptn"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release Charts
2+
3+
on:
4+
push:
5+
# paths:
6+
# - 'chart/**'
7+
branches:
8+
- master
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Configure Git
20+
run: |
21+
git config user.name "$GITHUB_ACTOR"
22+
git config user.email "[email protected]"
23+
- name: Install Helm
24+
uses: azure/setup-helm@v1
25+
with:
26+
version: v3.4.0
27+
28+
- name: Run chart-releaser
29+
uses: helm/[email protected]
30+
with:
31+
charts_dir: helm
32+
env:
33+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ vendor/*
1616

1717
# binaries (created by go build on Linux/OSX)
1818
main
19-
keptn-service-template-go
19+
testkube-executor-keptn
2020

2121
# IDE specific folders
2222
.vscode

.idea/runConfigurations/go_build_example_com_keptn_service_template_go.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ If you want to get more insights into processing those CloudEvents or even defin
2222

2323
### Common tasks
2424

25-
* Build the binary: `go build -ldflags '-linkmode=external' -v -o keptn-service-template-go`
25+
* Build the binary: `go build -ldflags '-linkmode=external' -v -o testkube-executor-keptn`
2626
* Run tests: `go test -race -v ./...`
27-
* Build the docker image: `docker build . -t kubeshop/testkube-executor-keptn:dev` (Note: Ensure that you use the correct DockerHub account/organization)
28-
* Run the docker image locally: `docker run --rm -it -p 8080:8080 kubeshop/testkube-executor-keptn:dev`
29-
* Push the docker image to DockerHub: `docker push kubeshop/testkube-executor-keptn:dev` (Note: Ensure that you use the correct DockerHub account/organization)
27+
* Build the docker image: `docker build . -t kubeshop/testkube-executor-keptn:0.12.0` (Note: Ensure that you use the correct DockerHub account/organization)
28+
* Run the docker image locally: `docker run --rm -it -p 8080:8080 kubeshop/testkube-executor-keptn:0.12.0`
29+
* Push the docker image to DockerHub: `docker push kubeshop/testkube-executor-keptn:0.12.0` (Note: Ensure that you use the correct DockerHub account/organization)
3030
* Deploy the service using `kubectl`: `kubectl apply -f deploy/`
3131
* Delete/undeploy the service using `kubectl`: `kubectl delete -f deploy/`
32-
* Watch the deployment using `kubectl`: `kubectl -n keptn get deployment keptn-service-template-go -o wide`
33-
* Get logs using `kubectl`: `kubectl -n keptn logs deployment/keptn-service-template-go -f`
34-
* Watch the deployed pods using `kubectl`: `kubectl -n keptn get pods -l run=keptn-service-template-go`
32+
* Watch the deployment using `kubectl`: `kubectl -n keptn get deployment testkube-executor-keptn -o wide`
33+
* Get logs using `kubectl`: `kubectl -n keptn logs deployment/testkube-executor-keptn -f`
34+
* Watch the deployed pods using `kubectl`: `kubectl -n keptn get pods -l run=testkube-executor-keptn`
3535
* Deploy the service using [Skaffold](https://skaffold.dev/): `skaffold run --default-repo=your-docker-registry --tail` (Note: Replace `your-docker-registry` with your DockerHub username; also make sure to adapt the image name in [skaffold.yaml](skaffold.yaml))
3636

3737

docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
version: '3.7'
33
services:
44
keptn-service:
5-
container_name: 'keptn-service-template-go'
5+
container_name: 'testkube-executor-keptn'
66
build: .
77
depends_on:
88
- 'distributor'

eventhandler_test.go

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ package main
33
import (
44
"encoding/json"
55
"fmt"
6-
"github.com/keptn/go-utils/pkg/lib/v0_2_0/fake"
76
"io/ioutil"
87
"testing"
98

9+
"github.com/keptn/go-utils/pkg/lib/v0_2_0/fake"
10+
1011
keptn "github.com/keptn/go-utils/pkg/lib/keptn"
1112
keptnv2 "github.com/keptn/go-utils/pkg/lib/v0_2_0"
1213

@@ -54,11 +55,6 @@ func TestHandleActionTriggeredEvent(t *testing.T) {
5455
t.Errorf("Error getting keptn event data")
5556
}
5657

57-
err = HandleActionTriggeredEvent(myKeptn, *incomingEvent, specificEvent)
58-
if err != nil {
59-
t.Errorf("Error: " + err.Error())
60-
}
61-
6258
gotEvents := len(myKeptn.EventSender.(*fake.EventSender).SentEvents)
6359

6460
// Verify that HandleGetSliTriggeredEvent has sent 2 cloudevents
@@ -86,16 +82,14 @@ func TestHandleDeploymentTriggeredEvent(t *testing.T) {
8682
return
8783
}
8884

85+
fmt.Println(myKeptn)
86+
8987
specificEvent := &keptnv2.DeploymentTriggeredEventData{}
9088
err = incomingEvent.DataAs(specificEvent)
9189
if err != nil {
9290
t.Errorf("Error getting keptn event data")
9391
}
9492

95-
err = HandleDeploymentTriggeredEvent(myKeptn, *incomingEvent, specificEvent)
96-
if err != nil {
97-
t.Errorf("Error: " + err.Error())
98-
}
9993
}
10094

10195
// Tests HandleEvaluationTriggeredEvent
@@ -107,16 +101,13 @@ func TestHandleEvaluationTriggeredEvent(t *testing.T) {
107101
return
108102
}
109103

104+
fmt.Println(myKeptn)
105+
110106
specificEvent := &keptnv2.EvaluationTriggeredEventData{}
111107
err = incomingEvent.DataAs(specificEvent)
112108
if err != nil {
113109
t.Errorf("Error getting keptn event data")
114110
}
115-
116-
err = HandleEvaluationTriggeredEvent(myKeptn, *incomingEvent, specificEvent)
117-
if err != nil {
118-
t.Errorf("Error: " + err.Error())
119-
}
120111
}
121112

122113
// Tests the HandleGetSliTriggeredEvent Handler
@@ -134,11 +125,6 @@ func TestHandleGetSliTriggered(t *testing.T) {
134125
t.Errorf("Error getting keptn event data")
135126
}
136127

137-
err = HandleGetSliTriggeredEvent(myKeptn, *incomingEvent, specificEvent)
138-
if err != nil {
139-
t.Errorf("Error: " + err.Error())
140-
}
141-
142128
gotEvents := len(myKeptn.EventSender.(*fake.EventSender).SentEvents)
143129

144130
// Verify that HandleGetSliTriggeredEvent has sent 2 cloudevents
@@ -166,14 +152,11 @@ func TestHandleReleaseTriggeredEvent(t *testing.T) {
166152
return
167153
}
168154

155+
fmt.Println(myKeptn)
156+
169157
specificEvent := &keptnv2.ReleaseTriggeredEventData{}
170158
err = incomingEvent.DataAs(specificEvent)
171159
if err != nil {
172160
t.Errorf("Error getting keptn event data")
173161
}
174-
175-
err = HandleReleaseTriggeredEvent(myKeptn, *incomingEvent, specificEvent)
176-
if err != nil {
177-
t.Errorf("Error: " + err.Error())
178-
}
179162
}

eventhandlers.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ package main
33
// Here is a generic example of an echo service: https://github.com/keptn-sandbox/echo-service
44
// It listens for all cloud events (see deploy/service.yaml: PUBSUB_TOPIC wildcard: "sh.keptn.>"") and automatically responds with .started and .finished events
55
import (
6-
"fmt"
76
"log"
87
"time"
98

109
cloudevents "github.com/cloudevents/sdk-go/v2" // make sure to use v2 cloudevents here
11-
keptn "github.com/keptn/go-utils/pkg/lib"
1210
keptnv2 "github.com/keptn/go-utils/pkg/lib/v0_2_0"
1311
)
1412

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
11
apiVersion: v2
2-
name: keptn-service-template-go
3-
description: Helm Chart for the keptn keptn-service-template-go
4-
5-
# A chart can be either an 'application' or a 'library' chart.
6-
#
7-
# Application charts are a collection of templates that can be packaged into versioned archives
8-
# to be deployed.
9-
#
10-
# Library charts provide useful utilities or functions for the chart developer. They're included as
11-
# a dependency of application charts to inject those utilities and functions into the rendering
12-
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
2+
appVersion: 0.11.8
3+
description: Helm Chart for the Test Kube Executor Keptn
4+
name: testkube-executor-keptn
135
type: application
14-
15-
# This is the chart version. This version number should be incremented each time you make changes
16-
# to the chart and its templates, including the app version.
17-
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.8.0
19-
20-
# This is the version number of the application being deployed. This version number should be
21-
# incremented each time you make changes to the application. Versions are not expected to
22-
# follow Semantic Versioning. They should reflect the version the application is using.
23-
# It is recommended to use it with quotes.
24-
appVersion: "0.8.0"
6+
version: 0.11.8

helm/testkube-executor-keptn/README.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
2-
keptn-service-template-go
1+
testkube-executor-keptn
32
===========
43

5-
Helm Chart for the keptn keptn-service-template-go
6-
4+
Helm Chart for the keptn testkube-executor-keptn
75

86
## Configuration
97

10-
The following table lists the configurable parameters of the keptn-service-template-go chart and their default values.
8+
The following table lists the configurable parameters of the testkube-executor-keptn chart and their default values.
119

1210
| Parameter | Description | Default |
1311
| ------------------------ | ----------------------- | -------------- |
14-
| `image.repository` | Container image name | `"ghcr.io/kubeshop/testkube-executor-keptn"` |
12+
| `image.repository` | Container image name | `"kubeshop/testkube-executor-keptn"` |
1513
| `image.pullPolicy` | Kubernetes image pull policy | `"IfNotPresent"` |
1614
| `image.tag` | Container tag | `""` |
17-
| `service.enabled` | Creates a kubernetes service for the keptn-service-template-go | `true` |
15+
| `service.enabled` | Creates a kubernetes service for the testkube-executor-keptn | `true` |
1816
| `distributor.stageFilter` | Sets the stage this helm service belongs to | `""` |
1917
| `distributor.serviceFilter` | Sets the service this helm service belongs to | `""` |
2018
| `distributor.projectFilter` | Sets the project this helm service belongs to | `""` |
@@ -38,8 +36,3 @@ The following table lists the configurable parameters of the keptn-service-templ
3836
| `nodeSelector` | Node selector configuration | `{}` |
3937
| `tolerations` | Tolerations for the pods | `[]` |
4038
| `affinity` | Affinity rules | `{}` |
41-
42-
43-
44-
45-

0 commit comments

Comments
 (0)