integrations-coding

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2023 License: Apache-2.0

README

integrations-template

Template repo for integrations plugins

How to start

All the steps necessary after creating a new repository

  • Change config/default/kustomization.yaml:
    • namePrefix: to new plugin name replacing template with the name, i.e sonarqube , gitlab, etc.
    • commonLabels.plugin: to new plugin name, same as above
      • 快捷指令
        • macos
           sed -i'' -e 's/template/coding/g' `grep -rl template config/default/kustomization.yaml` 
          
  • Change config/rbac/role_binding.yaml and replace template with the plugin name
    • 快捷指令
      • macos
        sed -i ''  -e 's/template/coding/g' `grep -rl template config/rbac/role_binding.yaml
        
  • Change config/rbac/service_account.yaml and replace template with the plugin name
    • 快捷指令
      • macos
        sed -i ''  -e 's/template/coding/g' `grep -rl template config/rbac/service_account.yaml`
        
  • Change config/plugin/controller_manager_config.yaml resourceName: <name>.integrations.katanomi.dev
    • 快捷指令
      • macos
         sed -i ''  -e 's/template/coding/g' `grep -rl template config/plugin/controller_manager_config.yaml`
        
  • Change config/plugin/plugin.yaml:
    • All label selectors (matchLabels) in the deployment to match the change above
    • serviceAccountName using the name setup above in config/rbac/service_account.yaml
    • Change config/plugin/plugin.yaml to use the new config-logging ConfigMap name, which should be <name>-config-logging
  • Change config/plugin/service.yaml:
    • All label selectors to match the change above
      • 快捷指令
        • macos
         sed -i ''  -e 's/: plugin/: coding/g' `grep -rl ': plugin' config/plugin/service.yaml `
         sed -i ''  -e 's/template/coding/g' `grep -rl template  config/plugin/service.yaml`
        
  • Change Makefile manifests command's rbac:roleName=integrations-template to rbac:roleName=integrations-<name>
    • 快捷指令
      • macos
       sed -i ''  -e 's/template/coding/g' Makefile 
      
  • Change config/data resource data to match your own plugin, remove any if necessary
    • 快捷指令
      • macos
        sed -i ''  -e 's/template/coding/g' `grep -rl template config/data`
      
  • Implement a plugin by changing pkg/plugin.go, etc.
    • 快捷指令
      • macos
         sed -i ''  -e 's/TemplatePlugin/TemplateCoding/g' pkg/plugin.go
         sed -i ''  -e 's/template/coding/g' `grep -rl template pkg/plugin.go`
        
  • Enable/disable functionalities in cmd/plugin/main.go according to the plugin's implementation
    • 快捷指令
      • macos
       sed -i ''  -e 's/template/coding/g' `grep -rl template go.mod`
       sed -i ''  -e 's/template/coding/g' `grep -rl template cmd/plugin/main.go` 
       sed -i ''  -e 's/TemplatePlugin/TemplateCoding/g' `grep -rl TemplatePlugin pkg `
       sed -i ''  -e 's/template/coding/g' `grep -rl template pkg ` 
      
  • If necessary add/change rbac rules inside cmd/plugin/main.go

Deployment considerations

  • When using a WebhookReceiver the ingress full address should be provide in the deployment as WEBHOOK_ADDRESS envvar. See config/plugin/plugin.yaml for more information
  • resource requests and limits were not tested and should be changed for a real deployment situation

TODO

Changes needed in this repo

Directories

Path Synopsis
cmd
Package pkg implementation of plugin interface
Package pkg implementation of plugin interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL