# Use the official Docker image as a parent image
FROM docker:latest
# Install dependencies
RUN apk add --no-cache \
curl \
git \
bash \
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func streamLogs(clientset kubernetes.Interface, namespace, labelSelector string) error { | |
ctx := context.TODO() | |
// Watch for changes to pods that match the label selector | |
listWatcher := cache.NewListWatchFromClient( | |
clientset.CoreV1().RESTClient(), | |
"pods", | |
namespace, | |
fields.Everything(), | |
labels.SelectorFromSet(labels.Set(labelSelector)), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
slack: | |
enabled: true | |
token: "xoxb-..." | |
channels: | |
'default': | |
name: botkube-demo | |
bindings: | |
sources: | |
- keptn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'keptn': | |
## Keptn source configuration | |
## Plugin name syntax: <repo>/<plugin>[@<version>]. If version is not provided, the latest version from repository is used. | |
botkube/keptn: | |
# -- If true, enables `keptn` source. | |
enabled: true | |
config: | |
project: "botkube" | |
url: "http://localhost:8080/api" | |
token: "keptn_token" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// config.yaml | |
... | |
plugins: | |
repositories: | |
botkube: | |
url: http://localhost:8080/plugins-dev-index.yaml | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npx serve --listen 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PLUGIN_DOWNLOAD_URL_BASE_PATH=http://localhost:8080/plugin-dist make gen-plugins-index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// source.go | |
package keptn | |
const pollPeriodInSeconds = 5 | |
... | |
func (p *Source) consumeEvents(ctx context.Context, cfg Config, ch chan<- source.Event) { | |
keptn, err := NewClient(cfg.URL, cfg.Token) | |
log := loggerx.New(cfg.Log) | |
exitOnError(err, log) | |
for { | |
req := GetEventsRequest{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// source.go | |
Stream(ctx context.Context, input source.StreamInput) (source.StreamOutput, error) | |
Metadata(_ context.Context) (api.MetadataOutput, error) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// client.go | |
package keptn | |
import ( | |
api "github.com/keptn/go-utils/pkg/api/utils/v2" | |
"time" | |
) | |
// Client Keptn client | |
type Client struct { | |
// API refers to Keptn client. https://github.com/keptn/go-utils | |
API *api.APISet |
NewerOlder