Skip to content

Commit

Permalink
🌱 Change testdata suffix and regenerate samples (kubernetes-sigs#3111)
Browse files Browse the repository at this point in the history
* edit script

* make generate

* fix test name

* project-v3-with-grafana
  • Loading branch information
jason1028kr authored and Sajiyah-Salat committed Jun 11, 2023
1 parent 5b77b29 commit cda6171
Show file tree
Hide file tree
Showing 66 changed files with 69 additions and 2,136 deletions.
11 changes: 5 additions & 6 deletions test/testdata/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function scaffold_test_project {
$kb create api --group example.com --version v1alpha1 --kind Busybox --image=busybox:1.28 --plugins="deploy-image/v1-alpha" --make=false
header_text 'Creating Memcached webhook ...'
$kb create webhook --group example.com --version v1alpha1 --kind Memcached --programmatic-validation
elif [[ $project =~ "with-metrics" ]]; then
elif [[ $project =~ "with-grafana" ]]; then
header_text 'Editing project with Grafana plugin ...'
$kb edit --plugins=grafana.kubebuilder.io/v1-alpha
fi
Expand All @@ -132,16 +132,15 @@ scaffold_test_project project-v2 --project-version=2
# [Currently, default CLI plugin] - Project version 3 (default) uses plugin go/v3 (default).
scaffold_test_project project-v3
scaffold_test_project project-v3-multigroup
scaffold_test_project project-v3-declarative-v1 --plugins="go/v3,declarative,grafana/v1-alpha"
scaffold_test_project project-v3-declarative-v1 --plugins="go/v3,declarative"
scaffold_test_project project-v3-config --component-config
scaffold_test_project project-v3-with-deploy-image
scaffold_test_project project-v3-with-metrics
scaffold_test_project project-v3-with-grafana

# [Next version, alpha] Project version v4-alpha
scaffold_test_project project-v4 --plugins="go/v4-alpha"
scaffold_test_project project-v4-multigroup --plugins="go/v4-alpha"
scaffold_test_project project-v4-declarative-v1 --plugins="go/v4-alpha,declarative,grafana/v1-alpha"
scaffold_test_project project-v4-declarative-v1 --plugins="go/v4-alpha,declarative"
scaffold_test_project project-v4-config --component-config --plugins="go/v4-alpha"
scaffold_test_project project-v4-with-deploy-image --plugins="go/v4-alpha"
scaffold_test_project project-v4-with-metrics

scaffold_test_project project-v4-with-grafana
4 changes: 2 additions & 2 deletions test/testdata/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ test_project project-v3-multigroup
test_project project-v3-declarative-v1
test_project project-v3-config
test_project project-v3-with-deploy-image
test_project project-v3-with-metrics
test_project project-v3-with-grafana

# Project version v4-alpha
test_project project-v4
test_project project-v4-multigroup
test_project project-v4-declarative-v1
test_project project-v4-config
test_project project-v4-with-deploy-image
test_project project-v4-with-metrics
test_project project-v4-with-grafana
2 changes: 0 additions & 2 deletions testdata/project-v3-declarative-v1/PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ domain: testproject.org
layout:
- go.kubebuilder.io/v3
- declarative.go.kubebuilder.io/v1
- grafana.kubebuilder.io/v1-alpha
plugins:
declarative.go.kubebuilder.io/v1:
resources:
Expand All @@ -18,7 +17,6 @@ plugins:
group: crew
kind: Admiral
version: v1
grafana.kubebuilder.io/v1-alpha: {}
projectName: project-v3-declarative-v1
repo: sigs.k8s.io/kubebuilder/testdata/project-v3-declarative-v1
resources:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ layout:
- go.kubebuilder.io/v3
plugins:
grafana.kubebuilder.io/v1-alpha: {}
projectName: project-v3-with-metrics
repo: sigs.k8s.io/kubebuilder/testdata/project-v3-with-metrics
projectName: project-v3-with-grafana
repo: sigs.k8s.io/kubebuilder/testdata/project-v3-with-grafana
version: "3"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# project-v3-with-metrics
# project-v3-with-grafana
// TODO(user): Add simple overview of use/purpose

## Description
Expand All @@ -18,13 +18,13 @@ kubectl apply -f config/samples/
2. Build and push your image to the location specified by `IMG`:

```sh
make docker-build docker-push IMG=<some-registry>/project-v3-with-metrics:tag
make docker-build docker-push IMG=<some-registry>/project-v3-with-grafana:tag
```

3. Deploy the controller to the cluster with the image specified by `IMG`:

```sh
make deploy IMG=<some-registry>/project-v3-with-metrics:tag
make deploy IMG=<some-registry>/project-v3-with-grafana:tag
```

### Uninstall CRDs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Adds namespace to all resources.
namespace: project-v3-with-metrics-system
namespace: project-v3-with-grafana-system

# Value of this field is prepended to the
# names of all resources, e.g. a deployment named
# "wordpress" becomes "alices-wordpress".
# Note that it should also match with the prefix (text before '-') of the namespace
# field above.
namePrefix: project-v3-with-metrics-
namePrefix: project-v3-with-grafana-

# Labels to add to all resources and selectors.
#commonLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: namespace
app.kubernetes.io/instance: system
app.kubernetes.io/component: manager
app.kubernetes.io/created-by: project-v4-with-metrics
app.kubernetes.io/part-of: project-v4-with-metrics
app.kubernetes.io/created-by: project-v3-with-grafana
app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
name: system
---
Expand All @@ -21,8 +21,8 @@ metadata:
app.kubernetes.io/name: deployment
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/component: manager
app.kubernetes.io/created-by: project-v4-with-metrics
app.kubernetes.io/part-of: project-v4-with-metrics
app.kubernetes.io/created-by: project-v3-with-grafana
app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
spec:
selector:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ metadata:
app.kubernetes.io/name: servicemonitor
app.kubernetes.io/instance: controller-manager-metrics-monitor
app.kubernetes.io/component: metrics
app.kubernetes.io/created-by: project-v3-with-metrics
app.kubernetes.io/part-of: project-v3-with-metrics
app.kubernetes.io/created-by: project-v3-with-grafana
app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
name: controller-manager-metrics-monitor
namespace: system
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: metrics-reader
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: project-v4-with-metrics
app.kubernetes.io/part-of: project-v4-with-metrics
app.kubernetes.io/created-by: project-v3-with-grafana
app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
name: metrics-reader
rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: proxy-role
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: project-v3-with-metrics
app.kubernetes.io/part-of: project-v3-with-metrics
app.kubernetes.io/created-by: project-v3-with-grafana
app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
name: proxy-role
rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrolebinding
app.kubernetes.io/instance: proxy-rolebinding
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: project-v4-with-metrics
app.kubernetes.io/part-of: project-v4-with-metrics
app.kubernetes.io/created-by: project-v3-with-grafana
app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
name: proxy-rolebinding
roleRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: service
app.kubernetes.io/instance: controller-manager-metrics-service
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: project-v3-with-metrics
app.kubernetes.io/part-of: project-v3-with-metrics
app.kubernetes.io/created-by: project-v3-with-grafana
app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
name: controller-manager-metrics-service
namespace: system
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: role
app.kubernetes.io/instance: leader-election-role
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: project-v3-with-metrics
app.kubernetes.io/part-of: project-v3-with-metrics
app.kubernetes.io/created-by: project-v3-with-grafana
app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
name: leader-election-role
rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: rolebinding
app.kubernetes.io/instance: leader-election-rolebinding
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: project-v4-with-metrics
app.kubernetes.io/part-of: project-v4-with-metrics
app.kubernetes.io/created-by: project-v3-with-grafana
app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
name: leader-election-rolebinding
roleRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrolebinding
app.kubernetes.io/instance: manager-rolebinding
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: project-v3-with-metrics
app.kubernetes.io/part-of: project-v3-with-metrics
app.kubernetes.io/created-by: project-v3-with-grafana
app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
name: manager-rolebinding
roleRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: serviceaccount
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: project-v4-with-metrics
app.kubernetes.io/part-of: project-v4-with-metrics
app.kubernetes.io/created-by: project-v3-with-grafana
app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
name: controller-manager
namespace: system
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module sigs.k8s.io/kubebuilder/testdata/project-v3-with-metrics
module sigs.k8s.io/kubebuilder/testdata/project-v3-with-grafana

go 1.19

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func main() {
Port: 9443,
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "d2513bbd.testproject.org",
LeaderElectionID: "502fdbd3.testproject.org",
// LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily
// when the Manager ends. This requires the binary to immediately end when the
// Manager is stopped, otherwise, this setting is unsafe. Setting this significantly
Expand Down
2 changes: 0 additions & 2 deletions testdata/project-v4-declarative-v1/PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ domain: testproject.org
layout:
- go.kubebuilder.io/v4-alpha
- declarative.go.kubebuilder.io/v1
- grafana.kubebuilder.io/v1-alpha
plugins:
declarative.go.kubebuilder.io/v1:
resources:
Expand All @@ -18,7 +17,6 @@ plugins:
group: crew
kind: Admiral
version: v1
grafana.kubebuilder.io/v1-alpha: {}
projectName: project-v4-declarative-v1
repo: sigs.k8s.io/kubebuilder/testdata/project-v4-declarative-v1
resources:
Expand Down
Loading

0 comments on commit cda6171

Please sign in to comment.