forked from giantswarm/starboard-exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add existing API * Ignore deadcode check in generated test * Silence unused in test * Remove default suite_test * Go mod * Import and reconcile VulnerabilityReport * Nancy * Add helm packaging * cleanups * Actually push the image * Require pushing before adding to catalog * Fix project name * Don't copy nonexistent /api folder in Dockerfile * Register scheme * Sort imports * Check registration return value * Allow get,list for vulnerbailityreports * Also watch
- Loading branch information
Showing
19 changed files
with
951 additions
and
36 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,80 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
architect: giantswarm/[email protected] | ||
|
||
workflows: | ||
test: | ||
package-and-push-chart-on-tag: | ||
jobs: | ||
- architect/go-test: | ||
name: go-test | ||
- architect/go-build: | ||
name: go-build | ||
binary: starboard-exporter | ||
filters: | ||
tags: | ||
only: /^v.*/ | ||
|
||
- architect/push-to-docker: | ||
context: "architect" | ||
name: push-starboard-exporter-to-docker | ||
image: "docker.io/giantswarm/starboard-exporter" | ||
username_envar: "DOCKER_USERNAME" | ||
password_envar: "DOCKER_PASSWORD" | ||
requires: | ||
- go-build | ||
# Needed to trigger job also on git tag. | ||
filters: | ||
tags: | ||
only: /^v.*/ | ||
|
||
- architect/push-to-docker: | ||
context: "architect" | ||
name: push-starboard-exporter-to-quay | ||
image: "quay.io/giantswarm/starboard-exporter" | ||
username_envar: "QUAY_USERNAME" | ||
password_envar: "QUAY_PASSWORD" | ||
requires: | ||
- go-build | ||
# Needed to trigger job also on git tag. | ||
filters: | ||
tags: | ||
only: /^v.*/ | ||
|
||
- architect/push-to-docker: | ||
context: "architect" | ||
name: push-starboard-exporter-to-aliyun | ||
image: "registry-intl.cn-shanghai.aliyuncs.com/giantswarm/starboard-exporter" | ||
username_envar: "ALIYUN_USERNAME" | ||
password_envar: "ALIYUN_PASSWORD" | ||
requires: | ||
- go-build | ||
# Needed to trigger job also on git tag. | ||
filters: | ||
tags: | ||
only: /^v.*/ | ||
|
||
- architect/push-to-app-catalog: | ||
context: "architect" | ||
name: push-starboard-exporter-to-control-plane-catalog | ||
app_catalog: "control-plane-catalog" | ||
app_catalog_test: "control-plane-test-catalog" | ||
chart: "starboard-exporter" | ||
requires: | ||
- push-starboard-exporter-to-docker | ||
- push-starboard-exporter-to-quay | ||
# Trigger job on git tag. | ||
filters: | ||
tags: | ||
only: /^v.*/ | ||
|
||
- architect/push-to-app-catalog: | ||
context: "architect" | ||
name: push-starboard-exporter-to-giantswarm-catalog | ||
app_catalog: "giantswarm-catalog" | ||
app_catalog_test: "giantswarm-test-catalog" | ||
chart: "starboard-exporter" | ||
requires: | ||
- push-starboard-exporter-to-docker | ||
- push-starboard-exporter-to-quay | ||
# Trigger job on git tag. | ||
filters: | ||
# Trigger job also on git tag. | ||
tags: | ||
only: /^v.*/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,6 @@ testbin/* | |
*.swp | ||
*.swo | ||
*~ | ||
|
||
# project binary | ||
/starboard-exporter |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
Copyright 2021. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package controllers | ||
|
||
import ( | ||
"context" | ||
|
||
"k8s.io/apimachinery/pkg/runtime" | ||
ctrl "sigs.k8s.io/controller-runtime" | ||
"sigs.k8s.io/controller-runtime/pkg/client" | ||
"sigs.k8s.io/controller-runtime/pkg/log" | ||
|
||
aqua "github.com/aquasecurity/starboard/pkg/apis/aquasecurity/v1alpha1" | ||
) | ||
|
||
// VulnerabilityReportReconciler reconciles a VulnerabilityReport object | ||
type VulnerabilityReportReconciler struct { | ||
client.Client | ||
Scheme *runtime.Scheme | ||
} | ||
|
||
//+kubebuilder:rbac:groups=aquasecurity.github.io.giantswarm,resources=vulnerabilityreports,verbs=get;list;watch;create;update;patch;delete | ||
//+kubebuilder:rbac:groups=aquasecurity.github.io.giantswarm,resources=vulnerabilityreports/status,verbs=get;update;patch | ||
//+kubebuilder:rbac:groups=aquasecurity.github.io.giantswarm,resources=vulnerabilityreports/finalizers,verbs=update | ||
|
||
// Reconcile is part of the main kubernetes reconciliation loop which aims to | ||
// move the current state of the cluster closer to the desired state. | ||
// TODO(user): Modify the Reconcile function to compare the state specified by | ||
// the VulnerabilityReport object against the actual cluster state, and then | ||
// perform operations to make the cluster state reflect the state specified by | ||
// the user. | ||
// | ||
// For more details, check Reconcile and its Result here: | ||
// - https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/reconcile | ||
func (r *VulnerabilityReportReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { | ||
_ = log.FromContext(ctx) | ||
|
||
// TODO(user): your logic here | ||
|
||
return ctrl.Result{}, nil | ||
} | ||
|
||
// SetupWithManager sets up the controller with the Manager. | ||
func (r *VulnerabilityReportReconciler) SetupWithManager(mgr ctrl.Manager) error { | ||
return ctrl.NewControllerManagedBy(mgr). | ||
// Uncomment the following line adding a pointer to an instance of the controlled resource as an argument | ||
For(&aqua.VulnerabilityReport{}). | ||
Complete(r) | ||
} |
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
Oops, something went wrong.