Skip to content

Commit

Permalink
add flow reconciler to remove terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
elchead committed Mar 10, 2023
1 parent 294b99d commit e256c21
Show file tree
Hide file tree
Showing 3,425 changed files with 438,100 additions and 167,290 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
9 changes: 8 additions & 1 deletion .ci/testruns/default/templates/testrun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,17 @@ spec:
- name: REGION
type: env
value: westeurope
- name: infrastructure-test-flow
definition:
name: infrastructure-test-flow
config:
- name: REGION
type: env
value: westeurope
- name: bastion-test
definition:
name: bastion-test
config:
- name: REGION
type: env
value: westeurope
value: westeurope
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ If multiple identifiers make sense you can also state the commands multiple time
/area auto-scaling
...
"/area" identifiers: audit-logging|auto-scaling|backup|certification|control-plane-migration|control-plane|cost|delivery|dev-productivity|disaster-recovery|documentation|high-availability|logging|metering|monitoring|networking|open-source|ops-productivity|os|performance|quality|robustness|scalability|security|storage|testing|usability|user-management
"/kind" identifiers: api-change|bug|cleanup|discussion|enhancement|epic|impediment|poc|post-mortem|question|regression|task|technical-debt|test
"/area" identifiers: audit-logging|auto-scaling|backup|compliance|control-plane-migration|control-plane|cost|delivery|dev-productivity|disaster-recovery|documentation|high-availability|logging|metering|monitoring|networking|open-source|ops-productivity|os|performance|quality|robustness|scalability|security|storage|testing|usability|user-management
"/kind" identifiers: api-change|bug|cleanup|discussion|enhancement|epic|flake|impediment|poc|post-mortem|question|regression|task|technical-debt|test
For Gardener Enhancement Proposals (GEPs), please check the following [documentation](https://github.com/gardener/gardener/tree/master/docs/proposals/README.md) before submitting this pull request.
-->
Expand Down
26 changes: 18 additions & 8 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
run:
concurrency: 4
deadline: 10m
# some of the linters don't work correctly with 1.18, ref https://github.com/golangci/golangci-lint/issues/2649
# we are not using generics, so let's pin this to 1.17 until 1.18 is fully supported
go: "1.17"

linters:
disable:
- unused
- unused
enable:
- revive
- revive

skip-files:
- "zz_generated\\..*\\.go$"

issues:
exclude-use-default: false
exclude:
# revive
- var-naming # ((var|const|struct field|func) .* should be .*
- dot-imports # should not use dot imports
- package-comments # package comment should be of the form
- indent-error-flow # if block ends with a return statement, so drop this else and outdent its block
- "exported: (type|func) name will be used as .* by other packages, and that stutters;"
# revive
- var-naming # ((var|const|struct field|func) .* should be .*
- dot-imports # should not use dot imports
- package-comments # package comment should be of the form
- indent-error-flow # if block ends with a return statement, so drop this else and outdent its block
- unexported-return # exported func .* returns unexported type .*, which can be annoying to use
- "exported: (type|func) name will be used as .* by other packages, and that stutters;"
# typecheck:
- "undeclared name: `.*`"
- "\".*\" imported but not used"
2 changes: 1 addition & 1 deletion .test-defs/bastion-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ spec:
--client-secret=${CLIENT_SECRET}
--region=${REGION}
image: eu.gcr.io/gardener-project/3rd/golang:1.17.8
image: golang:1.19.5
22 changes: 22 additions & 0 deletions .test-defs/infrastructure-test-flow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
kind: TestDefinition
metadata:
name: infrastructure-test-flow
spec:
owner: [email protected]
description: Integration test for infrastructure creation and deletion
activeDeadlineSeconds: 4200

command: [bash, -c]
args:
- >-
go test -timeout=0 -mod=vendor ./test/integration/infrastructure
--v -ginkgo.v -ginkgo.progress -ginkgo.no-color
--kubeconfig=$TM_KUBECONFIG_PATH/testmachinery.config
--subscription-id=${SUBSCRIPTION_ID}
--tenant-id=${TENANT_ID}
--client-id=${CLIENT_ID}
--client-secret=${CLIENT_SECRET}
--region=${REGION}
--use-flow
image: eu.gcr.io/gardener-project/3rd/golang:1.19.2
2 changes: 1 addition & 1 deletion .test-defs/infrastructure-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ spec:
--client-secret=${CLIENT_SECRET}
--region=${REGION}
image: eu.gcr.io/gardener-project/3rd/golang:1.17.5
image: golang:1.19.5
2 changes: 1 addition & 1 deletion .test-defs/provider-azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ spec:
--network-vnet-cidr=$NETWORK_VNET_CIDR
--network-worker-cidr=$NETWORK_WORKER_CIDR
--zoned=$ZONED
image: eu.gcr.io/gardener-project/3rd/golang:1.17.5
image: golang:1.19.5
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
############# builder
FROM golang:1.17.5 AS builder
FROM golang:1.19.5 AS builder

WORKDIR /go/src/github.com/gardener/gardener-extension-provider-azure
COPY . .
RUN make install

############# base
FROM alpine:3.13.7 AS base
FROM gcr.io/distroless/static-debian11:nonroot AS base

############# gardener-extension-provider-azure
FROM base AS gardener-extension-provider-azure
WORKDIR /

COPY charts /charts
COPY --from=builder /go/bin/gardener-extension-provider-azure /gardener-extension-provider-azure
ENTRYPOINT ["/gardener-extension-provider-azure"]

############# gardener-extension-admission-azure
FROM base as gardener-extension-admission-azure
WORKDIR /

COPY --from=builder /go/bin/gardener-extension-admission-azure /gardener-extension-admission-azure
ENTRYPOINT ["/gardener-extension-admission-azure"]
15 changes: 4 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,6 @@ docker-images:
# Rules for verification, formatting, linting, testing and cleaning #
#####################################################################

.PHONY: install-requirements
install-requirements:
@go install -mod=vendor $(REPO_ROOT)/vendor/github.com/ahmetb/gen-crd-api-reference-docs
@go install -mod=vendor $(REPO_ROOT)/vendor/github.com/golang/mock/mockgen
@go install -mod=vendor $(REPO_ROOT)/vendor/golang.org/x/tools/cmd/goimports
@go install -mod=vendor sigs.k8s.io/controller-tools/cmd/controller-gen
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/install-requirements.sh

.PHONY: revendor
revendor:
@GO111MODULE=on go mod tidy
Expand All @@ -125,7 +117,7 @@ check-generate:
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/check-generate.sh $(REPO_ROOT)

.PHONY: check
check:
check: $(GOIMPORTS) $(GOLANGCI_LINT) $(HELM)
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/check.sh --golangci-lint-config=./.golangci.yaml ./cmd/... ./pkg/... ./test/...
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/check-charts.sh ./charts

Expand All @@ -136,9 +128,10 @@ check-docforge: $(DOCFORGE)
.PHONY: generate
generate: $(CONTROLLER_GEN) $(GEN_CRD_API_REFERENCE_DOCS) $(HELM) $(MOCKGEN)
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/generate.sh ./charts/... ./cmd/... ./example/... ./pkg/...
$(MAKE) format

.PHONY: format
format:
format: $(GOIMPORTS) $(GOIMPORTSREVISER)
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/format.sh ./cmd ./pkg ./test

.PHONY: test
Expand All @@ -157,7 +150,7 @@ test-clean:
verify: check format test

.PHONY: verify-extended
verify-extended: install-requirements check-generate check format test-cov test-clean
verify-extended: check-generate check format test-cov test-clean

.PHONY: integration-test-infra
integration-test-infra:
Expand Down
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,13 @@ This extension controller supports the following Kubernetes versions:

| Version | Support | Conformance test results |
| --------------- | ----------- | ------------------------ |
| Kubernetes 1.24 | 1.24.0+ | N/A |
| Kubernetes 1.26 | 1.26.0+ | N/A |
| Kubernetes 1.25 | 1.25.0+ | [![Gardener v1.25 Conformance Tests](https://testgrid.k8s.io/q/summary/conformance-gardener/Gardener,%20v1.25%20Azure/tests_status?style=svg)](https://testgrid.k8s.io/conformance-gardener#Gardener,%20v1.25%20Azure) |
| Kubernetes 1.24 | 1.24.0+ | [![Gardener v1.24 Conformance Tests](https://testgrid.k8s.io/q/summary/conformance-gardener/Gardener,%20v1.24%20Azure/tests_status?style=svg)](https://testgrid.k8s.io/conformance-gardener#Gardener,%20v1.24%20Azure) |
| Kubernetes 1.23 | 1.23.0+ | [![Gardener v1.23 Conformance Tests](https://testgrid.k8s.io/q/summary/conformance-gardener/Gardener,%20v1.23%20Azure/tests_status?style=svg)](https://testgrid.k8s.io/conformance-gardener#Gardener,%20v1.23%20Azure) |
| Kubernetes 1.22 | 1.22.0+ | [![Gardener v1.22 Conformance Tests](https://testgrid.k8s.io/q/summary/conformance-gardener/Gardener,%20v1.22%20Azure/tests_status?style=svg)](https://testgrid.k8s.io/conformance-gardener#Gardener,%20v1.22%20Azure) |
| Kubernetes 1.21 | 1.21.0+ | [![Gardener v1.21 Conformance Tests](https://testgrid.k8s.io/q/summary/conformance-gardener/Gardener,%20v1.21%20Azure/tests_status?style=svg)](https://testgrid.k8s.io/conformance-gardener#Gardener,%20v1.21%20Azure) |
| Kubernetes 1.20 | 1.20.0+ | [![Gardener v1.20 Conformance Tests](https://testgrid.k8s.io/q/summary/conformance-gardener/Gardener,%20v1.20%20Azure/tests_status?style=svg)](https://testgrid.k8s.io/conformance-gardener#Gardener,%20v1.20%20Azure) |
| Kubernetes 1.19 | 1.19.0+ | [![Gardener v1.19 Conformance Tests](https://testgrid.k8s.io/q/summary/conformance-gardener/Gardener,%20v1.19%20Azure/tests_status?style=svg)](https://testgrid.k8s.io/conformance-gardener#Gardener,%20v1.19%20Azure) |
| Kubernetes 1.18 | 1.18.0+ | [![Gardener v1.18 Conformance Tests](https://testgrid.k8s.io/q/summary/conformance-gardener/Gardener,%20v1.18%20Azure/tests_status?style=svg)](https://testgrid.k8s.io/conformance-gardener#Gardener,%20v1.18%20Azure) |
| Kubernetes 1.17 | 1.17.0+ | [![Gardener v1.17 Conformance Tests](https://testgrid.k8s.io/q/summary/conformance-gardener/Gardener,%20v1.17%20Azure/tests_status?style=svg)](https://testgrid.k8s.io/conformance-gardener#Gardener,%20v1.17%20Azure) |
| Kubernetes 1.16 | 1.16.0+, except 1.16.2 | [![Gardener v1.16 Conformance Tests](https://testgrid.k8s.io/q/summary/conformance-gardener/Gardener,%20v1.16%20Azure/tests_status?style=svg)](https://testgrid.k8s.io/conformance-gardener#Gardener,%20v1.16%20Azure) |
| Kubernetes 1.15 | 1.15.0+, except 1.15.5 | [1] |

[1] Conformance tests are still executed and validated, unfortunately [no longer shown in TestGrid](https://github.com/kubernetes/test-infra/pull/18509#issuecomment-668204180).

Please take a look [here](https://github.com/gardener/gardener/blob/master/docs/usage/supported_k8s_versions.md) to see which versions are supported by Gardener in general.

Expand All @@ -58,7 +53,7 @@ Please find further resources about out project here:
* ["Gardener, the Kubernetes Botanist" blog on kubernetes.io](https://kubernetes.io/blog/2018/05/17/gardener/)
* ["Gardener Project Update" blog on kubernetes.io](https://kubernetes.io/blog/2019/12/02/gardener-project-update/)
* [GEP-1 (Gardener Enhancement Proposal) on extensibility](https://github.com/gardener/gardener/blob/master/docs/proposals/01-extensibility.md)
* [GEP-4 (New `core.gardener.cloud/v1alpha1` API)](https://github.com/gardener/gardener/blob/master/docs/proposals/04-new-core-gardener-cloud-apis.md)
* [GEP-4 (New `core.gardener.cloud/v1beta1` API)](https://github.com/gardener/gardener/blob/master/docs/proposals/04-new-core-gardener-cloud-apis.md)
* [Extensibility API documentation](https://github.com/gardener/gardener/tree/master/docs/extensions)
* [Gardener Extensions Golang library](https://godoc.org/github.com/gardener/gardener/extensions/pkg)
* [Gardener API Reference](https://gardener.cloud/api-reference/)
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.28.0-dev
v1.35.0-dev
24 changes: 24 additions & 0 deletions charts/charts.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright (c) 2022 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
//
// 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 charts

import (
"embed"
)

// InternalChart embeds the internal charts in embed.FS
//
//go:embed internal
var InternalChart embed.FS
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: {{ include "name" . }}
webhooks:
- name: mutation.azure.provider.extensions.gardener.cloud
rules:
- apiGroups:
- "core.gardener.cloud"
apiVersions:
- v1beta1
operations:
- CREATE
- UPDATE
resources:
- shoots
failurePolicy: Fail
matchPolicy: Equivalent
objectSelector:
{{- if .Values.global.webhookConfig.useObjectSelector }}
matchLabels:
provider.extensions.gardener.cloud/azure: "true"
{{- end }}
namespaceSelector: {}
sideEffects: None
admissionReviewVersions:
- v1
- v1beta1
clientConfig:
{{- if .Values.global.virtualGarden.enabled }}
url: {{ printf "https://%s.%s/webhooks/mutate" (include "name" .) (.Release.Namespace) }}
{{- else }}
service:
namespace: {{ .Release.Namespace }}
name: {{ include "name" . }}
path: /webhooks/mutate
{{- end }}
caBundle: {{ required ".Values.global.webhookConfig.caBundle is required" .Values.global.webhookConfig.caBundle | b64enc }}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
namespace: {{ .Release.Namespace }}
labels:
{{ include "labels" . | indent 4 }}
high-availability-config.resources.gardener.cloud/type: server
spec:
revisionHistoryLimit: 1
replicas: {{ .Values.global.replicaCount }}
Expand Down Expand Up @@ -46,6 +47,9 @@ spec:
{{- if .Values.global.kubeconfig }}
- --kubeconfig=/etc/gardener-extension-admission-azure/kubeconfig/kubeconfig
{{- end }}
{{- if .Values.global.metricsPort }}
- --metrics-bind-address=:{{ .Values.global.metricsPort }}
{{- end }}
- --health-bind-address=:{{ .Values.global.healthPort }}
livenessProbe:
httpGet:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{{- if gt (int .Values.global.replicaCount) 1 }}
{{- if semverCompare ">= 1.21-0" .Capabilities.KubeVersion.GitVersion }}
apiVersion: policy/v1
{{- else }}
apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget
metadata:
name: {{ include "name" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "labels" . | indent 4 }}
spec:
maxUnavailable: {{ sub (int .Values.global.replicaCount) 1 }}
maxUnavailable: 1
selector:
matchLabels:
{{ include "labels" . | indent 6 }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ spec:
containerPolicies:
- containerName: '*'
minAllowed:
cpu: {{ required ".Values.global.vpa.resourcePolicy.minAllowed.cpu is required" .Values.global.vpa.resourcePolicy.minAllowed.cpu }}
memory: {{ required ".Values.global.vpa.resourcePolicy.minAllowed.memory is required" .Values.global.vpa.resourcePolicy.minAllowed.memory }}
{{- end }}
targetRef:
Expand Down
2 changes: 1 addition & 1 deletion charts/gardener-extension-admission-azure/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ global:
pullPolicy: IfNotPresent
replicaCount: 1
resources: {}
metricsPort: 8080
healthPort: 8081
vpa:
enabled: true
resourcePolicy:
minAllowed:
cpu: 50m
memory: 64Mi
updatePolicy:
updateMode: "Auto"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,3 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- define "deploymentversion" -}}
apps/v1
{{- end -}}

{{- define "priorityclassversion" -}}
scheduling.k8s.io/v1
{{- end -}}
Loading

0 comments on commit e256c21

Please sign in to comment.