├── .gitattributes ├── .github ├── release-drafter.yml └── workflows │ ├── ci.yml │ ├── release-drafter.yml │ └── release.yml ├── .gitignore ├── .vscode └── launch.json ├── GenerateCRD.md ├── Makefile ├── README.md ├── cmd ├── configuration-domain-controller │ └── main.go ├── platform-controller │ └── main.go └── tenant-provisioner │ └── main.go ├── docker ├── Dockerfile └── docker.mk ├── go.mod ├── go.sum ├── hack ├── boilerplate.go.txt ├── generate_kube_crd.mk └── update-codegen.sh ├── helm ├── .helmignore ├── Chart.yaml ├── crds │ ├── configuration.totalsoft.ro_configurationdomains.yaml │ ├── platform.totalsoft.ro_domains.yaml │ ├── platform.totalsoft.ro_platforms.yaml │ ├── platform.totalsoft.ro_services.yaml │ ├── platform.totalsoft.ro_tenants.yaml │ ├── provisioning.totalsoft.ro_azuredatabases.yaml │ ├── provisioning.totalsoft.ro_azuremanageddatabases.yaml │ ├── provisioning.totalsoft.ro_azurepowershellscripts.yaml │ ├── provisioning.totalsoft.ro_azurevirtualdesktops.yaml │ ├── provisioning.totalsoft.ro_azurevirtualmachines.yaml │ ├── provisioning.totalsoft.ro_entrausers.yaml │ ├── provisioning.totalsoft.ro_helmreleases.yaml │ ├── provisioning.totalsoft.ro_localscripts.yaml │ ├── provisioning.totalsoft.ro_miniobuckets.yaml │ └── provisioning.totalsoft.ro_mssqldatabases.yaml ├── templates │ ├── configuration-domain-controller-deployment.yaml │ ├── platform-controller-deployment.yaml │ ├── provisioner-deployment.yaml │ └── rbac.yaml └── values.yaml ├── internal ├── controllers │ ├── configuration-domain │ │ ├── configuration_domain_controller.go │ │ ├── configuration_domain_controller_test.go │ │ ├── configuration_handler.go │ │ ├── kube_secrets_handler.go │ │ └── vault_secrets_handler.go │ ├── controller_consts.go │ ├── platform │ │ ├── platform_controller.go │ │ ├── platform_controller_test.go │ │ └── platform_events.go │ ├── provisioning │ │ ├── migration │ │ │ ├── migration.go │ │ │ └── migration_test.go │ │ ├── provisioners │ │ │ ├── pulumi │ │ │ │ ├── azure_db.go │ │ │ │ ├── azure_managed_db.go │ │ │ │ ├── azure_powershell_script.go │ │ │ │ ├── azure_powershell_script_test.go │ │ │ │ ├── azure_resource_group.go │ │ │ │ ├── azure_virtual_desktop.go │ │ │ │ ├── azure_virtual_desktop_test.go │ │ │ │ ├── azure_virtual_machine.go │ │ │ │ ├── azure_virtual_machine_test.go │ │ │ │ ├── entra_user.go │ │ │ │ ├── entra_user_test.go │ │ │ │ ├── exporters.go │ │ │ │ ├── fluxcd │ │ │ │ │ ├── generate_pulumi_fluxcd_apis.mk │ │ │ │ │ ├── helm.toolkit.fluxcd.io_helmreleases.yaml │ │ │ │ │ └── kubernetes │ │ │ │ │ │ ├── doc.go │ │ │ │ │ │ ├── helm │ │ │ │ │ │ └── v2beta1 │ │ │ │ │ │ │ ├── helmRelease.go │ │ │ │ │ │ │ ├── init.go │ │ │ │ │ │ │ ├── pulumiTypes.go │ │ │ │ │ │ │ └── pulumiUtilities.go │ │ │ │ │ │ ├── init.go │ │ │ │ │ │ ├── meta │ │ │ │ │ │ └── v1 │ │ │ │ │ │ │ └── pulumiTypes.go │ │ │ │ │ │ ├── provider.go │ │ │ │ │ │ ├── pulumi-plugin.json │ │ │ │ │ │ └── pulumiUtilities.go │ │ │ │ ├── helm_release.go │ │ │ │ ├── helm_release_test.go │ │ │ │ ├── local_script.go │ │ │ │ ├── local_script_test.go │ │ │ │ ├── minio_bucket.go │ │ │ │ ├── minio_bucket_test.go │ │ │ │ ├── mssql_db.go │ │ │ │ ├── mssql_db_test.go │ │ │ │ └── pulumi.go │ │ │ └── types.go │ │ ├── provisioning_controller.go │ │ ├── provisioning_controller_test.go │ │ ├── provisioning_resources.go │ │ ├── provisioning_targets.go │ │ └── provisioning_types.go │ └── utils.go ├── messaging │ ├── messaging_abstractions.go │ ├── mock │ │ └── messaging_mock.go │ └── rusi │ │ ├── rusi.go │ │ └── v1 │ │ ├── rusi.pb.go │ │ ├── rusi.proto │ │ └── rusi_grpc.pb.go ├── template │ └── parser.go ├── tuple │ └── pair.go └── version │ └── version.go └── pkg ├── apis ├── configuration │ ├── register.go │ └── v1alpha1 │ │ ├── configurationDomainTypes.go │ │ ├── doc.go │ │ ├── register.go │ │ ├── types.go │ │ ├── zz_generated.deepcopy.go │ │ └── zz_generated.defaults.go ├── platform │ ├── register.go │ └── v1alpha1 │ │ ├── doc.go │ │ ├── domainTypes.go │ │ ├── platformTypes.go │ │ ├── register.go │ │ ├── serviceTypes.go │ │ ├── tenantTypes.go │ │ ├── types.go │ │ ├── zz_generated.deepcopy.go │ │ └── zz_generated.defaults.go └── provisioning │ ├── register.go │ └── v1alpha1 │ ├── azureDatabaseTypes.go │ ├── azureManagedDatabaseTypes.go │ ├── azurePowershelScriptTypes.go │ ├── azureVirtualDesktopTypes.go │ ├── azureVirtualMachineTypes.go │ ├── commonTypes.go │ ├── doc.go │ ├── entraUserTypes.go │ ├── helmReleaseTypes.go │ ├── localScriptTypes.go │ ├── minioBucketTypes.go │ ├── mssqlDatabaseTypes.go │ ├── register.go │ ├── types.go │ ├── zz_generated.deepcopy.go │ └── zz_generated.defaults.go ├── generated ├── applyconfiguration │ ├── configuration │ │ └── v1alpha1 │ │ │ ├── configurationdomain.go │ │ │ ├── configurationdomainspec.go │ │ │ └── configurationdomainstatus.go │ ├── internal │ │ └── internal.go │ ├── platform │ │ └── v1alpha1 │ │ │ ├── domain.go │ │ │ ├── domainspec.go │ │ │ ├── platform.go │ │ │ ├── platformspec.go │ │ │ ├── platformstatus.go │ │ │ ├── service.go │ │ │ ├── servicespec.go │ │ │ ├── tenant.go │ │ │ ├── tenantspec.go │ │ │ └── tenantstatus.go │ ├── provisioning │ │ └── v1alpha1 │ │ │ ├── azuredatabase.go │ │ │ ├── azuredatabaseexportsspec.go │ │ │ ├── azuredatabasespec.go │ │ │ ├── azuremanageddatabase.go │ │ │ ├── azuremanageddatabaseexportsspec.go │ │ │ ├── azuremanageddatabaserestorespec.go │ │ │ ├── azuremanageddatabasespec.go │ │ │ ├── azuremanagedinstancespec.go │ │ │ ├── azurepowershellscript.go │ │ │ ├── azurepowershellscriptexportsspec.go │ │ │ ├── azurepowershellscriptspec.go │ │ │ ├── azurestoragecontainerspec.go │ │ │ ├── azurevirtualdesktop.go │ │ │ ├── azurevirtualdesktopapplication.go │ │ │ ├── azurevirtualdesktopautoscale.go │ │ │ ├── azurevirtualdesktopexportsspec.go │ │ │ ├── azurevirtualdesktopgroupsspec.go │ │ │ ├── azurevirtualdesktopspec.go │ │ │ ├── azurevirtualdesktopusersspec.go │ │ │ ├── azurevirtualmachine.go │ │ │ ├── azurevirtualmachineexportsspec.go │ │ │ ├── azurevirtualmachinespec.go │ │ │ ├── configmaptemplate.go │ │ │ ├── entrauser.go │ │ │ ├── entrauserexportsspec.go │ │ │ ├── entrauserspec.go │ │ │ ├── helmrelease.go │ │ │ ├── helmreleaseexportsspec.go │ │ │ ├── helmreleasespec.go │ │ │ ├── initscriptargs.go │ │ │ ├── kubesecrettemplate.go │ │ │ ├── localscript.go │ │ │ ├── localscriptexportsspec.go │ │ │ ├── localscriptspec.go │ │ │ ├── miniobucket.go │ │ │ ├── miniobucketexportsspec.go │ │ │ ├── miniobucketspec.go │ │ │ ├── mssqldatabase.go │ │ │ ├── mssqldatabaseexportsspec.go │ │ │ ├── mssqldatabaserestorespec.go │ │ │ ├── mssqldatabasespec.go │ │ │ ├── mssqlserverauth.go │ │ │ ├── mssqlserverspec.go │ │ │ ├── provisioningmeta.go │ │ │ ├── provisioningresourceidendtifier.go │ │ │ ├── provisioningtarget.go │ │ │ ├── provisioningtargetfilter.go │ │ │ ├── sqlserverspec.go │ │ │ ├── valueexport.go │ │ │ ├── vaultsecrettemplate.go │ │ │ └── virtualmachinegalleryapplication.go │ └── utils.go ├── clientset │ └── versioned │ │ ├── clientset.go │ │ ├── fake │ │ ├── clientset_generated.go │ │ ├── doc.go │ │ └── register.go │ │ ├── scheme │ │ ├── doc.go │ │ └── register.go │ │ └── typed │ │ ├── configuration │ │ └── v1alpha1 │ │ │ ├── configuration_client.go │ │ │ ├── configurationdomain.go │ │ │ ├── doc.go │ │ │ ├── fake │ │ │ ├── doc.go │ │ │ ├── fake_configuration_client.go │ │ │ └── fake_configurationdomain.go │ │ │ └── generated_expansion.go │ │ ├── platform │ │ └── v1alpha1 │ │ │ ├── doc.go │ │ │ ├── domain.go │ │ │ ├── fake │ │ │ ├── doc.go │ │ │ ├── fake_domain.go │ │ │ ├── fake_platform.go │ │ │ ├── fake_platform_client.go │ │ │ ├── fake_service.go │ │ │ └── fake_tenant.go │ │ │ ├── generated_expansion.go │ │ │ ├── platform.go │ │ │ ├── platform_client.go │ │ │ ├── service.go │ │ │ └── tenant.go │ │ └── provisioning │ │ └── v1alpha1 │ │ ├── azuredatabase.go │ │ ├── azuremanageddatabase.go │ │ ├── azurepowershellscript.go │ │ ├── azurevirtualdesktop.go │ │ ├── azurevirtualmachine.go │ │ ├── doc.go │ │ ├── entrauser.go │ │ ├── fake │ │ ├── doc.go │ │ ├── fake_azuredatabase.go │ │ ├── fake_azuremanageddatabase.go │ │ ├── fake_azurepowershellscript.go │ │ ├── fake_azurevirtualdesktop.go │ │ ├── fake_azurevirtualmachine.go │ │ ├── fake_entrauser.go │ │ ├── fake_helmrelease.go │ │ ├── fake_localscript.go │ │ ├── fake_miniobucket.go │ │ ├── fake_mssqldatabase.go │ │ └── fake_provisioning_client.go │ │ ├── generated_expansion.go │ │ ├── helmrelease.go │ │ ├── localscript.go │ │ ├── miniobucket.go │ │ ├── mssqldatabase.go │ │ └── provisioning_client.go ├── informers │ └── externalversions │ │ ├── configuration │ │ ├── interface.go │ │ └── v1alpha1 │ │ │ ├── configurationdomain.go │ │ │ └── interface.go │ │ ├── factory.go │ │ ├── generic.go │ │ ├── internalinterfaces │ │ └── factory_interfaces.go │ │ ├── platform │ │ ├── interface.go │ │ └── v1alpha1 │ │ │ ├── domain.go │ │ │ ├── interface.go │ │ │ ├── platform.go │ │ │ ├── service.go │ │ │ └── tenant.go │ │ └── provisioning │ │ ├── interface.go │ │ └── v1alpha1 │ │ ├── azuredatabase.go │ │ ├── azuremanageddatabase.go │ │ ├── azurepowershellscript.go │ │ ├── azurevirtualdesktop.go │ │ ├── azurevirtualmachine.go │ │ ├── entrauser.go │ │ ├── helmrelease.go │ │ ├── interface.go │ │ ├── localscript.go │ │ ├── miniobucket.go │ │ └── mssqldatabase.go └── listers │ ├── configuration │ └── v1alpha1 │ │ ├── configurationdomain.go │ │ └── expansion_generated.go │ ├── platform │ └── v1alpha1 │ │ ├── domain.go │ │ ├── expansion_generated.go │ │ ├── platform.go │ │ ├── service.go │ │ └── tenant.go │ └── provisioning │ └── v1alpha1 │ ├── azuredatabase.go │ ├── azuremanageddatabase.go │ ├── azurepowershellscript.go │ ├── azurevirtualdesktop.go │ ├── azurevirtualmachine.go │ ├── entrauser.go │ ├── expansion_generated.go │ ├── helmrelease.go │ ├── localscript.go │ ├── miniobucket.go │ └── mssqldatabase.go └── signals ├── signal.go ├── signal_posix.go └── signal_windows.go /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto 3 | 4 | # Explicitly declare text files you want to always be normalized and converted 5 | # to native line endings on checkout. 6 | *.go text 7 | *.yaml text -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name-template: v$NEXT_PATCH_VERSION 2 | tag-template: v$NEXT_PATCH_VERSION 3 | categories: 4 | - title: 🚀 Features 5 | label: feature 6 | - title: 🐛 Bug Fixes 7 | label: fix 8 | - title: 🛠️ Maintenance 9 | label: chore 10 | change-template: '- $TITLE @$AUTHOR (#$NUMBER)' 11 | template: | 12 | ## Changes 13 | 14 | $CHANGES 15 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | workflow_dispatch: 9 | 10 | jobs: 11 | 12 | build: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v2 16 | 17 | - name: Set up Go 18 | uses: actions/setup-go@v2 19 | with: 20 | go-version: '1.23' 21 | 22 | - name: Build 23 | run: make build-linux 24 | 25 | - name: Test 26 | run: make test 27 | -------------------------------------------------------------------------------- /.github/workflows/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name: Release Drafter 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | workflow_dispatch: 8 | 9 | jobs: 10 | update_release_draft: 11 | runs-on: ubuntu-latest 12 | steps: 13 | # Drafts your next Release notes as Pull Requests are merged into "main" 14 | - uses: release-drafter/release-drafter@v5 15 | env: 16 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # IDE settings 15 | .idea/** 16 | 17 | dist/** 18 | 19 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Run secrets controller", 9 | "type": "go", 10 | "request": "launch", 11 | "mode": "auto", 12 | "program": "./cmd/secrets-controller", 13 | "args": ["-v", "4"], 14 | "env": { 15 | "VAULT_ADDR": "http://localhost:64025/" 16 | } 17 | }, 18 | { 19 | "name": "Run provisioner", 20 | "type": "go", 21 | "request": "launch", 22 | "mode": "debug", 23 | "program": "./cmd/tenant-provisioner", 24 | "args": [ 25 | "--v", 26 | "4" 27 | ], 28 | "env": { 29 | "AZURE_LOCATION": "West Europe", 30 | //"VAULT_ENABLED": "false", 31 | "VAULT_ADDR": "http://localhost:54969/", 32 | //"VAULT_TOKEN": "PLEASE_ADD_VAULT_TOKEN", 33 | "AZURE_MANAGED_IDENTITY_RG": "global", 34 | "AZURE_MANAGED_IDENTITY_NAME": "scriptidentity", 35 | "AZURE_ENABLED": "true", 36 | "AWS_PROFILE": "minio", 37 | // "PULUMI_CONFIG_PASSPHRASE": "PLEASE_ADD_VAULT_TOKEN", 38 | // "PULUMI_BACKEND_URL": "s3://BUCKET_NAME?region=ro&endpoint=http://MINIO_HOST:9000&disableSSL=true&s3ForcePathStyle=true" 39 | //"RUSI_ENABLED": "true" 40 | //"PULUMI_SKIP_REFRESH": "true", 41 | }, 42 | }, 43 | { 44 | "name": "Run platform controller", 45 | "type": "go", 46 | "request": "launch", 47 | "mode": "auto", 48 | "program": "./cmd/platform-controller", 49 | "args": ["-v", "4"] 50 | }, 51 | { 52 | "name": "Run configuration domain controller", 53 | "type": "go", 54 | "request": "launch", 55 | "mode": "auto", 56 | "program": "./cmd/configuration-domain-controller", 57 | "args": ["-v", "4"], 58 | "env": { 59 | //"VAULT_ENABLED": "false", 60 | "VAULT_ADDR": "http://localhost:54969", 61 | //"VAULT_TOKEN": "PLEASE_ADD_VAULT_TOKEN"", 62 | //"RUSI_ENABLED": "true", 63 | "RUSI_GRPC_PORT": "7777" 64 | } 65 | } 66 | ] 67 | } -------------------------------------------------------------------------------- /GenerateCRD.md: -------------------------------------------------------------------------------- 1 | ## Prerequisites 2 | 3 | 1. Install go v1.21 from [here](https://golang.org/doc/install) 4 | 5 | 2. Install make 6 | ```bash 7 | apt install make 8 | ``` 9 | 3. Install the kubernetes code generator: 10 | ```bash 11 | go install k8s.io/code-generator@v0.28.2 12 | ``` 13 | 14 | 15 | ## Generate client 16 | Go to repository root and run the following make task: 17 | ```bash 18 | make generate-apis 19 | make generate-crd 20 | ``` -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Variables # 3 | ################################################################################ 4 | 5 | OUT_DIR := ./dist 6 | GIT_COMMIT = $(shell git rev-list -1 HEAD) 7 | GIT_VERSION = $(shell git describe --always --abbrev=7 --dirty) 8 | VERSION ?= edge 9 | 10 | # Helm template and install setting 11 | HELM:=helm 12 | RELEASE_NAME?=platform-controllers 13 | HELM_NAMESPACE?=default 14 | HELM_CHART_ROOT:=./helm 15 | 16 | ################################################################################ 17 | # Go build details # 18 | ################################################################################ 19 | BASE_PACKAGE_NAME := totalsoft.ro/platform-controllers 20 | 21 | DEFAULT_LDFLAGS:=-X $(BASE_PACKAGE_NAME)/internal/version.gitcommit=$(GIT_COMMIT) \ 22 | -X $(BASE_PACKAGE_NAME)/internal/version.gitversion=$(GIT_VERSION) \ 23 | -X $(BASE_PACKAGE_NAME)/internal/version.version=$(VERSION) 24 | 25 | ################################################################################ 26 | # Target: build-linux # 27 | ################################################################################ 28 | build-linux: 29 | mkdir -p $(OUT_DIR) 30 | CGO_ENABLED=0 GOOS=linux go build -o $(OUT_DIR) -ldflags "$(DEFAULT_LDFLAGS) -s -w" ./cmd/tenant-provisioner ./cmd/platform-controller ./cmd/configuration-domain-controller 31 | 32 | modtidy: 33 | go mod tidy 34 | 35 | upgrade-all: 36 | go get -u ./... 37 | go mod tidy 38 | 39 | init-proto: 40 | go install google.golang.org/protobuf/cmd/protoc-gen-go@latest 41 | go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest 42 | 43 | gen-proto: 44 | protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative internal/messaging/rusi/v1/rusi.proto 45 | 46 | test: 47 | CGO_ENABLED=0 go test -v `go list ./... | grep -v 'platform-controllers/pkg/generated'` 48 | 49 | include hack/generate_kube_crd.mk 50 | include docker/docker.mk 51 | include internal/controllers/provisioning/provisioners/pulumi/fluxcd/generate_pulumi_fluxcd_apis.mk 52 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:latest as builder 2 | RUN apk add -U --no-cache ca-certificates curl 3 | RUN curl -fsSL https://get.pulumi.com | sh 4 | #RUN /root/.pulumi/bin/pulumi plugin install resource azure-native 1.60.0 5 | 6 | FROM alpine:latest 7 | ARG PKG_FILES 8 | WORKDIR / 9 | 10 | RUN apk add -U --no-cache powershell bash 11 | 12 | RUN addgroup -g 1300 -S nonroot \ 13 | && adduser -u 1300 -S nonroot -G nonroot 14 | 15 | COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ 16 | COPY --from=builder --chown=nonroot /root/.pulumi/ /home/nonroot/.pulumi/ 17 | COPY --chown=nonroot /$PKG_FILES / 18 | ENV PATH="/home/nonroot/.pulumi/bin:${PATH}" 19 | USER nonroot 20 | -------------------------------------------------------------------------------- /docker/docker.mk: -------------------------------------------------------------------------------- 1 | # Docker image build and push setting 2 | DOCKER:=docker 3 | DOCKERFILE_DIR?=./docker 4 | 5 | # build docker image for linux 6 | BIN_PATH=$(OUT_DIR) 7 | DOCKERFILE:=Dockerfile 8 | 9 | check-docker-env: 10 | ifeq ($(DOCKER_REGISTRY),) 11 | $(error DOCKER_REGISTRY environment variable must be set) 12 | endif 13 | ifeq ($(DOCKER_TAG),) 14 | $(error DOCKER_TAG environment variable must be set) 15 | endif 16 | 17 | docker-build: check-docker-env 18 | $(DOCKER) build --build-arg PKG_FILES=* -f $(DOCKERFILE_DIR)/$(DOCKERFILE) $(BIN_PATH)/. -t $(DOCKER_REGISTRY)/$(RELEASE_NAME):$(DOCKER_TAG) 19 | 20 | docker-push: check-docker-env 21 | $(DOCKER) push $(DOCKER_REGISTRY)/$(RELEASE_NAME):$(DOCKER_TAG) 22 | 23 | docker-all: docker-build docker-push 24 | -------------------------------------------------------------------------------- /hack/boilerplate.go.txt: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | -------------------------------------------------------------------------------- /hack/generate_kube_crd.mk: -------------------------------------------------------------------------------- 1 | # https://github.com/kubernetes/code-generator 2 | # 3 | # go install k8s.io/code-generator@latest 4 | generate-apis: 5 | hack/update-codegen.sh 6 | 7 | 8 | #https://book.kubebuilder.io/reference/controller-gen.html 9 | # go install sigs.k8s.io/controller-tools/cmd/controller-gen@latest 10 | generate-crd: 11 | controller-gen crd paths="totalsoft.ro/platform-controllers/pkg/apis/..." +output:dir=helm/crds -------------------------------------------------------------------------------- /hack/update-codegen.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. 4 | CODE_GENERATOR_DIR=~/go/pkg/mod/k8s.io/code-generator@v0.28.2 5 | source "${CODE_GENERATOR_DIR}/kube_codegen.sh" 6 | 7 | kube::codegen::gen_helpers \ 8 | --input-pkg-root totalsoft.ro/platform-controllers/pkg/apis \ 9 | --output-base "./../.." \ 10 | --boilerplate "./hack/boilerplate.go.txt" 11 | 12 | kube::codegen::gen_client \ 13 | --with-watch \ 14 | --with-applyconfig \ 15 | --input-pkg-root totalsoft.ro/platform-controllers/pkg/apis \ 16 | --output-pkg-root totalsoft.ro/platform-controllers/pkg/generated \ 17 | --output-base "./../.." \ 18 | --boilerplate "./hack/boilerplate.go.txt" 19 | 20 | kube::codegen::gen_openapi \ 21 | --input-pkg-root totalsoft.ro/platform-controllers/pkg/apis \ 22 | --output-pkg-root totalsoft.ro/platform-controllers/pkg/generated \ 23 | --output-base "./../.." \ 24 | --boilerplate "./hack/boilerplate.go.txt" -------------------------------------------------------------------------------- /helm/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | .vscode/ 23 | -------------------------------------------------------------------------------- /helm/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | appVersion: "1.0" 3 | description: A Helm chart for TotalSoft platform controllers 4 | name: platform-controllers 5 | version: 0.0.1 6 | -------------------------------------------------------------------------------- /helm/crds/platform.totalsoft.ro_domains.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | annotations: 6 | controller-gen.kubebuilder.io/version: v0.17.3 7 | name: domains.platform.totalsoft.ro 8 | spec: 9 | group: platform.totalsoft.ro 10 | names: 11 | kind: Domain 12 | listKind: DomainList 13 | plural: domains 14 | singular: domain 15 | scope: Namespaced 16 | versions: 17 | - name: v1alpha1 18 | schema: 19 | openAPIV3Schema: 20 | properties: 21 | apiVersion: 22 | description: |- 23 | APIVersion defines the versioned schema of this representation of an object. 24 | Servers should convert recognized schemas to the latest internal value, and 25 | may reject unrecognized values. 26 | More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources 27 | type: string 28 | kind: 29 | description: |- 30 | Kind is a string value representing the REST resource this object represents. 31 | Servers may infer this from the endpoint the client submits requests to. 32 | Cannot be updated. 33 | In CamelCase. 34 | More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 35 | type: string 36 | metadata: 37 | type: object 38 | spec: 39 | properties: 40 | exportActiveDomains: 41 | type: boolean 42 | platformRef: 43 | description: PlatformRef is the target platform. 44 | type: string 45 | required: 46 | - platformRef 47 | type: object 48 | required: 49 | - spec 50 | type: object 51 | served: true 52 | storage: true 53 | -------------------------------------------------------------------------------- /helm/crds/platform.totalsoft.ro_services.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | annotations: 6 | controller-gen.kubebuilder.io/version: v0.17.3 7 | name: services.platform.totalsoft.ro 8 | spec: 9 | group: platform.totalsoft.ro 10 | names: 11 | kind: Service 12 | listKind: ServiceList 13 | plural: services 14 | singular: service 15 | scope: Namespaced 16 | versions: 17 | - name: v1alpha1 18 | schema: 19 | openAPIV3Schema: 20 | description: Service describes a business service. 21 | properties: 22 | apiVersion: 23 | description: |- 24 | APIVersion defines the versioned schema of this representation of an object. 25 | Servers should convert recognized schemas to the latest internal value, and 26 | may reject unrecognized values. 27 | More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources 28 | type: string 29 | kind: 30 | description: |- 31 | Kind is a string value representing the REST resource this object represents. 32 | Servers may infer this from the endpoint the client submits requests to. 33 | Cannot be updated. 34 | In CamelCase. 35 | More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 36 | type: string 37 | metadata: 38 | type: object 39 | spec: 40 | properties: 41 | optionalDomainRefs: 42 | description: OptionalDomainRefs are the optional business domains 43 | associated to this service. 44 | items: 45 | type: string 46 | type: array 47 | platformRef: 48 | description: PlatformRef is the target platform. 49 | type: string 50 | requiredDomainRefs: 51 | description: RequiredDomainRefs are the required business domains 52 | associated to this service. 53 | items: 54 | type: string 55 | type: array 56 | required: 57 | - platformRef 58 | - requiredDomainRefs 59 | type: object 60 | required: 61 | - spec 62 | type: object 63 | served: true 64 | storage: true 65 | -------------------------------------------------------------------------------- /helm/templates/configuration-domain-controller-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: configuration-domain-controller 5 | labels: 6 | app: configuration-domain-controller 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: configuration-domain-controller 12 | template: 13 | metadata: 14 | annotations: 15 | {{- if .Values.global.rusi.enabled }} 16 | rusi.io/app-id: ConfigurationDomain.Controller 17 | rusi.io/enabled: "true" 18 | {{- end }} 19 | labels: 20 | app: configuration-domain-controller 21 | app.kubernetes.io/name: {{ .Release.Name }} 22 | app.kubernetes.io/version: {{ .Values.global.tag }} 23 | app.kubernetes.io/managed-by: "helm" 24 | spec: 25 | containers: 26 | - name: configuration-domain-controller 27 | image: "{{ .Values.global.registry }}/platform-controllers:{{ .Values.global.tag }}" 28 | imagePullPolicy: {{ .Values.global.imagePullPolicy }} 29 | env: 30 | - name: NAMESPACE 31 | valueFrom: 32 | fieldRef: 33 | fieldPath: metadata.namespace 34 | - name: VAULT_ENABLED 35 | value: {{ .Values.global.vault.enabled | quote }} 36 | {{- if .Values.global.vault.enabled }} 37 | - name: VAULT_ADDR 38 | value: "{{ .Values.global.vault.address }}" 39 | {{- end }} 40 | - name: RUSI_ENABLED 41 | value: "{{ .Values.global.rusi.enabled }}" 42 | command: 43 | - "/configuration-domain-controller" 44 | args: 45 | - "--v" 46 | - "{{ .Values.global.logLevel }}" 47 | serviceAccountName: configuration-domain-controller 48 | {{- if .Values.global.imagePullSecrets }} 49 | imagePullSecrets: 50 | - name: {{ .Values.global.imagePullSecrets }} 51 | {{- end }} -------------------------------------------------------------------------------- /helm/templates/platform-controller-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: platform-controller 5 | labels: 6 | app: platform-controller 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: platform-controller 12 | template: 13 | metadata: 14 | annotations: 15 | {{- if .Values.global.rusi.enabled }} 16 | rusi.io/app-id: Platform.Controller 17 | rusi.io/enabled: "true" 18 | {{- end }} 19 | labels: 20 | app: platform-controller 21 | app.kubernetes.io/name: {{ .Release.Name }} 22 | app.kubernetes.io/version: {{ .Values.global.tag }} 23 | app.kubernetes.io/managed-by: "helm" 24 | spec: 25 | containers: 26 | - name: platform-controller 27 | image: "{{ .Values.global.registry }}/platform-controllers:{{ .Values.global.tag }}" 28 | imagePullPolicy: {{ .Values.global.imagePullPolicy }} 29 | env: 30 | - name: NAMESPACE 31 | valueFrom: 32 | fieldRef: 33 | fieldPath: metadata.namespace 34 | - name: RUSI_ENABLED 35 | value: "{{ .Values.global.rusi.enabled }}" 36 | command: 37 | - "/platform-controller" 38 | args: 39 | - "--v" 40 | - "{{ .Values.global.logLevel }}" 41 | serviceAccountName: platform-controller 42 | {{- if .Values.global.imagePullSecrets }} 43 | imagePullSecrets: 44 | - name: {{ .Values.global.imagePullSecrets }} 45 | {{- end }} -------------------------------------------------------------------------------- /helm/values.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | registry: ghcr.io/osstotalsoft/platform-controllers 3 | tag: "0.0.1" 4 | imagePullPolicy: IfNotPresent 5 | imagePullSecrets: "registrykey" 6 | logLevel: 4 7 | vault: 8 | enabled: true 9 | address: http://vault.vault:8200 10 | rusi: 11 | enabled: true 12 | azure: 13 | enabled: true 14 | backend: 15 | type: cloud # cloud | custom 16 | customBackedUrl: s3://my-bucket?region=ro&endpoint=http://my-minio-server:9000&disableSSL=true&s3ForcePathStyle=true 17 | s3: 18 | enabled: false 19 | profile: minio 20 | minio: 21 | enabled: false 22 | endpoint: http://my-minio-server:9000 23 | workersCount: 5 24 | 25 | -------------------------------------------------------------------------------- /internal/controllers/controller_consts.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | const ( 4 | SucceededReason string = "Succeeded" 5 | FailedReason string = "Failed" 6 | ProgressingReason string = "Progressing" 7 | SuccessSynced string = "Synced successfully" 8 | ErrorSynced string = "Error" 9 | 10 | PlatformLabelName = "platform.totalsoft.ro/platform" 11 | DomainLabelName = "platform.totalsoft.ro/domain" 12 | GlobalDomainLabelValue = "global" 13 | ) 14 | -------------------------------------------------------------------------------- /internal/controllers/platform/platform_events.go: -------------------------------------------------------------------------------- 1 | package platform 2 | 3 | import ( 4 | platformv1 "totalsoft.ro/platform-controllers/pkg/apis/platform/v1alpha1" 5 | ) 6 | 7 | const ( 8 | SyncedSuccessfullyTopic string = "PlatformControllers.PlatformController.SyncedSuccessfully" 9 | TenantCreatedSuccessfullyTopic string = "PlatformControllers.PlatformController.TenantCreatedSuccessfully" 10 | TenantUpdatedSuccessfullyTopic string = "PlatformControllers.PlatformController.TenantUpdatedSuccessfully" 11 | TenantDeletedSuccessfullyTopic string = "PlatformControllers.PlatformController.TenantDeletedSuccessfully" 12 | DomainCreatedSuccessfullyTopic string = "PlatformControllers.PlatformController.DomainCreatedSuccessfully" 13 | DomainUpdatedSuccessfullyTopic string = "PlatformControllers.PlatformController.DomainUpdatedSuccessfully" 14 | DomainDeletedSuccessfullyTopic string = "PlatformControllers.PlatformController.DomainDeletedSuccessfully" 15 | ServiceCreatedSuccessfullyTopic string = "PlatformControllers.PlatformController.ServiceCreatedSuccessfully" 16 | ServiceUpdatedSuccessfullyTopic string = "PlatformControllers.PlatformController.ServiceUpdatedSuccessfully" 17 | ServiceDeletedSuccessfullyTopic string = "PlatformControllers.PlatformController.ServiceDeletedSuccessfully" 18 | ) 19 | 20 | type TenantCreated struct { 21 | TenantId string 22 | TenantName string 23 | } 24 | type TenantUpdated struct { 25 | TenantId string 26 | TenantName string 27 | Description string 28 | PlatformRef string 29 | Enabled bool 30 | DomainRefs []string 31 | AdminEmail string 32 | DeletePolicy platformv1.DeletePolicy 33 | Configs map[string]string 34 | } 35 | type TenantDeleted struct { 36 | TenantId string 37 | } 38 | 39 | type DomainCreated struct { 40 | DomainName string 41 | Namespace string 42 | PlatformRef string 43 | } 44 | 45 | type DomainUpdated struct { 46 | oldValue Domain 47 | newValue Domain 48 | } 49 | 50 | type Domain struct { 51 | DomainName string 52 | Namespace string 53 | PlatformRef string 54 | ExportActiveDomains bool 55 | } 56 | 57 | type DomainDeleted struct { 58 | DomainName string 59 | Namespace string 60 | } 61 | 62 | type ServiceCreated struct { 63 | ServiceName string 64 | Namespace string 65 | PlatformRef string 66 | } 67 | 68 | type ServiceUpdated struct { 69 | ServiceName string 70 | Namespace string 71 | PlatformRef string 72 | RequiredDomainRefs []string 73 | OptionalDomainRefs []string 74 | } 75 | 76 | type ServiceDeleted struct { 77 | ServiceName string 78 | Namespace string 79 | } 80 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/migration/migration.go: -------------------------------------------------------------------------------- 1 | package migration 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "time" 7 | 8 | v1 "k8s.io/api/batch/v1" 9 | corev1 "k8s.io/api/core/v1" 10 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 11 | "k8s.io/apimachinery/pkg/labels" 12 | "k8s.io/client-go/kubernetes" 13 | "k8s.io/klog/v2" 14 | platformv1 "totalsoft.ro/platform-controllers/pkg/apis/platform/v1alpha1" 15 | ) 16 | 17 | const ( 18 | jobTemplateLabel = "provisioning.totalsoft.ro/migration-job-template" 19 | domainLabel = "platform.totalsoft.ro/domain" 20 | ) 21 | 22 | func KubeJobsMigrationForTenant(kubeClient kubernetes.Interface, 23 | nsFilter func(string, string) bool) func(platform string, tenant *platformv1.Tenant, domain string) error { 24 | namer := func(jName, tenant string) string { 25 | return fmt.Sprintf("%s-%s-%d", jName, tenant, time.Now().Unix()) 26 | } 27 | 28 | return func(platform string, tenant *platformv1.Tenant, domain string) error { 29 | klog.InfoS("Creating migrations jobs", "tenant", tenant.Name, "domain", domain) 30 | 31 | labelSelector, err := labels.ValidatedSelectorFromSet(map[string]string{ 32 | domainLabel: domain, 33 | jobTemplateLabel: "true", 34 | }) 35 | if err != nil { 36 | return err 37 | } 38 | 39 | jobs, err := kubeClient.BatchV1().Jobs("").List(context.TODO(), metav1.ListOptions{ 40 | LabelSelector: labelSelector.String(), 41 | }) 42 | if err != nil { 43 | return err 44 | } 45 | 46 | klog.V(4).InfoS("migrations", "template jobs found", len(jobs.Items)) 47 | 48 | for _, job := range jobs.Items { 49 | if !nsFilter(job.Namespace, platform) { 50 | continue 51 | } 52 | j := &v1.Job{ 53 | ObjectMeta: metav1.ObjectMeta{ 54 | Name: namer(job.Name, tenant.Name), 55 | Namespace: job.Namespace, 56 | }, 57 | Spec: v1.JobSpec{ 58 | Template: corev1.PodTemplateSpec{ 59 | Spec: job.Spec.Template.Spec, 60 | }, 61 | }, 62 | } 63 | 64 | for i, c := range j.Spec.Template.Spec.InitContainers { 65 | c.Env = append(c.Env, corev1.EnvVar{Name: "TENANT_ID", Value: tenant.Spec.Id}) 66 | j.Spec.Template.Spec.InitContainers[i] = c 67 | } 68 | for i, c := range j.Spec.Template.Spec.Containers { 69 | c.Env = append(c.Env, corev1.EnvVar{Name: "TENANT_ID", Value: tenant.Spec.Id}) 70 | j.Spec.Template.Spec.Containers[i] = c 71 | } 72 | _, err = kubeClient.BatchV1().Jobs(job.Namespace).Create(context.TODO(), j, metav1.CreateOptions{}) 73 | if err != nil { 74 | klog.ErrorS(err, "error creating migration job") 75 | } 76 | } 77 | 78 | return err 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/migration/migration_test.go: -------------------------------------------------------------------------------- 1 | package migration 2 | 3 | import ( 4 | "context" 5 | "testing" 6 | 7 | v1 "k8s.io/api/batch/v1" 8 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 9 | "k8s.io/apimachinery/pkg/runtime" 10 | "k8s.io/client-go/kubernetes/fake" 11 | platformv1 "totalsoft.ro/platform-controllers/pkg/apis/platform/v1alpha1" 12 | ) 13 | 14 | func TestKubeJobsMigrationForTenant(t *testing.T) { 15 | domain := "test-domain" 16 | objects := []runtime.Object{ 17 | newJob("dev1", domain, true), 18 | newJob("dev2", domain, true), 19 | newJob("dev3", domain, false), 20 | newJob("dev4", "some-other-domain", true), 21 | } 22 | kubeClient := fake.NewSimpleClientset(objects...) 23 | migrator := KubeJobsMigrationForTenant(kubeClient, func(s string, s2 string) bool { 24 | return true 25 | }) 26 | t.Run("test job selection by label", func(t *testing.T) { 27 | migrator("test", newTenant("qa", "qa"), domain) 28 | jobs, _ := kubeClient.BatchV1().Jobs(metav1.NamespaceDefault).List(context.TODO(), metav1.ListOptions{}) 29 | expectedNoOfJobs := 4 + 2 //4 existing + 2 new jobs 30 | if len(jobs.Items) != expectedNoOfJobs { 31 | t.Errorf("Error running migration, expected %d jobs but found %d", expectedNoOfJobs, len(jobs.Items)) 32 | } 33 | }) 34 | } 35 | 36 | func newJob(name, domain string, template bool) *v1.Job { 37 | j := &v1.Job{ 38 | TypeMeta: metav1.TypeMeta{APIVersion: platformv1.SchemeGroupVersion.String()}, 39 | ObjectMeta: metav1.ObjectMeta{ 40 | Name: name, 41 | Namespace: metav1.NamespaceDefault, 42 | }, 43 | Spec: v1.JobSpec{}, 44 | } 45 | if template { 46 | j.SetLabels(map[string]string{ 47 | jobTemplateLabel: "true", 48 | domainLabel: domain, 49 | }) 50 | } 51 | return j 52 | } 53 | 54 | func newTenant(name, platform string) *platformv1.Tenant { 55 | return &platformv1.Tenant{ 56 | TypeMeta: metav1.TypeMeta{APIVersion: platformv1.SchemeGroupVersion.String()}, 57 | ObjectMeta: metav1.ObjectMeta{ 58 | Name: name, 59 | Namespace: metav1.NamespaceDefault, 60 | }, 61 | Spec: platformv1.TenantSpec{ 62 | PlatformRef: platform, 63 | Description: name + " description", 64 | }, 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/provisioners/pulumi/azure_powershell_script_test.go: -------------------------------------------------------------------------------- 1 | package pulumi 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 7 | "github.com/stretchr/testify/assert" 8 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 9 | provisioningv1 "totalsoft.ro/platform-controllers/pkg/apis/provisioning/v1alpha1" 10 | ) 11 | 12 | func TestDeployAzurePowerShellScript(t *testing.T) { 13 | t.Run("maximal entra user spec", func(t *testing.T) { 14 | platform := "dev" 15 | tenant := newTenant("tenant1", platform) 16 | script := &provisioningv1.AzurePowerShellScript{ 17 | ObjectMeta: metav1.ObjectMeta{ 18 | Name: "my-pwsh-script", 19 | }, 20 | Spec: provisioningv1.AzurePowerShellScriptSpec{ 21 | ScriptContent: "Write-Host 'Hello, World!'", 22 | ProvisioningMeta: provisioningv1.ProvisioningMeta{ 23 | DomainRef: "example-domain", 24 | }, 25 | }, 26 | } 27 | 28 | err := pulumi.RunErr(func(ctx *pulumi.Context) error { 29 | script, err := deployAzurePowerShellScript(tenant, pulumi.String("rg").ToStringOutput(), script, []pulumi.Resource{}, ctx) 30 | assert.NoError(t, err) 31 | assert.NotNil(t, script) 32 | return nil 33 | 34 | }, pulumi.WithMocks("project", "stack", mocks(0))) 35 | assert.NoError(t, err) 36 | }) 37 | } 38 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/provisioners/pulumi/azure_resource_group.go: -------------------------------------------------------------------------------- 1 | package pulumi 2 | 3 | import ( 4 | "fmt" 5 | 6 | azureResources "github.com/pulumi/pulumi-azure-native-sdk/resources/v2" 7 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 8 | "totalsoft.ro/platform-controllers/internal/controllers/provisioning" 9 | platformv1 "totalsoft.ro/platform-controllers/pkg/apis/platform/v1alpha1" 10 | ) 11 | 12 | func deployAzureRG(target provisioning.ProvisioningTarget, domain string) func(ctx *pulumi.Context) (pulumi.StringOutput, error) { 13 | return func(ctx *pulumi.Context) (pulumi.StringOutput, error) { 14 | resourceGroupName := provisioning.MatchTarget(target, 15 | func(tenant *platformv1.Tenant) string { 16 | return fmt.Sprintf("%s-%s-%s", tenant.Spec.PlatformRef, tenant.GetName(), domain) 17 | }, 18 | func(platform *platformv1.Platform) string { 19 | return fmt.Sprintf("%s-%s", platform.GetName(), domain) 20 | }, 21 | ) 22 | 23 | pulumiRetainOnDelete := provisioning.GetDeletePolicy(target) == platformv1.DeletePolicyRetainStatefulResources 24 | 25 | resourceGroup, err := azureResources.NewResourceGroup(ctx, resourceGroupName, &azureResources.ResourceGroupArgs{ 26 | ResourceGroupName: pulumi.String(resourceGroupName), 27 | }, pulumi.RetainOnDelete(pulumiRetainOnDelete)) 28 | if err != nil { 29 | return pulumi.StringOutput{}, err 30 | } 31 | ctx.Export("azureRGName", resourceGroup.Name) 32 | return resourceGroup.Name, nil 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/provisioners/pulumi/azure_virtual_desktop_test.go: -------------------------------------------------------------------------------- 1 | package pulumi 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 7 | "github.com/stretchr/testify/assert" 8 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 9 | provisioningv1 "totalsoft.ro/platform-controllers/pkg/apis/provisioning/v1alpha1" 10 | ) 11 | 12 | func TestAzureVirtualDesktopDeployFunc(t *testing.T) { 13 | platform := "dev" 14 | tenant := newTenant("tenant1", platform) 15 | vm := newVirtualDesktop("my-virtual-Desktop", platform) 16 | rg := pulumi.String("my-rg").ToStringOutput() 17 | 18 | t.Run("maximal virtual Desktop spec", func(t *testing.T) { 19 | err := pulumi.RunErr(func(ctx *pulumi.Context) error { 20 | _, err := deployAzureVirtualDesktop(tenant, rg, vm, []pulumi.Resource{}, ctx) 21 | assert.NoError(t, err) 22 | return nil 23 | }, pulumi.WithMocks("project", "stack", mocks(0))) 24 | assert.NoError(t, err) 25 | }) 26 | 27 | t.Run("virtual Desktop with nil exports spec", func(t *testing.T) { 28 | err := pulumi.RunErr(func(ctx *pulumi.Context) error { 29 | hr := vm.DeepCopy() 30 | hr.Spec.Exports = nil 31 | _, err := deployAzureVirtualDesktop(tenant, rg, vm, []pulumi.Resource{}, ctx) 32 | assert.NoError(t, err) 33 | return nil 34 | }, pulumi.WithMocks("project", "stack", mocks(0))) 35 | assert.NoError(t, err) 36 | }) 37 | 38 | t.Run("virtual Desktop with trusted launch security", func(t *testing.T) { 39 | err := pulumi.RunErr(func(ctx *pulumi.Context) error { 40 | hr := vm.DeepCopy() 41 | hr.Spec.EnableTrustedLaunch = true 42 | _, err := deployAzureVirtualDesktop(tenant, rg, vm, []pulumi.Resource{}, ctx) 43 | assert.NoError(t, err) 44 | return nil 45 | }, pulumi.WithMocks("project", "stack", mocks(0))) 46 | assert.NoError(t, err) 47 | }) 48 | } 49 | 50 | func newVirtualDesktop(name, platform string) *provisioningv1.AzureVirtualDesktop { 51 | false := false 52 | 53 | hr := provisioningv1.AzureVirtualDesktop{ 54 | ObjectMeta: metav1.ObjectMeta{ 55 | Name: name, 56 | Namespace: metav1.NamespaceDefault, 57 | }, 58 | Spec: provisioningv1.AzureVirtualDesktopSpec{ 59 | ProvisioningMeta: provisioningv1.ProvisioningMeta{ 60 | PlatformRef: platform, 61 | }, 62 | HostPoolName: "test-vm", 63 | VmSize: "Standard_B1s", 64 | OSDiskType: "Standard_LRS", 65 | SourceImageId: "/subscriptions/.../my-image/versions/1.0.0", 66 | SubnetId: "/subscriptions/.../my-vnet/subnets/default", 67 | EnableTrustedLaunch: false, 68 | Exports: []provisioningv1.AzureVirtualDesktopExportsSpec{ 69 | { 70 | Domain: "myDomain", 71 | HostPoolName: provisioningv1.ValueExport{ 72 | ToConfigMap: provisioningv1.ConfigMapTemplate{ 73 | KeyTemplate: "MultiTenancy__Tenants__{{ .Tenant.Code }}__CharismaClient_HostPool_Name", 74 | }, 75 | }, 76 | }, 77 | }, 78 | }, 79 | } 80 | return &hr 81 | } 82 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/provisioners/pulumi/azure_virtual_machine_test.go: -------------------------------------------------------------------------------- 1 | package pulumi 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 7 | "github.com/stretchr/testify/assert" 8 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 9 | provisioningv1 "totalsoft.ro/platform-controllers/pkg/apis/provisioning/v1alpha1" 10 | ) 11 | 12 | func TestAzureVMDeployFunc(t *testing.T) { 13 | platform := "dev" 14 | tenant := newTenant("tenant1", platform) 15 | vm := newVm("my-virtual-machine", platform) 16 | rg := pulumi.String("my-rg").ToStringOutput() 17 | 18 | t.Run("maximal virtual machine spec", func(t *testing.T) { 19 | err := pulumi.RunErr(func(ctx *pulumi.Context) error { 20 | _, err := deployAzureVirtualMachine(tenant, rg, vm, []pulumi.Resource{}, ctx) 21 | assert.NoError(t, err) 22 | return nil 23 | }, pulumi.WithMocks("project", "stack", mocks(0))) 24 | assert.NoError(t, err) 25 | }) 26 | 27 | t.Run("virtual machine with nil exports spec", func(t *testing.T) { 28 | err := pulumi.RunErr(func(ctx *pulumi.Context) error { 29 | hr := vm.DeepCopy() 30 | hr.Spec.Exports = nil 31 | _, err := deployAzureVirtualMachine(tenant, rg, vm, []pulumi.Resource{}, ctx) 32 | assert.NoError(t, err) 33 | return nil 34 | }, pulumi.WithMocks("project", "stack", mocks(0))) 35 | assert.NoError(t, err) 36 | }) 37 | 38 | t.Run("virtual machine with trusted launch security", func(t *testing.T) { 39 | err := pulumi.RunErr(func(ctx *pulumi.Context) error { 40 | hr := vm.DeepCopy() 41 | hr.Spec.EnableTrustedLaunch = true 42 | _, err := deployAzureVirtualMachine(tenant, rg, vm, []pulumi.Resource{}, ctx) 43 | assert.NoError(t, err) 44 | return nil 45 | }, pulumi.WithMocks("project", "stack", mocks(0))) 46 | assert.NoError(t, err) 47 | }) 48 | } 49 | 50 | func newVm(name, platform string) *provisioningv1.AzureVirtualMachine { 51 | false := false 52 | 53 | hr := provisioningv1.AzureVirtualMachine{ 54 | ObjectMeta: metav1.ObjectMeta{ 55 | Name: name, 56 | Namespace: metav1.NamespaceDefault, 57 | }, 58 | Spec: provisioningv1.AzureVirtualMachineSpec{ 59 | ProvisioningMeta: provisioningv1.ProvisioningMeta{ 60 | PlatformRef: platform, 61 | }, 62 | VmName: "test-vm", 63 | VmSize: "Standard_B1s", 64 | OSDiskType: "Standard_LRS", 65 | SourceImageId: "/subscriptions/.../my-image/versions/1.0.0", 66 | SubnetId: "/subscriptions/.../my-vnet/subnets/default", 67 | RdpSourceAddressPrefix: "128.12.2.11/24", 68 | EnableTrustedLaunch: false, 69 | Exports: []provisioningv1.AzureVirtualMachineExportsSpec{ 70 | { 71 | Domain: "myDomain", 72 | VmName: provisioningv1.ValueExport{ 73 | ToConfigMap: provisioningv1.ConfigMapTemplate{ 74 | KeyTemplate: "MultiTenancy__Tenants__{{ .Tenant.Code }}__CharismaClient_VM_Name", 75 | }, 76 | }, 77 | }, 78 | }, 79 | }, 80 | } 81 | return &hr 82 | } 83 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/provisioners/pulumi/entra_user.go: -------------------------------------------------------------------------------- 1 | package pulumi 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" 7 | "github.com/pulumi/pulumi-random/sdk/v4/go/random" 8 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 9 | "totalsoft.ro/platform-controllers/internal/controllers/provisioning" 10 | provisioningv1 "totalsoft.ro/platform-controllers/pkg/apis/provisioning/v1alpha1" 11 | ) 12 | 13 | func deployEntraUser(target provisioning.ProvisioningTarget, 14 | entraUser *provisioningv1.EntraUser, 15 | dependencies []pulumi.Resource, 16 | ctx *pulumi.Context) (*azuread.User, error) { 17 | 18 | valueExporter := handleValueExport(target) 19 | gvk := provisioningv1.SchemeGroupVersion.WithKind("EntraUser") 20 | 21 | initialPassword := pulumi.String(entraUser.Spec.InitialPassword).ToStringOutput() 22 | if entraUser.Spec.InitialPassword == "" { 23 | randomPassword, err := random.NewRandomPassword(ctx, fmt.Sprintf("%s-initial-password", entraUser.Spec.UserPrincipalName), &random.RandomPasswordArgs{ 24 | Length: pulumi.Int(10), 25 | Upper: pulumi.Bool(true), 26 | MinUpper: pulumi.Int(1), 27 | Lower: pulumi.Bool(true), 28 | MinLower: pulumi.Int(1), 29 | Numeric: pulumi.Bool(true), 30 | MinNumeric: pulumi.Int(1), 31 | Special: pulumi.Bool(true), 32 | MinSpecial: pulumi.Int(1), 33 | }) 34 | 35 | if err != nil { 36 | return nil, err 37 | } 38 | 39 | initialPassword = randomPassword.Result 40 | } 41 | 42 | user, err := azuread.NewUser(ctx, entraUser.Name, &azuread.UserArgs{ 43 | UserPrincipalName: pulumi.String(entraUser.Spec.UserPrincipalName), 44 | DisplayName: pulumi.String(entraUser.Spec.DisplayName), 45 | Password: initialPassword, 46 | ForcePasswordChange: pulumi.Bool(true), 47 | }, pulumi.DependsOn(dependencies)) 48 | if err != nil { 49 | return nil, err 50 | } 51 | 52 | for _, exp := range entraUser.Spec.Exports { 53 | domain := exp.Domain 54 | if domain == "" { 55 | domain = entraUser.Spec.DomainRef 56 | } 57 | 58 | err = valueExporter(newExportContext(ctx, domain, entraUser.Name, entraUser.ObjectMeta, gvk), 59 | map[string]exportTemplateWithValue{ 60 | "initialPassword": {exp.InitialPassword, initialPassword}, 61 | "userPrincipalName": {exp.UserPrincipalName, pulumi.String(entraUser.Spec.UserPrincipalName)}, 62 | }) 63 | if err != nil { 64 | return nil, err 65 | } 66 | } 67 | return user, nil 68 | } 69 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/provisioners/pulumi/entra_user_test.go: -------------------------------------------------------------------------------- 1 | package pulumi 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 7 | "github.com/stretchr/testify/assert" 8 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 9 | provisioningv1 "totalsoft.ro/platform-controllers/pkg/apis/provisioning/v1alpha1" 10 | ) 11 | 12 | func TestDeployEntraUser(t *testing.T) { 13 | t.Run("maximal entra user spec", func(t *testing.T) { 14 | platform := "dev" 15 | tenant := newTenant("tenant1", platform) 16 | entraUser := &provisioningv1.EntraUser{ 17 | ObjectMeta: metav1.ObjectMeta{ 18 | Name: "my-entra-user", 19 | }, 20 | Spec: provisioningv1.EntraUserSpec{ 21 | UserPrincipalName: "user@example.com", 22 | DisplayName: "Example User", 23 | InitialPassword: "password123", 24 | ProvisioningMeta: provisioningv1.ProvisioningMeta{ 25 | DomainRef: "example-domain", 26 | }, 27 | }, 28 | } 29 | 30 | err := pulumi.RunErr(func(ctx *pulumi.Context) error { 31 | user, err := deployEntraUser(tenant, entraUser, []pulumi.Resource{}, ctx) 32 | assert.NoError(t, err) 33 | assert.NotNil(t, user) 34 | return nil 35 | 36 | }, pulumi.WithMocks("project", "stack", mocks(0))) 37 | assert.NoError(t, err) 38 | }) 39 | } 40 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/provisioners/pulumi/fluxcd/generate_pulumi_fluxcd_apis.mk: -------------------------------------------------------------------------------- 1 | # https://github.com/pulumi/crd2pulumi 2 | # 3 | # go install github.com/pulumi/crd2pulumi@latest 4 | generate-pulumi-fluxcd-apis: 5 | crd2pulumi --goPath ./internal/controllers/provisioning/provisioners/pulumi/fluxcd/generated ./internal/controllers/provisioning/provisioners/pulumi/fluxcd/helm.toolkit.fluxcd.io_helmreleases.yaml 6 | 7 | 8 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/provisioners/pulumi/fluxcd/kubernetes/doc.go: -------------------------------------------------------------------------------- 1 | // Package crds exports types, functions, subpackages for provisioning crds resources. 2 | // 3 | package kubernetes 4 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/provisioners/pulumi/fluxcd/kubernetes/helm/v2beta1/init.go: -------------------------------------------------------------------------------- 1 | // Code generated by crd2pulumi DO NOT EDIT. 2 | // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | package v2beta1 5 | 6 | import ( 7 | "fmt" 8 | 9 | "github.com/blang/semver" 10 | "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes" 11 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 | ) 13 | 14 | type module struct { 15 | version semver.Version 16 | } 17 | 18 | func (m *module) Version() semver.Version { 19 | return m.version 20 | } 21 | 22 | func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi.Resource, err error) { 23 | switch typ { 24 | case "kubernetes:helm.toolkit.fluxcd.io/v2beta1:HelmRelease": 25 | r = &HelmRelease{} 26 | default: 27 | return nil, fmt.Errorf("unknown resource type: %s", typ) 28 | } 29 | 30 | err = ctx.RegisterResource(typ, name, nil, r, pulumi.URN_(urn)) 31 | return 32 | } 33 | 34 | func init() { 35 | version, err := kubernetes.PkgVersion() 36 | if err != nil { 37 | version = semver.Version{Major: 1} 38 | } 39 | pulumi.RegisterResourceModule( 40 | "crds", 41 | "helm.toolkit.fluxcd.io/v2beta1", 42 | &module{version}, 43 | ) 44 | } 45 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/provisioners/pulumi/fluxcd/kubernetes/helm/v2beta1/pulumiUtilities.go: -------------------------------------------------------------------------------- 1 | // Code generated by crd2pulumi DO NOT EDIT. 2 | // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | package v2beta1 5 | 6 | import ( 7 | "fmt" 8 | "os" 9 | "reflect" 10 | "regexp" 11 | "strconv" 12 | "strings" 13 | 14 | "github.com/blang/semver" 15 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 16 | ) 17 | 18 | type envParser func(v string) interface{} 19 | 20 | func parseEnvBool(v string) interface{} { 21 | b, err := strconv.ParseBool(v) 22 | if err != nil { 23 | return nil 24 | } 25 | return b 26 | } 27 | 28 | func parseEnvInt(v string) interface{} { 29 | i, err := strconv.ParseInt(v, 0, 0) 30 | if err != nil { 31 | return nil 32 | } 33 | return int(i) 34 | } 35 | 36 | func parseEnvFloat(v string) interface{} { 37 | f, err := strconv.ParseFloat(v, 64) 38 | if err != nil { 39 | return nil 40 | } 41 | return f 42 | } 43 | 44 | func parseEnvStringArray(v string) interface{} { 45 | var result pulumi.StringArray 46 | for _, item := range strings.Split(v, ";") { 47 | result = append(result, pulumi.String(item)) 48 | } 49 | return result 50 | } 51 | 52 | func getEnvOrDefault(def interface{}, parser envParser, vars ...string) interface{} { 53 | for _, v := range vars { 54 | if value := os.Getenv(v); value != "" { 55 | if parser != nil { 56 | return parser(value) 57 | } 58 | return value 59 | } 60 | } 61 | return def 62 | } 63 | 64 | // PkgVersion uses reflection to determine the version of the current package. 65 | // If a version cannot be determined, v1 will be assumed. The second return 66 | // value is always nil. 67 | func PkgVersion() (semver.Version, error) { 68 | type sentinal struct{} 69 | pkgPath := reflect.TypeOf(sentinal{}).PkgPath() 70 | re := regexp.MustCompile("^.*/pulumi-crds/sdk(/v\\d+)?") 71 | if match := re.FindStringSubmatch(pkgPath); match != nil { 72 | vStr := match[1] 73 | if len(vStr) == 0 { // If the version capture group was empty, default to v1. 74 | return semver.Version{Major: 1}, nil 75 | } 76 | return semver.MustParse(fmt.Sprintf("%s.0.0", vStr[2:])), nil 77 | } 78 | return semver.Version{Major: 1}, nil 79 | } 80 | 81 | // isZero is a null safe check for if a value is it's types zero value. 82 | func isZero(v interface{}) bool { 83 | if v == nil { 84 | return true 85 | } 86 | return reflect.ValueOf(v).IsZero() 87 | } 88 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/provisioners/pulumi/fluxcd/kubernetes/init.go: -------------------------------------------------------------------------------- 1 | // Code generated by crd2pulumi DO NOT EDIT. 2 | // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | package kubernetes 5 | 6 | import ( 7 | "fmt" 8 | 9 | "github.com/blang/semver" 10 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 11 | ) 12 | 13 | type pkg struct { 14 | version semver.Version 15 | } 16 | 17 | func (p *pkg) Version() semver.Version { 18 | return p.version 19 | } 20 | 21 | func (p *pkg) ConstructProvider(ctx *pulumi.Context, name, typ, urn string) (pulumi.ProviderResource, error) { 22 | if typ != "pulumi:providers:crds" { 23 | return nil, fmt.Errorf("unknown provider type: %s", typ) 24 | } 25 | 26 | r := &Provider{} 27 | err := ctx.RegisterResource(typ, name, nil, r, pulumi.URN_(urn)) 28 | return r, err 29 | } 30 | 31 | func init() { 32 | version, _ := PkgVersion() 33 | pulumi.RegisterResourcePackage( 34 | "crds", 35 | &pkg{version}, 36 | ) 37 | } 38 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/provisioners/pulumi/fluxcd/kubernetes/provider.go: -------------------------------------------------------------------------------- 1 | // Code generated by crd2pulumi DO NOT EDIT. 2 | // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | package kubernetes 5 | 6 | import ( 7 | "context" 8 | "reflect" 9 | 10 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 11 | ) 12 | 13 | type Provider struct { 14 | pulumi.ProviderResourceState 15 | } 16 | 17 | // NewProvider registers a new resource with the given unique name, arguments, and options. 18 | func NewProvider(ctx *pulumi.Context, 19 | name string, args *ProviderArgs, opts ...pulumi.ResourceOption) (*Provider, error) { 20 | if args == nil { 21 | args = &ProviderArgs{} 22 | } 23 | 24 | var resource Provider 25 | err := ctx.RegisterResource("pulumi:providers:crds", name, args, &resource, opts...) 26 | if err != nil { 27 | return nil, err 28 | } 29 | return &resource, nil 30 | } 31 | 32 | type providerArgs struct { 33 | } 34 | 35 | // The set of arguments for constructing a Provider resource. 36 | type ProviderArgs struct { 37 | } 38 | 39 | func (ProviderArgs) ElementType() reflect.Type { 40 | return reflect.TypeOf((*providerArgs)(nil)).Elem() 41 | } 42 | 43 | type ProviderInput interface { 44 | pulumi.Input 45 | 46 | ToProviderOutput() ProviderOutput 47 | ToProviderOutputWithContext(ctx context.Context) ProviderOutput 48 | } 49 | 50 | func (*Provider) ElementType() reflect.Type { 51 | return reflect.TypeOf((**Provider)(nil)).Elem() 52 | } 53 | 54 | func (i *Provider) ToProviderOutput() ProviderOutput { 55 | return i.ToProviderOutputWithContext(context.Background()) 56 | } 57 | 58 | func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutput { 59 | return pulumi.ToOutputWithContext(ctx, i).(ProviderOutput) 60 | } 61 | 62 | type ProviderOutput struct{ *pulumi.OutputState } 63 | 64 | func (ProviderOutput) ElementType() reflect.Type { 65 | return reflect.TypeOf((**Provider)(nil)).Elem() 66 | } 67 | 68 | func (o ProviderOutput) ToProviderOutput() ProviderOutput { 69 | return o 70 | } 71 | 72 | func (o ProviderOutput) ToProviderOutputWithContext(ctx context.Context) ProviderOutput { 73 | return o 74 | } 75 | 76 | func init() { 77 | pulumi.RegisterInputType(reflect.TypeOf((*ProviderInput)(nil)).Elem(), &Provider{}) 78 | pulumi.RegisterOutputType(ProviderOutput{}) 79 | } 80 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/provisioners/pulumi/fluxcd/kubernetes/pulumi-plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "resource": true, 3 | "name": "crds" 4 | } 5 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/provisioners/pulumi/fluxcd/kubernetes/pulumiUtilities.go: -------------------------------------------------------------------------------- 1 | // Code generated by crd2pulumi DO NOT EDIT. 2 | // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | package kubernetes 5 | 6 | import ( 7 | "fmt" 8 | "os" 9 | "reflect" 10 | "regexp" 11 | "strconv" 12 | "strings" 13 | 14 | "github.com/blang/semver" 15 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 16 | ) 17 | 18 | type envParser func(v string) interface{} 19 | 20 | func parseEnvBool(v string) interface{} { 21 | b, err := strconv.ParseBool(v) 22 | if err != nil { 23 | return nil 24 | } 25 | return b 26 | } 27 | 28 | func parseEnvInt(v string) interface{} { 29 | i, err := strconv.ParseInt(v, 0, 0) 30 | if err != nil { 31 | return nil 32 | } 33 | return int(i) 34 | } 35 | 36 | func parseEnvFloat(v string) interface{} { 37 | f, err := strconv.ParseFloat(v, 64) 38 | if err != nil { 39 | return nil 40 | } 41 | return f 42 | } 43 | 44 | func parseEnvStringArray(v string) interface{} { 45 | var result pulumi.StringArray 46 | for _, item := range strings.Split(v, ";") { 47 | result = append(result, pulumi.String(item)) 48 | } 49 | return result 50 | } 51 | 52 | func getEnvOrDefault(def interface{}, parser envParser, vars ...string) interface{} { 53 | for _, v := range vars { 54 | if value := os.Getenv(v); value != "" { 55 | if parser != nil { 56 | return parser(value) 57 | } 58 | return value 59 | } 60 | } 61 | return def 62 | } 63 | 64 | // PkgVersion uses reflection to determine the version of the current package. 65 | // If a version cannot be determined, v1 will be assumed. The second return 66 | // value is always nil. 67 | func PkgVersion() (semver.Version, error) { 68 | type sentinal struct{} 69 | pkgPath := reflect.TypeOf(sentinal{}).PkgPath() 70 | re := regexp.MustCompile("^.*/pulumi-crds/sdk(/v\\d+)?") 71 | if match := re.FindStringSubmatch(pkgPath); match != nil { 72 | vStr := match[1] 73 | if len(vStr) == 0 { // If the version capture group was empty, default to v1. 74 | return semver.Version{Major: 1}, nil 75 | } 76 | return semver.MustParse(fmt.Sprintf("%s.0.0", vStr[2:])), nil 77 | } 78 | return semver.Version{Major: 1}, nil 79 | } 80 | 81 | // isZero is a null safe check for if a value is it's types zero value. 82 | func isZero(v interface{}) bool { 83 | if v == nil { 84 | return true 85 | } 86 | return reflect.ValueOf(v).IsZero() 87 | } 88 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/provisioners/pulumi/local_script.go: -------------------------------------------------------------------------------- 1 | package pulumi 2 | 3 | import ( 4 | "github.com/pulumi/pulumi-command/sdk/go/command/local" 5 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 6 | "totalsoft.ro/platform-controllers/internal/controllers/provisioning" 7 | "totalsoft.ro/platform-controllers/internal/template" 8 | 9 | provisioningv1 "totalsoft.ro/platform-controllers/pkg/apis/provisioning/v1alpha1" 10 | ) 11 | 12 | func deployLocalScript(target provisioning.ProvisioningTarget, 13 | localScript *provisioningv1.LocalScript, 14 | dependencies []pulumi.Resource, 15 | ctx *pulumi.Context) (*local.Command, error) { 16 | 17 | valueExporter := handleValueExport(target) 18 | gvk := provisioningv1.SchemeGroupVersion.WithKind("LocalScript") 19 | 20 | tc := provisioning.GetTemplateContext(target) 21 | 22 | for key, value := range localScript.Spec.Environment { 23 | parsedValue, err := template.ParseTemplate(value, tc) 24 | if err != nil { 25 | return nil, err 26 | } 27 | localScript.Spec.Environment[key] = parsedValue 28 | } 29 | 30 | args := &local.CommandArgs{ 31 | Create: pulumi.String(localScript.Spec.CreateScriptContent), 32 | Delete: pulumi.String(localScript.Spec.DeleteScriptContent), 33 | Environment: pulumi.ToStringMap(localScript.Spec.Environment), 34 | Dir: pulumi.String(localScript.Spec.WorkingDir), 35 | Triggers: pulumi.ToArray([]any{localScript.Spec.ForceUpdateTag}), // caution: performs delete-replace and triggers the Delete script 36 | } 37 | 38 | switch localScript.Spec.Shell { 39 | case provisioningv1.LocalScriptShellPwsh: 40 | args.Interpreter = pulumi.ToStringArray([]string{"pwsh", "-c"}) 41 | case provisioningv1.LocalScriptShellBash: 42 | args.Interpreter = pulumi.ToStringArray([]string{"bash", "-c"}) 43 | } 44 | 45 | script, err := local.NewCommand(ctx, localScript.Name, args, 46 | pulumi.DependsOn(dependencies)) 47 | if err != nil { 48 | return nil, err 49 | } 50 | 51 | for _, exp := range localScript.Spec.Exports { 52 | err = valueExporter(newExportContext(ctx, exp.Domain, localScript.Name, localScript.ObjectMeta, gvk), 53 | map[string]exportTemplateWithValue{"scriptOutput": {exp.ScriptOutput, script.Stdout}}) 54 | if err != nil { 55 | return nil, err 56 | } 57 | } 58 | return script, nil 59 | } 60 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/provisioners/pulumi/local_script_test.go: -------------------------------------------------------------------------------- 1 | package pulumi 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 7 | "github.com/stretchr/testify/assert" 8 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 9 | provisioningv1 "totalsoft.ro/platform-controllers/pkg/apis/provisioning/v1alpha1" 10 | ) 11 | 12 | func TestDeployLocalScript(t *testing.T) { 13 | t.Run("maximal entra user spec", func(t *testing.T) { 14 | platform := "dev" 15 | tenant := newTenant("tenant1", platform) 16 | script := &provisioningv1.LocalScript{ 17 | ObjectMeta: metav1.ObjectMeta{ 18 | Name: "my-pwsh-script", 19 | }, 20 | Spec: provisioningv1.LocalScriptSpec{ 21 | CreateScriptContent: "Write-Host 'Hello, World!'", 22 | DeleteScriptContent: "Write-Host 'Goodbye, World!'", 23 | Shell: provisioningv1.LocalScriptShellPwsh, 24 | Environment: map[string]string{"key": "value"}, 25 | ProvisioningMeta: provisioningv1.ProvisioningMeta{ 26 | DomainRef: "example-domain", 27 | }, 28 | }, 29 | } 30 | 31 | err := pulumi.RunErr(func(ctx *pulumi.Context) error { 32 | script, err := deployLocalScript(tenant, script, []pulumi.Resource{}, ctx) 33 | assert.NoError(t, err) 34 | assert.NotNil(t, script) 35 | return nil 36 | 37 | }, pulumi.WithMocks("project", "stack", mocks(0))) 38 | assert.NoError(t, err) 39 | }) 40 | } 41 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/provisioners/pulumi/minio_bucket_test.go: -------------------------------------------------------------------------------- 1 | package pulumi 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 7 | "github.com/stretchr/testify/assert" 8 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 9 | provisioningv1 "totalsoft.ro/platform-controllers/pkg/apis/provisioning/v1alpha1" 10 | ) 11 | 12 | func TestDeployMinioBucket(t *testing.T) { 13 | t.Run("minio bucket test", func(t *testing.T) { 14 | platform := "dev" 15 | tenant := newTenant("tenant1", platform) 16 | minioBucket := &provisioningv1.MinioBucket{ 17 | ObjectMeta: metav1.ObjectMeta{ 18 | Name: "my-buc", 19 | }, 20 | Spec: provisioningv1.MinioBucketSpec{ 21 | BucketName: "buc1", 22 | ProvisioningMeta: provisioningv1.ProvisioningMeta{ 23 | DomainRef: "example-domain", 24 | }, 25 | }, 26 | } 27 | 28 | err := pulumi.RunErr(func(ctx *pulumi.Context) error { 29 | user, err := deployMinioBucket(tenant, minioBucket, []pulumi.Resource{}, ctx) 30 | assert.NoError(t, err) 31 | assert.NotNil(t, user) 32 | return nil 33 | 34 | }, pulumi.WithMocks("project", "stack", mocks(0))) 35 | assert.NoError(t, err) 36 | }) 37 | } 38 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/provisioners/pulumi/mssql_db_test.go: -------------------------------------------------------------------------------- 1 | package pulumi 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 7 | "github.com/stretchr/testify/assert" 8 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 9 | provisioningv1 "totalsoft.ro/platform-controllers/pkg/apis/provisioning/v1alpha1" 10 | ) 11 | 12 | func TestDeployMsSqlDatabase(t *testing.T) { 13 | t.Run("maximal msSqlDatabase spec", func(t *testing.T) { 14 | platform := "dev" 15 | tenant := newTenant("tenant1", platform) 16 | mssqlDb := &provisioningv1.MsSqlDatabase{ 17 | ObjectMeta: metav1.ObjectMeta{ 18 | Name: "my-db", 19 | }, 20 | Spec: provisioningv1.MsSqlDatabaseSpec{ 21 | DbName: "my-db", 22 | SqlServer: provisioningv1.MsSqlServerSpec{ 23 | HostName: "localhost", 24 | Port: 1433, 25 | SqlAuth: provisioningv1.MsSqlServerAuth{ 26 | Username: "admin", 27 | Password: "password", 28 | }, 29 | }, 30 | ProvisioningMeta: provisioningv1.ProvisioningMeta{ 31 | DomainRef: "example-domain", 32 | }, 33 | }, 34 | } 35 | 36 | err := pulumi.RunErr(func(ctx *pulumi.Context) error { 37 | user, err := deployMsSqlDb(tenant, mssqlDb, []pulumi.Resource{}, ctx) 38 | assert.NoError(t, err) 39 | assert.NotNil(t, user) 40 | return nil 41 | 42 | }, pulumi.WithMocks("project", "stack", mocks(0))) 43 | assert.NoError(t, err) 44 | }) 45 | } 46 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/provisioners/types.go: -------------------------------------------------------------------------------- 1 | package provisioners 2 | -------------------------------------------------------------------------------- /internal/controllers/provisioning/provisioning_types.go: -------------------------------------------------------------------------------- 1 | package provisioning 2 | 3 | type CreateInfrastructureFunc func( 4 | target ProvisioningTarget, 5 | domain string, 6 | infra *InfrastructureManifests) ProvisioningResult 7 | 8 | type ProvisioningResult struct { 9 | Error error 10 | HasChanges bool 11 | } 12 | -------------------------------------------------------------------------------- /internal/controllers/utils.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | import ( 4 | "strings" 5 | 6 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 7 | ) 8 | 9 | func PlatformNamespaceFilter(namespace, platform string) bool { 10 | return strings.HasPrefix(namespace, platform) 11 | } 12 | 13 | func GetPlatformNsAndDomain(obj metav1.Object) (platform, namespace, domain string, ok bool) { 14 | 15 | domain, domainLabelExists := obj.GetLabels()[DomainLabelName] 16 | if !domainLabelExists || len(domain) == 0 { 17 | return "", obj.GetNamespace(), domain, false 18 | } 19 | 20 | platform, platformLabelExists := obj.GetLabels()[PlatformLabelName] 21 | if !platformLabelExists || len(platform) == 0 { 22 | return platform, obj.GetNamespace(), domain, false 23 | } 24 | 25 | domain, namespace, _ = strings.Cut(domain, ".") 26 | if namespace == "" { 27 | return platform, obj.GetNamespace(), domain, true 28 | } else { 29 | return platform, namespace, domain, true 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /internal/messaging/messaging_abstractions.go: -------------------------------------------------------------------------------- 1 | package messaging 2 | 3 | import ( 4 | "context" 5 | "os" 6 | "strconv" 7 | 8 | rusi "totalsoft.ro/platform-controllers/internal/messaging/rusi" 9 | ) 10 | 11 | type MessagingPublisher func(ctx context.Context, topic string, data interface{}, platform string) error 12 | 13 | var ( 14 | EnvRusiEnabled = "RUSI_ENABLED" 15 | ) 16 | 17 | func NilMessagingPublisher(ctx context.Context, topic string, data interface{}, platform string) error { 18 | return nil 19 | } 20 | 21 | func DefaultMessagingPublisher() MessagingPublisher { 22 | if enabled, err := strconv.ParseBool(os.Getenv(EnvRusiEnabled)); err == nil && enabled { 23 | return rusi.Publish 24 | } 25 | return NilMessagingPublisher 26 | } 27 | -------------------------------------------------------------------------------- /internal/messaging/mock/messaging_mock.go: -------------------------------------------------------------------------------- 1 | package mock 2 | 3 | import ( 4 | "context" 5 | 6 | messaging "totalsoft.ro/platform-controllers/internal/messaging" 7 | ) 8 | 9 | func MessagingPublisherMock(msgChan chan RcvMsg) messaging.MessagingPublisher { 10 | return func(ctx context.Context, topic string, data interface{}, platform string) error { 11 | go func() { 12 | msgChan <- RcvMsg{topic, data} 13 | }() 14 | return nil 15 | } 16 | 17 | } 18 | 19 | type RcvMsg struct { 20 | Topic string 21 | Data interface{} 22 | } 23 | -------------------------------------------------------------------------------- /internal/messaging/rusi/rusi.go: -------------------------------------------------------------------------------- 1 | package rusi 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "os" 7 | 8 | "github.com/google/uuid" 9 | jsoniter "github.com/json-iterator/go" 10 | "google.golang.org/grpc" 11 | "google.golang.org/grpc/credentials/insecure" 12 | v1 "totalsoft.ro/platform-controllers/internal/messaging/rusi/v1" 13 | ) 14 | 15 | var ( 16 | conn *grpc.ClientConn 17 | ) 18 | 19 | func newRusiClient(ctx context.Context) (cl v1.RusiClient, err error) { 20 | port := os.Getenv("RUSI_GRPC_PORT") 21 | address := fmt.Sprintf("localhost:%s", port) 22 | retryPolicy := `{ 23 | "methodConfig": [{ 24 | "name": [{"service": "rusi.proto.runtime.v1.Rusi"}], 25 | "waitForReady": true, 26 | "retryPolicy": { 27 | "MaxAttempts": 4, 28 | "InitialBackoff": ".01s", 29 | "MaxBackoff": ".01s", 30 | "BackoffMultiplier": 1.0, 31 | "RetryableStatusCodes": [ "UNAVAILABLE" ] 32 | } 33 | }]}` 34 | 35 | if conn == nil { 36 | ctx := context.TODO() 37 | conn, err = grpc.DialContext(ctx, address, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithDefaultServiceConfig(retryPolicy)) 38 | if err != nil { 39 | return nil, err 40 | } 41 | } 42 | return v1.NewRusiClient(conn), nil 43 | } 44 | 45 | func marshal(data interface{}) ([]byte, error) { 46 | return jsoniter.Marshal(data) 47 | } 48 | 49 | func Publish(ctx context.Context, topic string, data interface{}, platform string) error { 50 | var ( 51 | correlationId string = "nbb-correlationId" 52 | source string = "nbb-source" 53 | rusiPubSubName string = fmt.Sprintf("%s-pubsub", platform) 54 | ) 55 | rc, err := newRusiClient(ctx) 56 | if err != nil { 57 | return err 58 | } 59 | 60 | jsonData, err := marshal(data) 61 | if err != nil { 62 | return err 63 | } 64 | 65 | metadata := map[string]string{correlationId: uuid.New().String(), source: "platform-controllers"} 66 | 67 | var pr = v1.PublishRequest{ 68 | PubsubName: rusiPubSubName, 69 | Topic: topic, 70 | Data: jsonData, 71 | Metadata: metadata, 72 | } 73 | _, err = rc.Publish(ctx, &pr) 74 | return err 75 | } 76 | -------------------------------------------------------------------------------- /internal/messaging/rusi/v1/rusi.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package rusi.proto.runtime.v1; 4 | 5 | // import "google/protobuf/any.proto"; 6 | import "google/protobuf/empty.proto"; 7 | import "google/protobuf/duration.proto"; 8 | import "google/protobuf/wrappers.proto"; 9 | 10 | option go_package = "pkg/proto/runtime/v1"; 11 | option csharp_namespace = "Proto.V1"; 12 | 13 | service Rusi { 14 | 15 | // Publishes events to the specific topic. 16 | rpc Publish(PublishRequest) returns (google.protobuf.Empty); 17 | 18 | // Subscribe pushes events on the stream 19 | rpc Subscribe(stream SubscribeRequest) returns (stream ReceivedMessage); 20 | } 21 | 22 | // PublishRequest is the message to publish data to pubsub topic 23 | message PublishRequest { 24 | // The name of the pubsub component 25 | string pubsub_name = 1; 26 | 27 | // The pubsub topic 28 | string topic = 2; 29 | 30 | // The data which will be published to topic. 31 | bytes data = 3; 32 | 33 | // This attribute contains a value describing the type of event related to the originating occurrence. 34 | string type = 4; 35 | 36 | // The content type for the data (optional). 37 | string data_content_type = 5; 38 | 39 | // The metadata passing to pub components 40 | // 41 | // metadata property: 42 | // - key : the key of the message. 43 | map metadata = 6; 44 | } 45 | 46 | message SubscribeRequest { 47 | oneof RequestType { 48 | SubscriptionRequest subscription_request = 1; 49 | AckRequest ack_request = 2; 50 | } 51 | } 52 | 53 | message AckRequest { 54 | string message_id = 1; 55 | string error = 2; 56 | } 57 | 58 | message SubscriptionRequest { 59 | // The name of the pubsub component 60 | string pubsub_name = 1; 61 | 62 | // The pubsub topic 63 | string topic = 2; 64 | 65 | SubscriptionOptions options = 3; 66 | } 67 | 68 | message SubscriptionOptions { 69 | google.protobuf.BoolValue durable = 1; 70 | google.protobuf.BoolValue qGroup = 2; 71 | google.protobuf.Int32Value maxConcurrentMessages = 3; 72 | google.protobuf.BoolValue deliverNewMessagesOnly = 4; 73 | google.protobuf.Duration ackWaitTime = 5; 74 | } 75 | 76 | 77 | message ReceivedMessage { 78 | string id = 1; 79 | // The data which will be published to topic. 80 | bytes data = 2; 81 | map metadata = 3; 82 | } 83 | -------------------------------------------------------------------------------- /internal/template/parser.go: -------------------------------------------------------------------------------- 1 | package template 2 | 3 | import ( 4 | "bytes" 5 | "text/template" 6 | ) 7 | 8 | func ParseTemplate(text string, data interface{}) (string, error) { 9 | tmpl, err := template.New("test").Parse(text) 10 | if err != nil { 11 | return "", err 12 | } 13 | 14 | var tpl bytes.Buffer 15 | if err = tmpl.Execute(&tpl, data); err != nil { 16 | return "", err 17 | } 18 | 19 | return tpl.String(), nil 20 | } 21 | -------------------------------------------------------------------------------- /internal/tuple/pair.go: -------------------------------------------------------------------------------- 1 | package tuple 2 | 3 | type T2[V1, V2 any] struct { 4 | V1 V1 5 | V2 V2 6 | } 7 | 8 | func (t2 T2[V1, V2]) Values() (V1, V2) { 9 | return t2.V1, t2.V2 10 | } 11 | 12 | func New2[V1, V2 any](v1 V1, v2 V2) T2[V1, V2] { 13 | return T2[V1, V2]{v1, v2} 14 | } 15 | -------------------------------------------------------------------------------- /internal/version/version.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | // Values for these are injected by the build. 4 | var ( 5 | version = "edge" 6 | 7 | gitcommit, gitversion string 8 | ) 9 | 10 | // Version returns the Program version. This is either a semantic version 11 | // number or else, in the case of unreleased code, the string "edge". 12 | func Version() string { 13 | return version 14 | } 15 | 16 | // Commit returns the git commit SHA for the code that Program was built from. 17 | func Commit() string { 18 | return gitcommit 19 | } 20 | 21 | // GitVersion returns the git version for the code that Program was built from. 22 | func GitVersion() string { 23 | return gitversion 24 | } 25 | -------------------------------------------------------------------------------- /pkg/apis/configuration/register.go: -------------------------------------------------------------------------------- 1 | package configuration 2 | 3 | const ( 4 | GroupName = "configuration.totalsoft.ro" 5 | ) 6 | -------------------------------------------------------------------------------- /pkg/apis/configuration/v1alpha1/configurationDomainTypes.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | ) 6 | 7 | // +genclient 8 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 9 | // +kubebuilder:subresource:status 10 | // +kubebuilder:printcolumn:name="Age",type=string,JSONPath=`.metadata.creationTimestamp` 11 | // +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status` 12 | // +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].message` 13 | // +kubebuilder:printcolumn:name="Platform",type=string,JSONPath=`.spec.platformRef` 14 | type ConfigurationDomain struct { 15 | metav1.TypeMeta `json:",inline"` 16 | // +optional 17 | metav1.ObjectMeta `json:"metadata,omitempty"` 18 | 19 | Spec ConfigurationDomainSpec `json:"spec"` 20 | Status ConfigurationDomainStatus `json:"status,omitempty"` 21 | } 22 | 23 | type ConfigurationDomainSpec struct { 24 | PlatformRef string `json:"platformRef"` 25 | // +optional 26 | AggregateConfigMaps bool `json:"aggregateConfigMaps,omitempty"` 27 | // +optional 28 | AggregateSecrets bool `json:"aggregateSecrets,omitempty"` 29 | } 30 | 31 | type ConfigurationDomainStatus struct { 32 | // Conditions holds the conditions for the ConfigurationDomain. 33 | // +optional 34 | Conditions []metav1.Condition `json:"conditions,omitempty"` 35 | } 36 | 37 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 38 | type ConfigurationDomainList struct { 39 | metav1.TypeMeta `json:",inline"` 40 | metav1.ListMeta `json:"metadata"` 41 | 42 | Items []ConfigurationDomain `json:"items"` 43 | } 44 | -------------------------------------------------------------------------------- /pkg/apis/configuration/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | // +k8s:deepcopy-gen=package 2 | // +k8s:defaulter-gen=TypeMeta 3 | // +groupName=configuration.totalsoft.ro 4 | 5 | package v1alpha1 6 | -------------------------------------------------------------------------------- /pkg/apis/configuration/v1alpha1/register.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | "k8s.io/apimachinery/pkg/runtime" 6 | "k8s.io/apimachinery/pkg/runtime/schema" 7 | "totalsoft.ro/platform-controllers/pkg/apis/configuration" 8 | ) 9 | 10 | // SchemeGroupVersion is group version used to register these objects. 11 | var SchemeGroupVersion = schema.GroupVersion{Group: configuration.GroupName, Version: "v1alpha1"} 12 | 13 | // Kind takes an unqualified kind and returns back a Group qualified GroupKind. 14 | func Kind(kind string) schema.GroupKind { 15 | return SchemeGroupVersion.WithKind(kind).GroupKind() 16 | } 17 | 18 | // Resource takes an unqualified resource and returns a Group qualified GroupResource. 19 | func Resource(resource string) schema.GroupResource { 20 | return SchemeGroupVersion.WithResource(resource).GroupResource() 21 | } 22 | 23 | var ( 24 | SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) 25 | AddToScheme = SchemeBuilder.AddToScheme 26 | ) 27 | 28 | // Adds the list of known types to Scheme. 29 | func addKnownTypes(scheme *runtime.Scheme) error { 30 | scheme.AddKnownTypes( 31 | SchemeGroupVersion, 32 | &ConfigurationDomain{}, 33 | &ConfigurationDomainList{}, 34 | &metav1.Status{}, 35 | ) 36 | metav1.AddToGroupVersion(scheme, SchemeGroupVersion) 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /pkg/apis/configuration/v1alpha1/types.go: -------------------------------------------------------------------------------- 1 | // +genclient 2 | 3 | package v1alpha1 4 | -------------------------------------------------------------------------------- /pkg/apis/configuration/v1alpha1/zz_generated.defaults.go: -------------------------------------------------------------------------------- 1 | //go:build !ignore_autogenerated 2 | // +build !ignore_autogenerated 3 | 4 | /* 5 | Copyright The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | // Code generated by defaulter-gen. DO NOT EDIT. 21 | 22 | package v1alpha1 23 | 24 | import ( 25 | runtime "k8s.io/apimachinery/pkg/runtime" 26 | ) 27 | 28 | // RegisterDefaults adds defaulters functions to the given scheme. 29 | // Public to allow building arbitrary schemes. 30 | // All generated defaulters are covering - they call all nested defaulters. 31 | func RegisterDefaults(scheme *runtime.Scheme) error { 32 | return nil 33 | } 34 | -------------------------------------------------------------------------------- /pkg/apis/platform/register.go: -------------------------------------------------------------------------------- 1 | package platform 2 | 3 | const ( 4 | GroupName = "platform.totalsoft.ro" 5 | ) 6 | -------------------------------------------------------------------------------- /pkg/apis/platform/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | // +k8s:deepcopy-gen=package 2 | // +k8s:defaulter-gen=TypeMeta 3 | // +groupName=platform.totalsoft.ro 4 | 5 | package v1alpha1 6 | -------------------------------------------------------------------------------- /pkg/apis/platform/v1alpha1/domainTypes.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | ) 6 | 7 | // +genclient 8 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 9 | 10 | type Domain struct { 11 | metav1.TypeMeta `json:",inline"` 12 | // +optional 13 | metav1.ObjectMeta `json:"metadata,omitempty"` 14 | // +required 15 | Spec DomainSpec `json:"spec"` 16 | } 17 | 18 | type DomainSpec struct { 19 | // PlatformRef is the target platform. 20 | // +required 21 | PlatformRef string `json:"platformRef"` 22 | 23 | // +optional 24 | ExportActiveDomains bool `json:"exportActiveDomains"` 25 | } 26 | 27 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 28 | 29 | // DomainList is a list of Domains. 30 | type DomainList struct { 31 | metav1.TypeMeta `json:",inline"` 32 | metav1.ListMeta `json:"metadata"` 33 | 34 | Items []Domain `json:"items"` 35 | } 36 | -------------------------------------------------------------------------------- /pkg/apis/platform/v1alpha1/platformTypes.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | ) 6 | 7 | // +genclient 8 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 9 | // +genclient:nonNamespaced 10 | // +kubebuilder:subresource:status 11 | // +kubebuilder:resource:scope=Cluster 12 | // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" 13 | // +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status` 14 | // +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].message` 15 | 16 | type Platform struct { 17 | metav1.TypeMeta `json:",inline"` 18 | // +optional 19 | metav1.ObjectMeta `json:"metadata,omitempty"` 20 | 21 | Spec PlatformSpec `json:"spec,omitempty"` 22 | Status PlatformStatus `json:"status,omitempty"` 23 | } 24 | 25 | type PlatformSpec struct { 26 | TargetNamespace string `json:"targetNamespace"` 27 | } 28 | 29 | type PlatformStatus struct { 30 | // Conditions holds the conditions for the HelmRepository. 31 | // +optional 32 | Conditions []metav1.Condition `json:"conditions,omitempty"` 33 | } 34 | 35 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 36 | 37 | // PlatformList is a list of Platforms. 38 | type PlatformList struct { 39 | metav1.TypeMeta `json:",inline"` 40 | metav1.ListMeta `json:"metadata"` 41 | 42 | Items []Platform `json:"items"` 43 | } 44 | 45 | func (platform *Platform) GetDescription() string { 46 | return platform.GetName() 47 | } 48 | 49 | func (platform *Platform) GetPlatformName() string { 50 | return platform.GetName() 51 | } 52 | -------------------------------------------------------------------------------- /pkg/apis/platform/v1alpha1/register.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | "k8s.io/apimachinery/pkg/runtime" 6 | "k8s.io/apimachinery/pkg/runtime/schema" 7 | "totalsoft.ro/platform-controllers/pkg/apis/platform" 8 | ) 9 | 10 | // SchemeGroupVersion is group version used to register these objects. 11 | var SchemeGroupVersion = schema.GroupVersion{Group: platform.GroupName, Version: "v1alpha1"} 12 | 13 | // Kind takes an unqualified kind and returns back a Group qualified GroupKind. 14 | func Kind(kind string) schema.GroupKind { 15 | return SchemeGroupVersion.WithKind(kind).GroupKind() 16 | } 17 | 18 | // Resource takes an unqualified resource and returns a Group qualified GroupResource. 19 | func Resource(resource string) schema.GroupResource { 20 | return SchemeGroupVersion.WithResource(resource).GroupResource() 21 | } 22 | 23 | var ( 24 | SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) 25 | AddToScheme = SchemeBuilder.AddToScheme 26 | ) 27 | 28 | // Adds the list of known types to Scheme. 29 | func addKnownTypes(scheme *runtime.Scheme) error { 30 | scheme.AddKnownTypes( 31 | SchemeGroupVersion, 32 | &Platform{}, 33 | &PlatformList{}, 34 | &Service{}, 35 | &ServiceList{}, 36 | &Tenant{}, 37 | &TenantList{}, 38 | &Domain{}, 39 | &DomainList{}, 40 | &metav1.Status{}, 41 | ) 42 | metav1.AddToGroupVersion(scheme, SchemeGroupVersion) 43 | return nil 44 | } 45 | -------------------------------------------------------------------------------- /pkg/apis/platform/v1alpha1/serviceTypes.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | ) 6 | 7 | // +genclient 8 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 9 | 10 | // Service describes a business service. 11 | type Service struct { 12 | metav1.TypeMeta `json:",inline"` 13 | // +optional 14 | metav1.ObjectMeta `json:"metadata,omitempty"` 15 | // +required 16 | Spec ServiceSpec `json:"spec"` 17 | } 18 | 19 | type ServiceSpec struct { 20 | // PlatformRef is the target platform. 21 | // +required 22 | PlatformRef string `json:"platformRef"` 23 | // RequiredDomainRefs are the required business domains associated to this service. 24 | // +required 25 | RequiredDomainRefs []string `json:"requiredDomainRefs"` 26 | // OptionalDomainRefs are the optional business domains associated to this service. 27 | // +optional 28 | OptionalDomainRefs []string `json:"optionalDomainRefs,omitempty"` 29 | } 30 | 31 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 32 | 33 | // ServiceList is a list of Services. 34 | type ServiceList struct { 35 | metav1.TypeMeta `json:",inline"` 36 | metav1.ListMeta `json:"metadata"` 37 | 38 | Items []Service `json:"items"` 39 | } 40 | -------------------------------------------------------------------------------- /pkg/apis/platform/v1alpha1/types.go: -------------------------------------------------------------------------------- 1 | // +genclient 2 | 3 | package v1alpha1 4 | -------------------------------------------------------------------------------- /pkg/apis/platform/v1alpha1/zz_generated.defaults.go: -------------------------------------------------------------------------------- 1 | //go:build !ignore_autogenerated 2 | // +build !ignore_autogenerated 3 | 4 | /* 5 | Copyright The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | // Code generated by defaulter-gen. DO NOT EDIT. 21 | 22 | package v1alpha1 23 | 24 | import ( 25 | runtime "k8s.io/apimachinery/pkg/runtime" 26 | ) 27 | 28 | // RegisterDefaults adds defaulters functions to the given scheme. 29 | // Public to allow building arbitrary schemes. 30 | // All generated defaulters are covering - they call all nested defaulters. 31 | func RegisterDefaults(scheme *runtime.Scheme) error { 32 | return nil 33 | } 34 | -------------------------------------------------------------------------------- /pkg/apis/provisioning/register.go: -------------------------------------------------------------------------------- 1 | package provisioning 2 | 3 | const ( 4 | GroupName = "provisioning.totalsoft.ro" 5 | ) 6 | -------------------------------------------------------------------------------- /pkg/apis/provisioning/v1alpha1/azureDatabaseTypes.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" 5 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 6 | ) 7 | 8 | // +genclient 9 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 10 | // +kubebuilder:printcolumn:name="Platform",type=string,JSONPath=`.spec.platformRef` 11 | // +kubebuilder:printcolumn:name="Domains",type=string,JSONPath=`.spec.domains` 12 | 13 | type AzureDatabase struct { 14 | metav1.TypeMeta `json:",inline"` 15 | // +optional 16 | metav1.ObjectMeta `json:"metadata,omitempty"` 17 | 18 | Spec AzureDatabaseSpec `json:"spec"` 19 | } 20 | 21 | type AzureDatabaseSpec struct { 22 | // Database name prefix. Will have platform and tenant suffix. 23 | DbName string `json:"dbName"` 24 | // Azure Sql Server spec. New database will be created on this server 25 | SqlServer SqlServerSpec `json:"sqlServer"` 26 | // +optional 27 | Sku string `json:"sku,omitempty"` 28 | // Source database from which a new database is copied 29 | // eg: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb 30 | // +optional 31 | SourceDatabaseId string `json:"sourceDatabaseId,omitempty"` 32 | // Existing database to be used instead of creating a new one 33 | // eg: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb 34 | // +optional 35 | ImportDatabaseId string `json:"importDatabaseId,omitempty"` 36 | // +optional 37 | Exports []AzureDatabaseExportsSpec `json:"exports,omitempty"` 38 | ProvisioningMeta `json:",inline"` 39 | } 40 | 41 | type TenanantOverridesMeta struct { 42 | TenantOverrides map[string]*apiextensionsv1.JSON `json:"tenantOverrides,omitempty"` 43 | } 44 | 45 | type SqlServerSpec struct { 46 | // Azure Sql Server resource group. 47 | ResourceGroupName string `json:"resourceGroupName"` 48 | // Azure Sql Server name. 49 | ServerName string `json:"serverName"` 50 | // +optional 51 | ElasticPoolName string `json:"elasticPoolName,omitempty"` 52 | } 53 | 54 | type AzureDatabaseExportsSpec struct { 55 | // The domain or bounded-context in which this database will be used. 56 | Domain string `json:"domain"` 57 | // +optional 58 | DbName ValueExport `json:"dbName,omitempty"` 59 | } 60 | 61 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 62 | 63 | type AzureDatabaseList struct { 64 | metav1.TypeMeta `json:",inline"` 65 | metav1.ListMeta `json:"metadata"` 66 | 67 | Items []AzureDatabase `json:"items"` 68 | } 69 | 70 | func (db *AzureDatabase) GetProvisioningMeta() *ProvisioningMeta { 71 | return &db.Spec.ProvisioningMeta 72 | } 73 | 74 | func (db *AzureDatabase) GetSpec() any { 75 | return &db.Spec 76 | } 77 | -------------------------------------------------------------------------------- /pkg/apis/provisioning/v1alpha1/azureManagedDatabaseTypes.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | ) 6 | 7 | // +genclient 8 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 9 | // +kubebuilder:printcolumn:name="Platform",type=string,JSONPath=`.spec.platformRef` 10 | // +kubebuilder:printcolumn:name="Domains",type=string,JSONPath=`.spec.domains` 11 | 12 | type AzureManagedDatabase struct { 13 | metav1.TypeMeta `json:",inline"` 14 | // +optional 15 | metav1.ObjectMeta `json:"metadata,omitempty"` 16 | 17 | Spec AzureManagedDatabaseSpec `json:"spec,omitempty"` 18 | } 19 | 20 | type AzureManagedDatabaseSpec struct { 21 | // Managed database name prefix. Will have platform and tenant suffix. 22 | DbName string `json:"dbName"` 23 | // Target managed instance spec. 24 | ManagedInstance AzureManagedInstanceSpec `json:"managedInstance"` 25 | // Restore from external backup. Leave empty for a new empty database. 26 | // +optional 27 | RestoreFrom AzureManagedDatabaseRestoreSpec `json:"restoreFrom,omitempty"` 28 | // Existing database to be used instead of creating a new one 29 | // eg: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb 30 | // +optional 31 | ImportDatabaseId string `json:"importDatabaseId,omitempty"` 32 | // Export provisioning values spec. 33 | // +optional 34 | Exports []AzureManagedDatabaseExportsSpec `json:"exports,omitempty"` 35 | ProvisioningMeta `json:",inline"` 36 | } 37 | type AzureManagedInstanceSpec struct { 38 | // Managed instance name. 39 | Name string `json:"name"` 40 | // Managed instance resource group. 41 | ResourceGroup string `json:"resourceGroup"` 42 | } 43 | 44 | type AzureManagedDatabaseRestoreSpec struct { 45 | //The backup file to restore from. 46 | BackupFileName string `json:"backupFileName"` 47 | //Azure storage container spec. 48 | StorageContainer AzureStorageContainerSpec `json:"storageContainer"` 49 | } 50 | 51 | type AzureStorageContainerSpec struct { 52 | // The storage container shared access signature token. 53 | SasToken string `json:"sasToken"` 54 | // The storage container uri. 55 | Uri string `json:"uri"` 56 | } 57 | 58 | type AzureManagedDatabaseExportsSpec struct { 59 | // The domain or bounded-context in which this database will be used. 60 | Domain string `json:"domain"` 61 | // +optional 62 | DbName ValueExport `json:"dbName,omitempty"` 63 | } 64 | 65 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 66 | 67 | type AzureManagedDatabaseList struct { 68 | metav1.TypeMeta `json:",inline"` 69 | metav1.ListMeta `json:"metadata"` 70 | 71 | Items []AzureManagedDatabase `json:"items"` 72 | } 73 | 74 | func (db *AzureManagedDatabase) GetProvisioningMeta() *ProvisioningMeta { 75 | return &db.Spec.ProvisioningMeta 76 | } 77 | 78 | func (db *AzureManagedDatabase) GetSpec() any { 79 | return &db.Spec 80 | } 81 | -------------------------------------------------------------------------------- /pkg/apis/provisioning/v1alpha1/azurePowershelScriptTypes.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | ) 6 | 7 | // +genclient 8 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 9 | // +kubebuilder:printcolumn:name="Platform",type=string,JSONPath=`.spec.platformRef` 10 | // +kubebuilder:printcolumn:name="Domain",type=string,JSONPath=`.spec.domainRef` 11 | 12 | type AzurePowerShellScript struct { 13 | metav1.TypeMeta `json:",inline"` 14 | // +optional 15 | metav1.ObjectMeta `json:"metadata,omitempty"` 16 | 17 | Spec AzurePowerShellScriptSpec `json:"spec"` 18 | } 19 | 20 | type AzurePowerShellScriptSpec struct { 21 | 22 | // ScriptContent represents the content of an Azure PowerShell script. 23 | ScriptContent string `json:"scriptContent"` 24 | 25 | // Represents the arguments to be passed to the PowerShell script. 26 | // eg: "-name JohnDoe" 27 | // +optional 28 | ScriptArguments string `json:"scriptArguments,omitempty"` 29 | 30 | // +optional 31 | // Change value to force the script to execute even if it has not changed. 32 | ForceUpdateTag string `json:"forceUpdateTag,omitempty"` 33 | 34 | // Export provisioning values spec. 35 | // +optional 36 | Exports []AzurePowerShellScriptExportsSpec `json:"exports,omitempty"` 37 | ProvisioningMeta `json:",inline"` 38 | } 39 | 40 | type AzurePowerShellScriptExportsSpec struct { 41 | 42 | // The domain or bounded-context in which this script will be used. 43 | // +optional 44 | Domain string `json:"domain"` 45 | 46 | // Represents the outputs of the Azure PowerShell script. 47 | // +optional 48 | ScriptOutputs ValueExport `json:"scriptOutputs,omitempty"` 49 | } 50 | 51 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 52 | type AzurePowerShellScriptList struct { 53 | metav1.TypeMeta `json:",inline"` 54 | metav1.ListMeta `json:"metadata"` 55 | 56 | Items []AzurePowerShellScript `json:"items"` 57 | } 58 | 59 | func (db *AzurePowerShellScript) GetProvisioningMeta() *ProvisioningMeta { 60 | return &db.Spec.ProvisioningMeta 61 | } 62 | 63 | func (db *AzurePowerShellScript) GetSpec() any { 64 | return &db.Spec 65 | } 66 | -------------------------------------------------------------------------------- /pkg/apis/provisioning/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | // +k8s:deepcopy-gen=package 2 | // +k8s:defaulter-gen=TypeMeta 3 | // +groupName=provisioning.totalsoft.ro 4 | 5 | package v1alpha1 6 | -------------------------------------------------------------------------------- /pkg/apis/provisioning/v1alpha1/entraUserTypes.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | ) 6 | 7 | // +genclient 8 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 9 | // +kubebuilder:printcolumn:name="Display name",type=string,JSONPath=`.spec.displayName` 10 | // +kubebuilder:printcolumn:name="User principal name",type=string,JSONPath=`.spec.userPrincipalName` 11 | // +kubebuilder:printcolumn:name="Platform",type=string,JSONPath=`.spec.platformRef` 12 | // +kubebuilder:printcolumn:name="Domain",type=string,JSONPath=`.spec.domainRef` 13 | 14 | type EntraUser struct { 15 | metav1.TypeMeta `json:",inline"` 16 | // +optional 17 | metav1.ObjectMeta `json:"metadata,omitempty"` 18 | 19 | Spec EntraUserSpec `json:"spec"` 20 | } 21 | 22 | type EntraUserSpec struct { 23 | // UserPrincipalName represents the user principal name, e.g. "jdoe@domain.com" 24 | UserPrincipalName string `json:"userPrincipalName"` 25 | 26 | // InitialPassword represents the initial password for the user 27 | // +optional 28 | InitialPassword string `json:"initialPassword,omitempty"` 29 | 30 | // DisplayName represents the display name of the user, e.g. "John Doe" 31 | DisplayName string `json:"displayName"` 32 | 33 | // Export provisioning values spec. 34 | // +optional 35 | Exports []EntraUserExportsSpec `json:"exports,omitempty"` 36 | ProvisioningMeta `json:",inline"` 37 | } 38 | 39 | type EntraUserExportsSpec struct { 40 | 41 | // The domain or bounded-context in which this user will be used. 42 | // +optional 43 | Domain string `json:"domain"` 44 | 45 | // The initial password for the user 46 | InitialPassword ValueExport `json:"initialPassword,omitempty"` 47 | 48 | // The user principal name 49 | UserPrincipalName ValueExport `json:"userPrincipalName,omitempty"` 50 | } 51 | 52 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 53 | type EntraUserList struct { 54 | metav1.TypeMeta `json:",inline"` 55 | metav1.ListMeta `json:"metadata"` 56 | 57 | Items []EntraUser `json:"items"` 58 | } 59 | 60 | func (db *EntraUser) GetProvisioningMeta() *ProvisioningMeta { 61 | return &db.Spec.ProvisioningMeta 62 | } 63 | 64 | func (db *EntraUser) GetSpec() any { 65 | return &db.Spec 66 | } 67 | -------------------------------------------------------------------------------- /pkg/apis/provisioning/v1alpha1/helmReleaseTypes.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | flux "github.com/fluxcd/helm-controller/api/v2beta1" 5 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 6 | ) 7 | 8 | // +genclient 9 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 10 | // +kubebuilder:printcolumn:name="Platform",type=string,JSONPath=`.spec.platformRef` 11 | type HelmRelease struct { 12 | metav1.TypeMeta `json:",inline"` 13 | // +optional 14 | metav1.ObjectMeta `json:"metadata,omitempty"` 15 | 16 | Spec HelmReleaseSpec `json:"spec"` 17 | } 18 | 19 | type HelmReleaseSpec struct { 20 | // helm release spec 21 | Release flux.HelmReleaseSpec `json:"release"` 22 | // +optional 23 | Exports []HelmReleaseExportsSpec `json:"exports,omitempty"` 24 | ProvisioningMeta `json:",inline"` 25 | } 26 | 27 | type HelmReleaseExportsSpec struct { 28 | // The domain or bounded-context in which this database will be used. 29 | Domain string `json:"domain"` 30 | // +optional 31 | ReleaseName ValueExport `json:"releaseName,omitempty"` 32 | } 33 | 34 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 35 | type HelmReleaseList struct { 36 | metav1.TypeMeta `json:",inline"` 37 | metav1.ListMeta `json:"metadata"` 38 | 39 | Items []HelmRelease `json:"items"` 40 | } 41 | 42 | func (db *HelmRelease) GetProvisioningMeta() *ProvisioningMeta { 43 | return &db.Spec.ProvisioningMeta 44 | } 45 | 46 | func (db *HelmRelease) GetSpec() any { 47 | return &db.Spec 48 | } 49 | -------------------------------------------------------------------------------- /pkg/apis/provisioning/v1alpha1/localScriptTypes.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | ) 6 | 7 | // +genclient 8 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 9 | // +kubebuilder:printcolumn:name="Platform",type=string,JSONPath=`.spec.platformRef` 10 | // +kubebuilder:printcolumn:name="Domain",type=string,JSONPath=`.spec.domainRef` 11 | 12 | type LocalScript struct { 13 | metav1.TypeMeta `json:",inline"` 14 | // +optional 15 | metav1.ObjectMeta `json:"metadata,omitempty"` 16 | 17 | Spec LocalScriptSpec `json:"spec"` 18 | } 19 | 20 | type LocalScriptShell string 21 | 22 | const ( 23 | LocalScriptShellPwsh = LocalScriptShell("pwsh") 24 | LocalScriptShellBash = LocalScriptShell("bash") 25 | ) 26 | 27 | type LocalScriptSpec struct { 28 | 29 | // ScriptContent that runs on resource creation and update. 30 | CreateScriptContent string `json:"createScriptContent"` 31 | 32 | // ScriptContent that runs on resource deletion. 33 | DeleteScriptContent string `json:"deleteScriptContent"` 34 | 35 | // The shell to use for the script. Possibile values: pwsh, bash 36 | // +kubebuilder:validation:Enum=pwsh;bash 37 | // +kubebuilder:default:=pwsh 38 | Shell LocalScriptShell `json:"shell"` 39 | 40 | // Represents the environment variables to be passed to the script. 41 | // +optional 42 | Environment map[string]string `json:"environment,omitempty"` 43 | 44 | // +optional 45 | // Change value to force the script to execute even if it has not changed. 46 | ForceUpdateTag string `json:"forceUpdateTag,omitempty"` 47 | 48 | // Working directory for the script. 49 | // +optional 50 | WorkingDir string `json:"workingDir,omitempty"` 51 | 52 | // Export provisioning values spec. 53 | // +optional 54 | Exports []LocalScriptExportsSpec `json:"exports,omitempty"` 55 | ProvisioningMeta `json:",inline"` 56 | } 57 | 58 | type LocalScriptExportsSpec struct { 59 | 60 | // The domain or bounded-context in which this script will be used. 61 | // +optional 62 | Domain string `json:"domain"` 63 | 64 | // Represents the outputs of the Azure PowerShell script. 65 | // +optional 66 | ScriptOutput ValueExport `json:"scriptOutput,omitempty"` 67 | } 68 | 69 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 70 | type LocalScriptList struct { 71 | metav1.TypeMeta `json:",inline"` 72 | metav1.ListMeta `json:"metadata"` 73 | 74 | Items []LocalScript `json:"items"` 75 | } 76 | 77 | func (db *LocalScript) GetProvisioningMeta() *ProvisioningMeta { 78 | return &db.Spec.ProvisioningMeta 79 | } 80 | 81 | func (db *LocalScript) GetSpec() any { 82 | return &db.Spec 83 | } 84 | -------------------------------------------------------------------------------- /pkg/apis/provisioning/v1alpha1/minioBucketTypes.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | ) 6 | 7 | // +genclient 8 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 9 | // +kubebuilder:printcolumn:name="Bucket name",type=string,JSONPath=`.spec.bucketName` 10 | // +kubebuilder:printcolumn:name="Platform",type=string,JSONPath=`.spec.platformRef` 11 | // +kubebuilder:printcolumn:name="Domain",type=string,JSONPath=`.spec.domainRef` 12 | 13 | type MinioBucket struct { 14 | metav1.TypeMeta `json:",inline"` 15 | // +optional 16 | metav1.ObjectMeta `json:"metadata,omitempty"` 17 | 18 | Spec MinioBucketSpec `json:"spec"` 19 | } 20 | 21 | type MinioBucketSpec struct { 22 | // UserPrincipalName represents the user principal name, e.g. "jdoe@domain.com" 23 | BucketName string `json:"bucketName"` 24 | 25 | // Export provisioning values spec. 26 | // +optional 27 | Exports []MinioBucketExportsSpec `json:"exports,omitempty"` 28 | ProvisioningMeta `json:",inline"` 29 | } 30 | 31 | type MinioBucketExportsSpec struct { 32 | // The domain or bounded-context in which this user will be used. 33 | // +optional 34 | Domain string `json:"domain"` 35 | 36 | BucketName ValueExport `json:"bucketName,omitempty"` 37 | AccessKey ValueExport `json:"accessKey,omitempty"` 38 | SecretKey ValueExport `json:"secretKey,omitempty"` 39 | } 40 | 41 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 42 | type MinioBucketList struct { 43 | metav1.TypeMeta `json:",inline"` 44 | metav1.ListMeta `json:"metadata"` 45 | 46 | Items []MinioBucket `json:"items"` 47 | } 48 | 49 | func (db *MinioBucket) GetProvisioningMeta() *ProvisioningMeta { 50 | return &db.Spec.ProvisioningMeta 51 | } 52 | 53 | func (db *MinioBucket) GetSpec() any { 54 | return &db.Spec 55 | } 56 | -------------------------------------------------------------------------------- /pkg/apis/provisioning/v1alpha1/mssqlDatabaseTypes.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | ) 6 | 7 | // +genclient 8 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 9 | // +kubebuilder:printcolumn:name="Platform",type=string,JSONPath=`.spec.platformRef` 10 | // +kubebuilder:printcolumn:name="Domains",type=string,JSONPath=`.spec.domains` 11 | 12 | type MsSqlDatabase struct { 13 | metav1.TypeMeta `json:",inline"` 14 | // +optional 15 | metav1.ObjectMeta `json:"metadata,omitempty"` 16 | 17 | Spec MsSqlDatabaseSpec `json:"spec"` 18 | } 19 | 20 | type MsSqlDatabaseSpec struct { 21 | // Database name prefix. Will have platform and tenant suffix. 22 | DbName string `json:"dbName"` 23 | // Sql Server spec. New database will be created on this server 24 | SqlServer MsSqlServerSpec `json:"sqlServer"` 25 | // Restore from backup. Leave empty for a new empty database. 26 | RestoreFrom MsSqlDatabaseRestoreSpec `json:"restoreFrom"` 27 | // Existing database to be used instead of creating a new one 28 | // eg: "2" 29 | // +optional 30 | ImportDatabaseId string `json:"importDatabaseId,omitempty"` 31 | // +optional 32 | Exports []MsSqlDatabaseExportsSpec `json:"exports,omitempty"` 33 | ProvisioningMeta `json:",inline"` 34 | } 35 | 36 | type MsSqlServerSpec struct { 37 | // Sql Server host name. 38 | HostName string `json:"hostName"` 39 | 40 | // Sql server endpoint port 41 | Port int `json:"port"` 42 | 43 | // Sql server authentication 44 | SqlAuth MsSqlServerAuth `json:"sqlAuth"` 45 | } 46 | 47 | type MsSqlServerAuth struct { 48 | // Sql server username 49 | Username string `json:"username"` 50 | 51 | // Sql server password 52 | Password string `json:"password"` 53 | } 54 | 55 | type MsSqlDatabaseRestoreSpec struct { 56 | //The backup file to restore from. Should be located on the SQL server machine. 57 | BackupFilePath string `json:"backupFilePath"` 58 | } 59 | 60 | type MsSqlDatabaseExportsSpec struct { 61 | // The domain or bounded-context in which this database will be used. 62 | Domain string `json:"domain"` 63 | // +optional 64 | DbName ValueExport `json:"dbName,omitempty"` 65 | } 66 | 67 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 68 | 69 | type MsSqlDatabaseList struct { 70 | metav1.TypeMeta `json:",inline"` 71 | metav1.ListMeta `json:"metadata"` 72 | 73 | Items []MsSqlDatabase `json:"items"` 74 | } 75 | 76 | func (db *MsSqlDatabase) GetProvisioningMeta() *ProvisioningMeta { 77 | return &db.Spec.ProvisioningMeta 78 | } 79 | 80 | func (db *MsSqlDatabase) GetSpec() any { 81 | return &db.Spec 82 | } 83 | -------------------------------------------------------------------------------- /pkg/apis/provisioning/v1alpha1/register.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | "k8s.io/apimachinery/pkg/runtime" 6 | "k8s.io/apimachinery/pkg/runtime/schema" 7 | "totalsoft.ro/platform-controllers/pkg/apis/provisioning" 8 | ) 9 | 10 | // SchemeGroupVersion is group version used to register these objects. 11 | var SchemeGroupVersion = schema.GroupVersion{Group: provisioning.GroupName, Version: "v1alpha1"} 12 | 13 | // Kind takes an unqualified kind and returns back a Group qualified GroupKind. 14 | func Kind(kind string) schema.GroupKind { 15 | return SchemeGroupVersion.WithKind(kind).GroupKind() 16 | } 17 | 18 | // Resource takes an unqualified resource and returns a Group qualified GroupResource. 19 | func Resource(resource string) schema.GroupResource { 20 | return SchemeGroupVersion.WithResource(resource).GroupResource() 21 | } 22 | 23 | var ( 24 | SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) 25 | AddToScheme = SchemeBuilder.AddToScheme 26 | ) 27 | 28 | // Adds the list of known types to Scheme. 29 | func addKnownTypes(scheme *runtime.Scheme) error { 30 | scheme.AddKnownTypes( 31 | SchemeGroupVersion, 32 | &AzureDatabase{}, 33 | &AzureDatabaseList{}, 34 | &AzureManagedDatabase{}, 35 | &AzureManagedDatabaseList{}, 36 | &AzurePowerShellScript{}, 37 | &AzurePowerShellScriptList{}, 38 | &AzureVirtualMachine{}, 39 | &AzureVirtualMachineList{}, 40 | &AzureVirtualDesktop{}, 41 | &AzureVirtualDesktopList{}, 42 | &EntraUser{}, 43 | &EntraUserList{}, 44 | &HelmRelease{}, 45 | &HelmReleaseList{}, 46 | &MsSqlDatabase{}, 47 | &MsSqlDatabaseList{}, 48 | &LocalScript{}, 49 | &LocalScriptList{}, 50 | &MinioBucket{}, 51 | &MinioBucketList{}, 52 | &metav1.Status{}, 53 | ) 54 | metav1.AddToGroupVersion(scheme, SchemeGroupVersion) 55 | return nil 56 | } 57 | -------------------------------------------------------------------------------- /pkg/apis/provisioning/v1alpha1/types.go: -------------------------------------------------------------------------------- 1 | // +genclient 2 | 3 | package v1alpha1 4 | -------------------------------------------------------------------------------- /pkg/apis/provisioning/v1alpha1/zz_generated.defaults.go: -------------------------------------------------------------------------------- 1 | //go:build !ignore_autogenerated 2 | // +build !ignore_autogenerated 3 | 4 | /* 5 | Copyright The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | // Code generated by defaulter-gen. DO NOT EDIT. 21 | 22 | package v1alpha1 23 | 24 | import ( 25 | runtime "k8s.io/apimachinery/pkg/runtime" 26 | ) 27 | 28 | // RegisterDefaults adds defaulters functions to the given scheme. 29 | // Public to allow building arbitrary schemes. 30 | // All generated defaulters are covering - they call all nested defaulters. 31 | func RegisterDefaults(scheme *runtime.Scheme) error { 32 | return nil 33 | } 34 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/configuration/v1alpha1/configurationdomainspec.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // ConfigurationDomainSpecApplyConfiguration represents an declarative configuration of the ConfigurationDomainSpec type for use 22 | // with apply. 23 | type ConfigurationDomainSpecApplyConfiguration struct { 24 | PlatformRef *string `json:"platformRef,omitempty"` 25 | AggregateConfigMaps *bool `json:"aggregateConfigMaps,omitempty"` 26 | AggregateSecrets *bool `json:"aggregateSecrets,omitempty"` 27 | } 28 | 29 | // ConfigurationDomainSpecApplyConfiguration constructs an declarative configuration of the ConfigurationDomainSpec type for use with 30 | // apply. 31 | func ConfigurationDomainSpec() *ConfigurationDomainSpecApplyConfiguration { 32 | return &ConfigurationDomainSpecApplyConfiguration{} 33 | } 34 | 35 | // WithPlatformRef sets the PlatformRef field in the declarative configuration to the given value 36 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 37 | // If called multiple times, the PlatformRef field is set to the value of the last call. 38 | func (b *ConfigurationDomainSpecApplyConfiguration) WithPlatformRef(value string) *ConfigurationDomainSpecApplyConfiguration { 39 | b.PlatformRef = &value 40 | return b 41 | } 42 | 43 | // WithAggregateConfigMaps sets the AggregateConfigMaps field in the declarative configuration to the given value 44 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 45 | // If called multiple times, the AggregateConfigMaps field is set to the value of the last call. 46 | func (b *ConfigurationDomainSpecApplyConfiguration) WithAggregateConfigMaps(value bool) *ConfigurationDomainSpecApplyConfiguration { 47 | b.AggregateConfigMaps = &value 48 | return b 49 | } 50 | 51 | // WithAggregateSecrets sets the AggregateSecrets field in the declarative configuration to the given value 52 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 53 | // If called multiple times, the AggregateSecrets field is set to the value of the last call. 54 | func (b *ConfigurationDomainSpecApplyConfiguration) WithAggregateSecrets(value bool) *ConfigurationDomainSpecApplyConfiguration { 55 | b.AggregateSecrets = &value 56 | return b 57 | } 58 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/configuration/v1alpha1/configurationdomainstatus.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | import ( 22 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 23 | ) 24 | 25 | // ConfigurationDomainStatusApplyConfiguration represents an declarative configuration of the ConfigurationDomainStatus type for use 26 | // with apply. 27 | type ConfigurationDomainStatusApplyConfiguration struct { 28 | Conditions []v1.Condition `json:"conditions,omitempty"` 29 | } 30 | 31 | // ConfigurationDomainStatusApplyConfiguration constructs an declarative configuration of the ConfigurationDomainStatus type for use with 32 | // apply. 33 | func ConfigurationDomainStatus() *ConfigurationDomainStatusApplyConfiguration { 34 | return &ConfigurationDomainStatusApplyConfiguration{} 35 | } 36 | 37 | // WithConditions adds the given value to the Conditions field in the declarative configuration 38 | // and returns the receiver, so that objects can be build by chaining "With" function invocations. 39 | // If called multiple times, values provided by each call will be appended to the Conditions field. 40 | func (b *ConfigurationDomainStatusApplyConfiguration) WithConditions(values ...v1.Condition) *ConfigurationDomainStatusApplyConfiguration { 41 | for i := range values { 42 | b.Conditions = append(b.Conditions, values[i]) 43 | } 44 | return b 45 | } 46 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/internal/internal.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package internal 20 | 21 | import ( 22 | "fmt" 23 | "sync" 24 | 25 | typed "sigs.k8s.io/structured-merge-diff/v4/typed" 26 | ) 27 | 28 | func Parser() *typed.Parser { 29 | parserOnce.Do(func() { 30 | var err error 31 | parser, err = typed.NewParser(schemaYAML) 32 | if err != nil { 33 | panic(fmt.Sprintf("Failed to parse schema: %v", err)) 34 | } 35 | }) 36 | return parser 37 | } 38 | 39 | var parserOnce sync.Once 40 | var parser *typed.Parser 41 | var schemaYAML = typed.YAMLObject(`types: 42 | - name: __untyped_atomic_ 43 | scalar: untyped 44 | list: 45 | elementType: 46 | namedType: __untyped_atomic_ 47 | elementRelationship: atomic 48 | map: 49 | elementType: 50 | namedType: __untyped_atomic_ 51 | elementRelationship: atomic 52 | - name: __untyped_deduced_ 53 | scalar: untyped 54 | list: 55 | elementType: 56 | namedType: __untyped_atomic_ 57 | elementRelationship: atomic 58 | map: 59 | elementType: 60 | namedType: __untyped_deduced_ 61 | elementRelationship: separable 62 | `) 63 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/platform/v1alpha1/domainspec.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // DomainSpecApplyConfiguration represents an declarative configuration of the DomainSpec type for use 22 | // with apply. 23 | type DomainSpecApplyConfiguration struct { 24 | PlatformRef *string `json:"platformRef,omitempty"` 25 | ExportActiveDomains *bool `json:"exportActiveDomains,omitempty"` 26 | } 27 | 28 | // DomainSpecApplyConfiguration constructs an declarative configuration of the DomainSpec type for use with 29 | // apply. 30 | func DomainSpec() *DomainSpecApplyConfiguration { 31 | return &DomainSpecApplyConfiguration{} 32 | } 33 | 34 | // WithPlatformRef sets the PlatformRef field in the declarative configuration to the given value 35 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 36 | // If called multiple times, the PlatformRef field is set to the value of the last call. 37 | func (b *DomainSpecApplyConfiguration) WithPlatformRef(value string) *DomainSpecApplyConfiguration { 38 | b.PlatformRef = &value 39 | return b 40 | } 41 | 42 | // WithExportActiveDomains sets the ExportActiveDomains field in the declarative configuration to the given value 43 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 44 | // If called multiple times, the ExportActiveDomains field is set to the value of the last call. 45 | func (b *DomainSpecApplyConfiguration) WithExportActiveDomains(value bool) *DomainSpecApplyConfiguration { 46 | b.ExportActiveDomains = &value 47 | return b 48 | } 49 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/platform/v1alpha1/platformspec.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // PlatformSpecApplyConfiguration represents an declarative configuration of the PlatformSpec type for use 22 | // with apply. 23 | type PlatformSpecApplyConfiguration struct { 24 | TargetNamespace *string `json:"targetNamespace,omitempty"` 25 | } 26 | 27 | // PlatformSpecApplyConfiguration constructs an declarative configuration of the PlatformSpec type for use with 28 | // apply. 29 | func PlatformSpec() *PlatformSpecApplyConfiguration { 30 | return &PlatformSpecApplyConfiguration{} 31 | } 32 | 33 | // WithTargetNamespace sets the TargetNamespace field in the declarative configuration to the given value 34 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 35 | // If called multiple times, the TargetNamespace field is set to the value of the last call. 36 | func (b *PlatformSpecApplyConfiguration) WithTargetNamespace(value string) *PlatformSpecApplyConfiguration { 37 | b.TargetNamespace = &value 38 | return b 39 | } 40 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/platform/v1alpha1/platformstatus.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | import ( 22 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 23 | ) 24 | 25 | // PlatformStatusApplyConfiguration represents an declarative configuration of the PlatformStatus type for use 26 | // with apply. 27 | type PlatformStatusApplyConfiguration struct { 28 | Conditions []v1.Condition `json:"conditions,omitempty"` 29 | } 30 | 31 | // PlatformStatusApplyConfiguration constructs an declarative configuration of the PlatformStatus type for use with 32 | // apply. 33 | func PlatformStatus() *PlatformStatusApplyConfiguration { 34 | return &PlatformStatusApplyConfiguration{} 35 | } 36 | 37 | // WithConditions adds the given value to the Conditions field in the declarative configuration 38 | // and returns the receiver, so that objects can be build by chaining "With" function invocations. 39 | // If called multiple times, values provided by each call will be appended to the Conditions field. 40 | func (b *PlatformStatusApplyConfiguration) WithConditions(values ...v1.Condition) *PlatformStatusApplyConfiguration { 41 | for i := range values { 42 | b.Conditions = append(b.Conditions, values[i]) 43 | } 44 | return b 45 | } 46 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/platform/v1alpha1/tenantstatus.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | import ( 22 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 23 | ) 24 | 25 | // TenantStatusApplyConfiguration represents an declarative configuration of the TenantStatus type for use 26 | // with apply. 27 | type TenantStatusApplyConfiguration struct { 28 | LastResyncTime *v1.Time `json:"lastResyncTime,omitempty"` 29 | Conditions []v1.Condition `json:"conditions,omitempty"` 30 | } 31 | 32 | // TenantStatusApplyConfiguration constructs an declarative configuration of the TenantStatus type for use with 33 | // apply. 34 | func TenantStatus() *TenantStatusApplyConfiguration { 35 | return &TenantStatusApplyConfiguration{} 36 | } 37 | 38 | // WithLastResyncTime sets the LastResyncTime field in the declarative configuration to the given value 39 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 40 | // If called multiple times, the LastResyncTime field is set to the value of the last call. 41 | func (b *TenantStatusApplyConfiguration) WithLastResyncTime(value v1.Time) *TenantStatusApplyConfiguration { 42 | b.LastResyncTime = &value 43 | return b 44 | } 45 | 46 | // WithConditions adds the given value to the Conditions field in the declarative configuration 47 | // and returns the receiver, so that objects can be build by chaining "With" function invocations. 48 | // If called multiple times, values provided by each call will be appended to the Conditions field. 49 | func (b *TenantStatusApplyConfiguration) WithConditions(values ...v1.Condition) *TenantStatusApplyConfiguration { 50 | for i := range values { 51 | b.Conditions = append(b.Conditions, values[i]) 52 | } 53 | return b 54 | } 55 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/azuredatabaseexportsspec.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // AzureDatabaseExportsSpecApplyConfiguration represents an declarative configuration of the AzureDatabaseExportsSpec type for use 22 | // with apply. 23 | type AzureDatabaseExportsSpecApplyConfiguration struct { 24 | Domain *string `json:"domain,omitempty"` 25 | DbName *ValueExportApplyConfiguration `json:"dbName,omitempty"` 26 | } 27 | 28 | // AzureDatabaseExportsSpecApplyConfiguration constructs an declarative configuration of the AzureDatabaseExportsSpec type for use with 29 | // apply. 30 | func AzureDatabaseExportsSpec() *AzureDatabaseExportsSpecApplyConfiguration { 31 | return &AzureDatabaseExportsSpecApplyConfiguration{} 32 | } 33 | 34 | // WithDomain sets the Domain field in the declarative configuration to the given value 35 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 36 | // If called multiple times, the Domain field is set to the value of the last call. 37 | func (b *AzureDatabaseExportsSpecApplyConfiguration) WithDomain(value string) *AzureDatabaseExportsSpecApplyConfiguration { 38 | b.Domain = &value 39 | return b 40 | } 41 | 42 | // WithDbName sets the DbName field in the declarative configuration to the given value 43 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 44 | // If called multiple times, the DbName field is set to the value of the last call. 45 | func (b *AzureDatabaseExportsSpecApplyConfiguration) WithDbName(value *ValueExportApplyConfiguration) *AzureDatabaseExportsSpecApplyConfiguration { 46 | b.DbName = value 47 | return b 48 | } 49 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/azuremanageddatabaseexportsspec.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // AzureManagedDatabaseExportsSpecApplyConfiguration represents an declarative configuration of the AzureManagedDatabaseExportsSpec type for use 22 | // with apply. 23 | type AzureManagedDatabaseExportsSpecApplyConfiguration struct { 24 | Domain *string `json:"domain,omitempty"` 25 | DbName *ValueExportApplyConfiguration `json:"dbName,omitempty"` 26 | } 27 | 28 | // AzureManagedDatabaseExportsSpecApplyConfiguration constructs an declarative configuration of the AzureManagedDatabaseExportsSpec type for use with 29 | // apply. 30 | func AzureManagedDatabaseExportsSpec() *AzureManagedDatabaseExportsSpecApplyConfiguration { 31 | return &AzureManagedDatabaseExportsSpecApplyConfiguration{} 32 | } 33 | 34 | // WithDomain sets the Domain field in the declarative configuration to the given value 35 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 36 | // If called multiple times, the Domain field is set to the value of the last call. 37 | func (b *AzureManagedDatabaseExportsSpecApplyConfiguration) WithDomain(value string) *AzureManagedDatabaseExportsSpecApplyConfiguration { 38 | b.Domain = &value 39 | return b 40 | } 41 | 42 | // WithDbName sets the DbName field in the declarative configuration to the given value 43 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 44 | // If called multiple times, the DbName field is set to the value of the last call. 45 | func (b *AzureManagedDatabaseExportsSpecApplyConfiguration) WithDbName(value *ValueExportApplyConfiguration) *AzureManagedDatabaseExportsSpecApplyConfiguration { 46 | b.DbName = value 47 | return b 48 | } 49 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/azuremanageddatabaserestorespec.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // AzureManagedDatabaseRestoreSpecApplyConfiguration represents an declarative configuration of the AzureManagedDatabaseRestoreSpec type for use 22 | // with apply. 23 | type AzureManagedDatabaseRestoreSpecApplyConfiguration struct { 24 | BackupFileName *string `json:"backupFileName,omitempty"` 25 | StorageContainer *AzureStorageContainerSpecApplyConfiguration `json:"storageContainer,omitempty"` 26 | } 27 | 28 | // AzureManagedDatabaseRestoreSpecApplyConfiguration constructs an declarative configuration of the AzureManagedDatabaseRestoreSpec type for use with 29 | // apply. 30 | func AzureManagedDatabaseRestoreSpec() *AzureManagedDatabaseRestoreSpecApplyConfiguration { 31 | return &AzureManagedDatabaseRestoreSpecApplyConfiguration{} 32 | } 33 | 34 | // WithBackupFileName sets the BackupFileName field in the declarative configuration to the given value 35 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 36 | // If called multiple times, the BackupFileName field is set to the value of the last call. 37 | func (b *AzureManagedDatabaseRestoreSpecApplyConfiguration) WithBackupFileName(value string) *AzureManagedDatabaseRestoreSpecApplyConfiguration { 38 | b.BackupFileName = &value 39 | return b 40 | } 41 | 42 | // WithStorageContainer sets the StorageContainer field in the declarative configuration to the given value 43 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 44 | // If called multiple times, the StorageContainer field is set to the value of the last call. 45 | func (b *AzureManagedDatabaseRestoreSpecApplyConfiguration) WithStorageContainer(value *AzureStorageContainerSpecApplyConfiguration) *AzureManagedDatabaseRestoreSpecApplyConfiguration { 46 | b.StorageContainer = value 47 | return b 48 | } 49 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/azuremanagedinstancespec.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // AzureManagedInstanceSpecApplyConfiguration represents an declarative configuration of the AzureManagedInstanceSpec type for use 22 | // with apply. 23 | type AzureManagedInstanceSpecApplyConfiguration struct { 24 | Name *string `json:"name,omitempty"` 25 | ResourceGroup *string `json:"resourceGroup,omitempty"` 26 | } 27 | 28 | // AzureManagedInstanceSpecApplyConfiguration constructs an declarative configuration of the AzureManagedInstanceSpec type for use with 29 | // apply. 30 | func AzureManagedInstanceSpec() *AzureManagedInstanceSpecApplyConfiguration { 31 | return &AzureManagedInstanceSpecApplyConfiguration{} 32 | } 33 | 34 | // WithName sets the Name field in the declarative configuration to the given value 35 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 36 | // If called multiple times, the Name field is set to the value of the last call. 37 | func (b *AzureManagedInstanceSpecApplyConfiguration) WithName(value string) *AzureManagedInstanceSpecApplyConfiguration { 38 | b.Name = &value 39 | return b 40 | } 41 | 42 | // WithResourceGroup sets the ResourceGroup field in the declarative configuration to the given value 43 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 44 | // If called multiple times, the ResourceGroup field is set to the value of the last call. 45 | func (b *AzureManagedInstanceSpecApplyConfiguration) WithResourceGroup(value string) *AzureManagedInstanceSpecApplyConfiguration { 46 | b.ResourceGroup = &value 47 | return b 48 | } 49 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/azurepowershellscriptexportsspec.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // AzurePowerShellScriptExportsSpecApplyConfiguration represents an declarative configuration of the AzurePowerShellScriptExportsSpec type for use 22 | // with apply. 23 | type AzurePowerShellScriptExportsSpecApplyConfiguration struct { 24 | Domain *string `json:"domain,omitempty"` 25 | ScriptOutputs *ValueExportApplyConfiguration `json:"scriptOutputs,omitempty"` 26 | } 27 | 28 | // AzurePowerShellScriptExportsSpecApplyConfiguration constructs an declarative configuration of the AzurePowerShellScriptExportsSpec type for use with 29 | // apply. 30 | func AzurePowerShellScriptExportsSpec() *AzurePowerShellScriptExportsSpecApplyConfiguration { 31 | return &AzurePowerShellScriptExportsSpecApplyConfiguration{} 32 | } 33 | 34 | // WithDomain sets the Domain field in the declarative configuration to the given value 35 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 36 | // If called multiple times, the Domain field is set to the value of the last call. 37 | func (b *AzurePowerShellScriptExportsSpecApplyConfiguration) WithDomain(value string) *AzurePowerShellScriptExportsSpecApplyConfiguration { 38 | b.Domain = &value 39 | return b 40 | } 41 | 42 | // WithScriptOutputs sets the ScriptOutputs field in the declarative configuration to the given value 43 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 44 | // If called multiple times, the ScriptOutputs field is set to the value of the last call. 45 | func (b *AzurePowerShellScriptExportsSpecApplyConfiguration) WithScriptOutputs(value *ValueExportApplyConfiguration) *AzurePowerShellScriptExportsSpecApplyConfiguration { 46 | b.ScriptOutputs = value 47 | return b 48 | } 49 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/azurestoragecontainerspec.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // AzureStorageContainerSpecApplyConfiguration represents an declarative configuration of the AzureStorageContainerSpec type for use 22 | // with apply. 23 | type AzureStorageContainerSpecApplyConfiguration struct { 24 | SasToken *string `json:"sasToken,omitempty"` 25 | Uri *string `json:"uri,omitempty"` 26 | } 27 | 28 | // AzureStorageContainerSpecApplyConfiguration constructs an declarative configuration of the AzureStorageContainerSpec type for use with 29 | // apply. 30 | func AzureStorageContainerSpec() *AzureStorageContainerSpecApplyConfiguration { 31 | return &AzureStorageContainerSpecApplyConfiguration{} 32 | } 33 | 34 | // WithSasToken sets the SasToken field in the declarative configuration to the given value 35 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 36 | // If called multiple times, the SasToken field is set to the value of the last call. 37 | func (b *AzureStorageContainerSpecApplyConfiguration) WithSasToken(value string) *AzureStorageContainerSpecApplyConfiguration { 38 | b.SasToken = &value 39 | return b 40 | } 41 | 42 | // WithUri sets the Uri field in the declarative configuration to the given value 43 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 44 | // If called multiple times, the Uri field is set to the value of the last call. 45 | func (b *AzureStorageContainerSpecApplyConfiguration) WithUri(value string) *AzureStorageContainerSpecApplyConfiguration { 46 | b.Uri = &value 47 | return b 48 | } 49 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/azurevirtualdesktopapplication.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // AzureVirtualDesktopApplicationApplyConfiguration represents an declarative configuration of the AzureVirtualDesktopApplication type for use 22 | // with apply. 23 | type AzureVirtualDesktopApplicationApplyConfiguration struct { 24 | Name *string `json:"name,omitempty"` 25 | FriendlyName *string `json:"friendlyName,omitempty"` 26 | Path *string `json:"path,omitempty"` 27 | } 28 | 29 | // AzureVirtualDesktopApplicationApplyConfiguration constructs an declarative configuration of the AzureVirtualDesktopApplication type for use with 30 | // apply. 31 | func AzureVirtualDesktopApplication() *AzureVirtualDesktopApplicationApplyConfiguration { 32 | return &AzureVirtualDesktopApplicationApplyConfiguration{} 33 | } 34 | 35 | // WithName sets the Name field in the declarative configuration to the given value 36 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 37 | // If called multiple times, the Name field is set to the value of the last call. 38 | func (b *AzureVirtualDesktopApplicationApplyConfiguration) WithName(value string) *AzureVirtualDesktopApplicationApplyConfiguration { 39 | b.Name = &value 40 | return b 41 | } 42 | 43 | // WithFriendlyName sets the FriendlyName field in the declarative configuration to the given value 44 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 45 | // If called multiple times, the FriendlyName field is set to the value of the last call. 46 | func (b *AzureVirtualDesktopApplicationApplyConfiguration) WithFriendlyName(value string) *AzureVirtualDesktopApplicationApplyConfiguration { 47 | b.FriendlyName = &value 48 | return b 49 | } 50 | 51 | // WithPath sets the Path field in the declarative configuration to the given value 52 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 53 | // If called multiple times, the Path field is set to the value of the last call. 54 | func (b *AzureVirtualDesktopApplicationApplyConfiguration) WithPath(value string) *AzureVirtualDesktopApplicationApplyConfiguration { 55 | b.Path = &value 56 | return b 57 | } 58 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/azurevirtualdesktopgroupsspec.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // AzureVirtualDesktopGroupsSpecApplyConfiguration represents an declarative configuration of the AzureVirtualDesktopGroupsSpec type for use 22 | // with apply. 23 | type AzureVirtualDesktopGroupsSpecApplyConfiguration struct { 24 | Admins []string `json:"admins,omitempty"` 25 | ApplicationUsers []string `json:"applicationUsers,omitempty"` 26 | } 27 | 28 | // AzureVirtualDesktopGroupsSpecApplyConfiguration constructs an declarative configuration of the AzureVirtualDesktopGroupsSpec type for use with 29 | // apply. 30 | func AzureVirtualDesktopGroupsSpec() *AzureVirtualDesktopGroupsSpecApplyConfiguration { 31 | return &AzureVirtualDesktopGroupsSpecApplyConfiguration{} 32 | } 33 | 34 | // WithAdmins adds the given value to the Admins field in the declarative configuration 35 | // and returns the receiver, so that objects can be build by chaining "With" function invocations. 36 | // If called multiple times, values provided by each call will be appended to the Admins field. 37 | func (b *AzureVirtualDesktopGroupsSpecApplyConfiguration) WithAdmins(values ...string) *AzureVirtualDesktopGroupsSpecApplyConfiguration { 38 | for i := range values { 39 | b.Admins = append(b.Admins, values[i]) 40 | } 41 | return b 42 | } 43 | 44 | // WithApplicationUsers adds the given value to the ApplicationUsers field in the declarative configuration 45 | // and returns the receiver, so that objects can be build by chaining "With" function invocations. 46 | // If called multiple times, values provided by each call will be appended to the ApplicationUsers field. 47 | func (b *AzureVirtualDesktopGroupsSpecApplyConfiguration) WithApplicationUsers(values ...string) *AzureVirtualDesktopGroupsSpecApplyConfiguration { 48 | for i := range values { 49 | b.ApplicationUsers = append(b.ApplicationUsers, values[i]) 50 | } 51 | return b 52 | } 53 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/azurevirtualdesktopusersspec.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // AzureVirtualDesktopUsersSpecApplyConfiguration represents an declarative configuration of the AzureVirtualDesktopUsersSpec type for use 22 | // with apply. 23 | type AzureVirtualDesktopUsersSpecApplyConfiguration struct { 24 | Admins []string `json:"admins,omitempty"` 25 | ApplicationUsers []string `json:"applicationUsers,omitempty"` 26 | } 27 | 28 | // AzureVirtualDesktopUsersSpecApplyConfiguration constructs an declarative configuration of the AzureVirtualDesktopUsersSpec type for use with 29 | // apply. 30 | func AzureVirtualDesktopUsersSpec() *AzureVirtualDesktopUsersSpecApplyConfiguration { 31 | return &AzureVirtualDesktopUsersSpecApplyConfiguration{} 32 | } 33 | 34 | // WithAdmins adds the given value to the Admins field in the declarative configuration 35 | // and returns the receiver, so that objects can be build by chaining "With" function invocations. 36 | // If called multiple times, values provided by each call will be appended to the Admins field. 37 | func (b *AzureVirtualDesktopUsersSpecApplyConfiguration) WithAdmins(values ...string) *AzureVirtualDesktopUsersSpecApplyConfiguration { 38 | for i := range values { 39 | b.Admins = append(b.Admins, values[i]) 40 | } 41 | return b 42 | } 43 | 44 | // WithApplicationUsers adds the given value to the ApplicationUsers field in the declarative configuration 45 | // and returns the receiver, so that objects can be build by chaining "With" function invocations. 46 | // If called multiple times, values provided by each call will be appended to the ApplicationUsers field. 47 | func (b *AzureVirtualDesktopUsersSpecApplyConfiguration) WithApplicationUsers(values ...string) *AzureVirtualDesktopUsersSpecApplyConfiguration { 48 | for i := range values { 49 | b.ApplicationUsers = append(b.ApplicationUsers, values[i]) 50 | } 51 | return b 52 | } 53 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/configmaptemplate.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // ConfigMapTemplateApplyConfiguration represents an declarative configuration of the ConfigMapTemplate type for use 22 | // with apply. 23 | type ConfigMapTemplateApplyConfiguration struct { 24 | KeyTemplate *string `json:"keyTemplate,omitempty"` 25 | } 26 | 27 | // ConfigMapTemplateApplyConfiguration constructs an declarative configuration of the ConfigMapTemplate type for use with 28 | // apply. 29 | func ConfigMapTemplate() *ConfigMapTemplateApplyConfiguration { 30 | return &ConfigMapTemplateApplyConfiguration{} 31 | } 32 | 33 | // WithKeyTemplate sets the KeyTemplate field in the declarative configuration to the given value 34 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 35 | // If called multiple times, the KeyTemplate field is set to the value of the last call. 36 | func (b *ConfigMapTemplateApplyConfiguration) WithKeyTemplate(value string) *ConfigMapTemplateApplyConfiguration { 37 | b.KeyTemplate = &value 38 | return b 39 | } 40 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/helmreleaseexportsspec.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // HelmReleaseExportsSpecApplyConfiguration represents an declarative configuration of the HelmReleaseExportsSpec type for use 22 | // with apply. 23 | type HelmReleaseExportsSpecApplyConfiguration struct { 24 | Domain *string `json:"domain,omitempty"` 25 | ReleaseName *ValueExportApplyConfiguration `json:"releaseName,omitempty"` 26 | } 27 | 28 | // HelmReleaseExportsSpecApplyConfiguration constructs an declarative configuration of the HelmReleaseExportsSpec type for use with 29 | // apply. 30 | func HelmReleaseExportsSpec() *HelmReleaseExportsSpecApplyConfiguration { 31 | return &HelmReleaseExportsSpecApplyConfiguration{} 32 | } 33 | 34 | // WithDomain sets the Domain field in the declarative configuration to the given value 35 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 36 | // If called multiple times, the Domain field is set to the value of the last call. 37 | func (b *HelmReleaseExportsSpecApplyConfiguration) WithDomain(value string) *HelmReleaseExportsSpecApplyConfiguration { 38 | b.Domain = &value 39 | return b 40 | } 41 | 42 | // WithReleaseName sets the ReleaseName field in the declarative configuration to the given value 43 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 44 | // If called multiple times, the ReleaseName field is set to the value of the last call. 45 | func (b *HelmReleaseExportsSpecApplyConfiguration) WithReleaseName(value *ValueExportApplyConfiguration) *HelmReleaseExportsSpecApplyConfiguration { 46 | b.ReleaseName = value 47 | return b 48 | } 49 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/initscriptargs.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // InitScriptArgsApplyConfiguration represents an declarative configuration of the InitScriptArgs type for use 22 | // with apply. 23 | type InitScriptArgsApplyConfiguration struct { 24 | Name *string `json:"name,omitempty"` 25 | Value *string `json:"value,omitempty"` 26 | } 27 | 28 | // InitScriptArgsApplyConfiguration constructs an declarative configuration of the InitScriptArgs type for use with 29 | // apply. 30 | func InitScriptArgs() *InitScriptArgsApplyConfiguration { 31 | return &InitScriptArgsApplyConfiguration{} 32 | } 33 | 34 | // WithName sets the Name field in the declarative configuration to the given value 35 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 36 | // If called multiple times, the Name field is set to the value of the last call. 37 | func (b *InitScriptArgsApplyConfiguration) WithName(value string) *InitScriptArgsApplyConfiguration { 38 | b.Name = &value 39 | return b 40 | } 41 | 42 | // WithValue sets the Value field in the declarative configuration to the given value 43 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 44 | // If called multiple times, the Value field is set to the value of the last call. 45 | func (b *InitScriptArgsApplyConfiguration) WithValue(value string) *InitScriptArgsApplyConfiguration { 46 | b.Value = &value 47 | return b 48 | } 49 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/kubesecrettemplate.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // KubeSecretTemplateApplyConfiguration represents an declarative configuration of the KubeSecretTemplate type for use 22 | // with apply. 23 | type KubeSecretTemplateApplyConfiguration struct { 24 | KeyTemplate *string `json:"keyTemplate,omitempty"` 25 | } 26 | 27 | // KubeSecretTemplateApplyConfiguration constructs an declarative configuration of the KubeSecretTemplate type for use with 28 | // apply. 29 | func KubeSecretTemplate() *KubeSecretTemplateApplyConfiguration { 30 | return &KubeSecretTemplateApplyConfiguration{} 31 | } 32 | 33 | // WithKeyTemplate sets the KeyTemplate field in the declarative configuration to the given value 34 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 35 | // If called multiple times, the KeyTemplate field is set to the value of the last call. 36 | func (b *KubeSecretTemplateApplyConfiguration) WithKeyTemplate(value string) *KubeSecretTemplateApplyConfiguration { 37 | b.KeyTemplate = &value 38 | return b 39 | } 40 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/localscriptexportsspec.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // LocalScriptExportsSpecApplyConfiguration represents an declarative configuration of the LocalScriptExportsSpec type for use 22 | // with apply. 23 | type LocalScriptExportsSpecApplyConfiguration struct { 24 | Domain *string `json:"domain,omitempty"` 25 | ScriptOutput *ValueExportApplyConfiguration `json:"scriptOutput,omitempty"` 26 | } 27 | 28 | // LocalScriptExportsSpecApplyConfiguration constructs an declarative configuration of the LocalScriptExportsSpec type for use with 29 | // apply. 30 | func LocalScriptExportsSpec() *LocalScriptExportsSpecApplyConfiguration { 31 | return &LocalScriptExportsSpecApplyConfiguration{} 32 | } 33 | 34 | // WithDomain sets the Domain field in the declarative configuration to the given value 35 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 36 | // If called multiple times, the Domain field is set to the value of the last call. 37 | func (b *LocalScriptExportsSpecApplyConfiguration) WithDomain(value string) *LocalScriptExportsSpecApplyConfiguration { 38 | b.Domain = &value 39 | return b 40 | } 41 | 42 | // WithScriptOutput sets the ScriptOutput field in the declarative configuration to the given value 43 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 44 | // If called multiple times, the ScriptOutput field is set to the value of the last call. 45 | func (b *LocalScriptExportsSpecApplyConfiguration) WithScriptOutput(value *ValueExportApplyConfiguration) *LocalScriptExportsSpecApplyConfiguration { 46 | b.ScriptOutput = value 47 | return b 48 | } 49 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/mssqldatabaseexportsspec.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // MsSqlDatabaseExportsSpecApplyConfiguration represents an declarative configuration of the MsSqlDatabaseExportsSpec type for use 22 | // with apply. 23 | type MsSqlDatabaseExportsSpecApplyConfiguration struct { 24 | Domain *string `json:"domain,omitempty"` 25 | DbName *ValueExportApplyConfiguration `json:"dbName,omitempty"` 26 | } 27 | 28 | // MsSqlDatabaseExportsSpecApplyConfiguration constructs an declarative configuration of the MsSqlDatabaseExportsSpec type for use with 29 | // apply. 30 | func MsSqlDatabaseExportsSpec() *MsSqlDatabaseExportsSpecApplyConfiguration { 31 | return &MsSqlDatabaseExportsSpecApplyConfiguration{} 32 | } 33 | 34 | // WithDomain sets the Domain field in the declarative configuration to the given value 35 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 36 | // If called multiple times, the Domain field is set to the value of the last call. 37 | func (b *MsSqlDatabaseExportsSpecApplyConfiguration) WithDomain(value string) *MsSqlDatabaseExportsSpecApplyConfiguration { 38 | b.Domain = &value 39 | return b 40 | } 41 | 42 | // WithDbName sets the DbName field in the declarative configuration to the given value 43 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 44 | // If called multiple times, the DbName field is set to the value of the last call. 45 | func (b *MsSqlDatabaseExportsSpecApplyConfiguration) WithDbName(value *ValueExportApplyConfiguration) *MsSqlDatabaseExportsSpecApplyConfiguration { 46 | b.DbName = value 47 | return b 48 | } 49 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/mssqldatabaserestorespec.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // MsSqlDatabaseRestoreSpecApplyConfiguration represents an declarative configuration of the MsSqlDatabaseRestoreSpec type for use 22 | // with apply. 23 | type MsSqlDatabaseRestoreSpecApplyConfiguration struct { 24 | BackupFilePath *string `json:"backupFilePath,omitempty"` 25 | } 26 | 27 | // MsSqlDatabaseRestoreSpecApplyConfiguration constructs an declarative configuration of the MsSqlDatabaseRestoreSpec type for use with 28 | // apply. 29 | func MsSqlDatabaseRestoreSpec() *MsSqlDatabaseRestoreSpecApplyConfiguration { 30 | return &MsSqlDatabaseRestoreSpecApplyConfiguration{} 31 | } 32 | 33 | // WithBackupFilePath sets the BackupFilePath field in the declarative configuration to the given value 34 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 35 | // If called multiple times, the BackupFilePath field is set to the value of the last call. 36 | func (b *MsSqlDatabaseRestoreSpecApplyConfiguration) WithBackupFilePath(value string) *MsSqlDatabaseRestoreSpecApplyConfiguration { 37 | b.BackupFilePath = &value 38 | return b 39 | } 40 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/mssqlserverauth.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // MsSqlServerAuthApplyConfiguration represents an declarative configuration of the MsSqlServerAuth type for use 22 | // with apply. 23 | type MsSqlServerAuthApplyConfiguration struct { 24 | Username *string `json:"username,omitempty"` 25 | Password *string `json:"password,omitempty"` 26 | } 27 | 28 | // MsSqlServerAuthApplyConfiguration constructs an declarative configuration of the MsSqlServerAuth type for use with 29 | // apply. 30 | func MsSqlServerAuth() *MsSqlServerAuthApplyConfiguration { 31 | return &MsSqlServerAuthApplyConfiguration{} 32 | } 33 | 34 | // WithUsername sets the Username field in the declarative configuration to the given value 35 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 36 | // If called multiple times, the Username field is set to the value of the last call. 37 | func (b *MsSqlServerAuthApplyConfiguration) WithUsername(value string) *MsSqlServerAuthApplyConfiguration { 38 | b.Username = &value 39 | return b 40 | } 41 | 42 | // WithPassword sets the Password field in the declarative configuration to the given value 43 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 44 | // If called multiple times, the Password field is set to the value of the last call. 45 | func (b *MsSqlServerAuthApplyConfiguration) WithPassword(value string) *MsSqlServerAuthApplyConfiguration { 46 | b.Password = &value 47 | return b 48 | } 49 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/mssqlserverspec.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // MsSqlServerSpecApplyConfiguration represents an declarative configuration of the MsSqlServerSpec type for use 22 | // with apply. 23 | type MsSqlServerSpecApplyConfiguration struct { 24 | HostName *string `json:"hostName,omitempty"` 25 | Port *int `json:"port,omitempty"` 26 | SqlAuth *MsSqlServerAuthApplyConfiguration `json:"sqlAuth,omitempty"` 27 | } 28 | 29 | // MsSqlServerSpecApplyConfiguration constructs an declarative configuration of the MsSqlServerSpec type for use with 30 | // apply. 31 | func MsSqlServerSpec() *MsSqlServerSpecApplyConfiguration { 32 | return &MsSqlServerSpecApplyConfiguration{} 33 | } 34 | 35 | // WithHostName sets the HostName field in the declarative configuration to the given value 36 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 37 | // If called multiple times, the HostName field is set to the value of the last call. 38 | func (b *MsSqlServerSpecApplyConfiguration) WithHostName(value string) *MsSqlServerSpecApplyConfiguration { 39 | b.HostName = &value 40 | return b 41 | } 42 | 43 | // WithPort sets the Port field in the declarative configuration to the given value 44 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 45 | // If called multiple times, the Port field is set to the value of the last call. 46 | func (b *MsSqlServerSpecApplyConfiguration) WithPort(value int) *MsSqlServerSpecApplyConfiguration { 47 | b.Port = &value 48 | return b 49 | } 50 | 51 | // WithSqlAuth sets the SqlAuth field in the declarative configuration to the given value 52 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 53 | // If called multiple times, the SqlAuth field is set to the value of the last call. 54 | func (b *MsSqlServerSpecApplyConfiguration) WithSqlAuth(value *MsSqlServerAuthApplyConfiguration) *MsSqlServerSpecApplyConfiguration { 55 | b.SqlAuth = value 56 | return b 57 | } 58 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/provisioningresourceidendtifier.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | import ( 22 | v1alpha1 "totalsoft.ro/platform-controllers/pkg/apis/provisioning/v1alpha1" 23 | ) 24 | 25 | // ProvisioningResourceIdendtifierApplyConfiguration represents an declarative configuration of the ProvisioningResourceIdendtifier type for use 26 | // with apply. 27 | type ProvisioningResourceIdendtifierApplyConfiguration struct { 28 | Kind *v1alpha1.ProvisioningResourceKind `json:"kind,omitempty"` 29 | Name *string `json:"name,omitempty"` 30 | } 31 | 32 | // ProvisioningResourceIdendtifierApplyConfiguration constructs an declarative configuration of the ProvisioningResourceIdendtifier type for use with 33 | // apply. 34 | func ProvisioningResourceIdendtifier() *ProvisioningResourceIdendtifierApplyConfiguration { 35 | return &ProvisioningResourceIdendtifierApplyConfiguration{} 36 | } 37 | 38 | // WithKind sets the Kind field in the declarative configuration to the given value 39 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 40 | // If called multiple times, the Kind field is set to the value of the last call. 41 | func (b *ProvisioningResourceIdendtifierApplyConfiguration) WithKind(value v1alpha1.ProvisioningResourceKind) *ProvisioningResourceIdendtifierApplyConfiguration { 42 | b.Kind = &value 43 | return b 44 | } 45 | 46 | // WithName sets the Name field in the declarative configuration to the given value 47 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 48 | // If called multiple times, the Name field is set to the value of the last call. 49 | func (b *ProvisioningResourceIdendtifierApplyConfiguration) WithName(value string) *ProvisioningResourceIdendtifierApplyConfiguration { 50 | b.Name = &value 51 | return b 52 | } 53 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/provisioningtarget.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | import ( 22 | v1alpha1 "totalsoft.ro/platform-controllers/pkg/apis/provisioning/v1alpha1" 23 | ) 24 | 25 | // ProvisioningTargetApplyConfiguration represents an declarative configuration of the ProvisioningTarget type for use 26 | // with apply. 27 | type ProvisioningTargetApplyConfiguration struct { 28 | Category *v1alpha1.ProvisioningTargetCategory `json:"category,omitempty"` 29 | Filter *ProvisioningTargetFilterApplyConfiguration `json:"filter,omitempty"` 30 | } 31 | 32 | // ProvisioningTargetApplyConfiguration constructs an declarative configuration of the ProvisioningTarget type for use with 33 | // apply. 34 | func ProvisioningTarget() *ProvisioningTargetApplyConfiguration { 35 | return &ProvisioningTargetApplyConfiguration{} 36 | } 37 | 38 | // WithCategory sets the Category field in the declarative configuration to the given value 39 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 40 | // If called multiple times, the Category field is set to the value of the last call. 41 | func (b *ProvisioningTargetApplyConfiguration) WithCategory(value v1alpha1.ProvisioningTargetCategory) *ProvisioningTargetApplyConfiguration { 42 | b.Category = &value 43 | return b 44 | } 45 | 46 | // WithFilter sets the Filter field in the declarative configuration to the given value 47 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 48 | // If called multiple times, the Filter field is set to the value of the last call. 49 | func (b *ProvisioningTargetApplyConfiguration) WithFilter(value *ProvisioningTargetFilterApplyConfiguration) *ProvisioningTargetApplyConfiguration { 50 | b.Filter = value 51 | return b 52 | } 53 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/provisioningtargetfilter.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | import ( 22 | v1alpha1 "totalsoft.ro/platform-controllers/pkg/apis/provisioning/v1alpha1" 23 | ) 24 | 25 | // ProvisioningTargetFilterApplyConfiguration represents an declarative configuration of the ProvisioningTargetFilter type for use 26 | // with apply. 27 | type ProvisioningTargetFilterApplyConfiguration struct { 28 | Kind *v1alpha1.ProvisioningFilterKind `json:"kind,omitempty"` 29 | Values []string `json:"values,omitempty"` 30 | } 31 | 32 | // ProvisioningTargetFilterApplyConfiguration constructs an declarative configuration of the ProvisioningTargetFilter type for use with 33 | // apply. 34 | func ProvisioningTargetFilter() *ProvisioningTargetFilterApplyConfiguration { 35 | return &ProvisioningTargetFilterApplyConfiguration{} 36 | } 37 | 38 | // WithKind sets the Kind field in the declarative configuration to the given value 39 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 40 | // If called multiple times, the Kind field is set to the value of the last call. 41 | func (b *ProvisioningTargetFilterApplyConfiguration) WithKind(value v1alpha1.ProvisioningFilterKind) *ProvisioningTargetFilterApplyConfiguration { 42 | b.Kind = &value 43 | return b 44 | } 45 | 46 | // WithValues adds the given value to the Values field in the declarative configuration 47 | // and returns the receiver, so that objects can be build by chaining "With" function invocations. 48 | // If called multiple times, values provided by each call will be appended to the Values field. 49 | func (b *ProvisioningTargetFilterApplyConfiguration) WithValues(values ...string) *ProvisioningTargetFilterApplyConfiguration { 50 | for i := range values { 51 | b.Values = append(b.Values, values[i]) 52 | } 53 | return b 54 | } 55 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/sqlserverspec.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // SqlServerSpecApplyConfiguration represents an declarative configuration of the SqlServerSpec type for use 22 | // with apply. 23 | type SqlServerSpecApplyConfiguration struct { 24 | ResourceGroupName *string `json:"resourceGroupName,omitempty"` 25 | ServerName *string `json:"serverName,omitempty"` 26 | ElasticPoolName *string `json:"elasticPoolName,omitempty"` 27 | } 28 | 29 | // SqlServerSpecApplyConfiguration constructs an declarative configuration of the SqlServerSpec type for use with 30 | // apply. 31 | func SqlServerSpec() *SqlServerSpecApplyConfiguration { 32 | return &SqlServerSpecApplyConfiguration{} 33 | } 34 | 35 | // WithResourceGroupName sets the ResourceGroupName field in the declarative configuration to the given value 36 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 37 | // If called multiple times, the ResourceGroupName field is set to the value of the last call. 38 | func (b *SqlServerSpecApplyConfiguration) WithResourceGroupName(value string) *SqlServerSpecApplyConfiguration { 39 | b.ResourceGroupName = &value 40 | return b 41 | } 42 | 43 | // WithServerName sets the ServerName field in the declarative configuration to the given value 44 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 45 | // If called multiple times, the ServerName field is set to the value of the last call. 46 | func (b *SqlServerSpecApplyConfiguration) WithServerName(value string) *SqlServerSpecApplyConfiguration { 47 | b.ServerName = &value 48 | return b 49 | } 50 | 51 | // WithElasticPoolName sets the ElasticPoolName field in the declarative configuration to the given value 52 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 53 | // If called multiple times, the ElasticPoolName field is set to the value of the last call. 54 | func (b *SqlServerSpecApplyConfiguration) WithElasticPoolName(value string) *SqlServerSpecApplyConfiguration { 55 | b.ElasticPoolName = &value 56 | return b 57 | } 58 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/valueexport.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // ValueExportApplyConfiguration represents an declarative configuration of the ValueExport type for use 22 | // with apply. 23 | type ValueExportApplyConfiguration struct { 24 | ToConfigMap *ConfigMapTemplateApplyConfiguration `json:"toConfigMap,omitempty"` 25 | ToVault *VaultSecretTemplateApplyConfiguration `json:"toVault,omitempty"` 26 | ToKubeSecret *KubeSecretTemplateApplyConfiguration `json:"toKubeSecret,omitempty"` 27 | } 28 | 29 | // ValueExportApplyConfiguration constructs an declarative configuration of the ValueExport type for use with 30 | // apply. 31 | func ValueExport() *ValueExportApplyConfiguration { 32 | return &ValueExportApplyConfiguration{} 33 | } 34 | 35 | // WithToConfigMap sets the ToConfigMap field in the declarative configuration to the given value 36 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 37 | // If called multiple times, the ToConfigMap field is set to the value of the last call. 38 | func (b *ValueExportApplyConfiguration) WithToConfigMap(value *ConfigMapTemplateApplyConfiguration) *ValueExportApplyConfiguration { 39 | b.ToConfigMap = value 40 | return b 41 | } 42 | 43 | // WithToVault sets the ToVault field in the declarative configuration to the given value 44 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 45 | // If called multiple times, the ToVault field is set to the value of the last call. 46 | func (b *ValueExportApplyConfiguration) WithToVault(value *VaultSecretTemplateApplyConfiguration) *ValueExportApplyConfiguration { 47 | b.ToVault = value 48 | return b 49 | } 50 | 51 | // WithToKubeSecret sets the ToKubeSecret field in the declarative configuration to the given value 52 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 53 | // If called multiple times, the ToKubeSecret field is set to the value of the last call. 54 | func (b *ValueExportApplyConfiguration) WithToKubeSecret(value *KubeSecretTemplateApplyConfiguration) *ValueExportApplyConfiguration { 55 | b.ToKubeSecret = value 56 | return b 57 | } 58 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/vaultsecrettemplate.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // VaultSecretTemplateApplyConfiguration represents an declarative configuration of the VaultSecretTemplate type for use 22 | // with apply. 23 | type VaultSecretTemplateApplyConfiguration struct { 24 | KeyTemplate *string `json:"keyTemplate,omitempty"` 25 | } 26 | 27 | // VaultSecretTemplateApplyConfiguration constructs an declarative configuration of the VaultSecretTemplate type for use with 28 | // apply. 29 | func VaultSecretTemplate() *VaultSecretTemplateApplyConfiguration { 30 | return &VaultSecretTemplateApplyConfiguration{} 31 | } 32 | 33 | // WithKeyTemplate sets the KeyTemplate field in the declarative configuration to the given value 34 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 35 | // If called multiple times, the KeyTemplate field is set to the value of the last call. 36 | func (b *VaultSecretTemplateApplyConfiguration) WithKeyTemplate(value string) *VaultSecretTemplateApplyConfiguration { 37 | b.KeyTemplate = &value 38 | return b 39 | } 40 | -------------------------------------------------------------------------------- /pkg/generated/applyconfiguration/provisioning/v1alpha1/virtualmachinegalleryapplication.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // VirtualMachineGalleryApplicationApplyConfiguration represents an declarative configuration of the VirtualMachineGalleryApplication type for use 22 | // with apply. 23 | type VirtualMachineGalleryApplicationApplyConfiguration struct { 24 | PackageId *string `json:"packageId,omitempty"` 25 | InstallOrderIndex *int `json:"installOrderIndex,omitempty"` 26 | } 27 | 28 | // VirtualMachineGalleryApplicationApplyConfiguration constructs an declarative configuration of the VirtualMachineGalleryApplication type for use with 29 | // apply. 30 | func VirtualMachineGalleryApplication() *VirtualMachineGalleryApplicationApplyConfiguration { 31 | return &VirtualMachineGalleryApplicationApplyConfiguration{} 32 | } 33 | 34 | // WithPackageId sets the PackageId field in the declarative configuration to the given value 35 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 36 | // If called multiple times, the PackageId field is set to the value of the last call. 37 | func (b *VirtualMachineGalleryApplicationApplyConfiguration) WithPackageId(value string) *VirtualMachineGalleryApplicationApplyConfiguration { 38 | b.PackageId = &value 39 | return b 40 | } 41 | 42 | // WithInstallOrderIndex sets the InstallOrderIndex field in the declarative configuration to the given value 43 | // and returns the receiver, so that objects can be built by chaining "With" function invocations. 44 | // If called multiple times, the InstallOrderIndex field is set to the value of the last call. 45 | func (b *VirtualMachineGalleryApplicationApplyConfiguration) WithInstallOrderIndex(value int) *VirtualMachineGalleryApplicationApplyConfiguration { 46 | b.InstallOrderIndex = &value 47 | return b 48 | } 49 | -------------------------------------------------------------------------------- /pkg/generated/clientset/versioned/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // This package has the automatically generated fake clientset. 20 | package fake 21 | -------------------------------------------------------------------------------- /pkg/generated/clientset/versioned/fake/register.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | package fake 20 | 21 | import ( 22 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 23 | runtime "k8s.io/apimachinery/pkg/runtime" 24 | schema "k8s.io/apimachinery/pkg/runtime/schema" 25 | serializer "k8s.io/apimachinery/pkg/runtime/serializer" 26 | utilruntime "k8s.io/apimachinery/pkg/util/runtime" 27 | configurationv1alpha1 "totalsoft.ro/platform-controllers/pkg/apis/configuration/v1alpha1" 28 | platformv1alpha1 "totalsoft.ro/platform-controllers/pkg/apis/platform/v1alpha1" 29 | provisioningv1alpha1 "totalsoft.ro/platform-controllers/pkg/apis/provisioning/v1alpha1" 30 | ) 31 | 32 | var scheme = runtime.NewScheme() 33 | var codecs = serializer.NewCodecFactory(scheme) 34 | 35 | var localSchemeBuilder = runtime.SchemeBuilder{ 36 | configurationv1alpha1.AddToScheme, 37 | platformv1alpha1.AddToScheme, 38 | provisioningv1alpha1.AddToScheme, 39 | } 40 | 41 | // AddToScheme adds all types of this clientset into the given scheme. This allows composition 42 | // of clientsets, like in: 43 | // 44 | // import ( 45 | // "k8s.io/client-go/kubernetes" 46 | // clientsetscheme "k8s.io/client-go/kubernetes/scheme" 47 | // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" 48 | // ) 49 | // 50 | // kclientset, _ := kubernetes.NewForConfig(c) 51 | // _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) 52 | // 53 | // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types 54 | // correctly. 55 | var AddToScheme = localSchemeBuilder.AddToScheme 56 | 57 | func init() { 58 | v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) 59 | utilruntime.Must(AddToScheme(scheme)) 60 | } 61 | -------------------------------------------------------------------------------- /pkg/generated/clientset/versioned/scheme/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // This package contains the scheme of the automatically generated clientset. 20 | package scheme 21 | -------------------------------------------------------------------------------- /pkg/generated/clientset/versioned/scheme/register.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | package scheme 20 | 21 | import ( 22 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 23 | runtime "k8s.io/apimachinery/pkg/runtime" 24 | schema "k8s.io/apimachinery/pkg/runtime/schema" 25 | serializer "k8s.io/apimachinery/pkg/runtime/serializer" 26 | utilruntime "k8s.io/apimachinery/pkg/util/runtime" 27 | configurationv1alpha1 "totalsoft.ro/platform-controllers/pkg/apis/configuration/v1alpha1" 28 | platformv1alpha1 "totalsoft.ro/platform-controllers/pkg/apis/platform/v1alpha1" 29 | provisioningv1alpha1 "totalsoft.ro/platform-controllers/pkg/apis/provisioning/v1alpha1" 30 | ) 31 | 32 | var Scheme = runtime.NewScheme() 33 | var Codecs = serializer.NewCodecFactory(Scheme) 34 | var ParameterCodec = runtime.NewParameterCodec(Scheme) 35 | var localSchemeBuilder = runtime.SchemeBuilder{ 36 | configurationv1alpha1.AddToScheme, 37 | platformv1alpha1.AddToScheme, 38 | provisioningv1alpha1.AddToScheme, 39 | } 40 | 41 | // AddToScheme adds all types of this clientset into the given scheme. This allows composition 42 | // of clientsets, like in: 43 | // 44 | // import ( 45 | // "k8s.io/client-go/kubernetes" 46 | // clientsetscheme "k8s.io/client-go/kubernetes/scheme" 47 | // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" 48 | // ) 49 | // 50 | // kclientset, _ := kubernetes.NewForConfig(c) 51 | // _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) 52 | // 53 | // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types 54 | // correctly. 55 | var AddToScheme = localSchemeBuilder.AddToScheme 56 | 57 | func init() { 58 | v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) 59 | utilruntime.Must(AddToScheme(Scheme)) 60 | } 61 | -------------------------------------------------------------------------------- /pkg/generated/clientset/versioned/typed/configuration/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // This package has the automatically generated typed clients. 20 | package v1alpha1 21 | -------------------------------------------------------------------------------- /pkg/generated/clientset/versioned/typed/configuration/v1alpha1/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // Package fake has the automatically generated clients. 20 | package fake 21 | -------------------------------------------------------------------------------- /pkg/generated/clientset/versioned/typed/configuration/v1alpha1/fake/fake_configuration_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | package fake 20 | 21 | import ( 22 | rest "k8s.io/client-go/rest" 23 | testing "k8s.io/client-go/testing" 24 | v1alpha1 "totalsoft.ro/platform-controllers/pkg/generated/clientset/versioned/typed/configuration/v1alpha1" 25 | ) 26 | 27 | type FakeConfigurationV1alpha1 struct { 28 | *testing.Fake 29 | } 30 | 31 | func (c *FakeConfigurationV1alpha1) ConfigurationDomains(namespace string) v1alpha1.ConfigurationDomainInterface { 32 | return &FakeConfigurationDomains{c, namespace} 33 | } 34 | 35 | // RESTClient returns a RESTClient that is used to communicate 36 | // with API server by this client implementation. 37 | func (c *FakeConfigurationV1alpha1) RESTClient() rest.Interface { 38 | var ret *rest.RESTClient 39 | return ret 40 | } 41 | -------------------------------------------------------------------------------- /pkg/generated/clientset/versioned/typed/configuration/v1alpha1/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | type ConfigurationDomainExpansion interface{} 22 | -------------------------------------------------------------------------------- /pkg/generated/clientset/versioned/typed/platform/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // This package has the automatically generated typed clients. 20 | package v1alpha1 21 | -------------------------------------------------------------------------------- /pkg/generated/clientset/versioned/typed/platform/v1alpha1/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // Package fake has the automatically generated clients. 20 | package fake 21 | -------------------------------------------------------------------------------- /pkg/generated/clientset/versioned/typed/platform/v1alpha1/fake/fake_platform_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | package fake 20 | 21 | import ( 22 | rest "k8s.io/client-go/rest" 23 | testing "k8s.io/client-go/testing" 24 | v1alpha1 "totalsoft.ro/platform-controllers/pkg/generated/clientset/versioned/typed/platform/v1alpha1" 25 | ) 26 | 27 | type FakePlatformV1alpha1 struct { 28 | *testing.Fake 29 | } 30 | 31 | func (c *FakePlatformV1alpha1) Domains(namespace string) v1alpha1.DomainInterface { 32 | return &FakeDomains{c, namespace} 33 | } 34 | 35 | func (c *FakePlatformV1alpha1) Platforms() v1alpha1.PlatformInterface { 36 | return &FakePlatforms{c} 37 | } 38 | 39 | func (c *FakePlatformV1alpha1) Services(namespace string) v1alpha1.ServiceInterface { 40 | return &FakeServices{c, namespace} 41 | } 42 | 43 | func (c *FakePlatformV1alpha1) Tenants(namespace string) v1alpha1.TenantInterface { 44 | return &FakeTenants{c, namespace} 45 | } 46 | 47 | // RESTClient returns a RESTClient that is used to communicate 48 | // with API server by this client implementation. 49 | func (c *FakePlatformV1alpha1) RESTClient() rest.Interface { 50 | var ret *rest.RESTClient 51 | return ret 52 | } 53 | -------------------------------------------------------------------------------- /pkg/generated/clientset/versioned/typed/platform/v1alpha1/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | type DomainExpansion interface{} 22 | 23 | type PlatformExpansion interface{} 24 | 25 | type ServiceExpansion interface{} 26 | 27 | type TenantExpansion interface{} 28 | -------------------------------------------------------------------------------- /pkg/generated/clientset/versioned/typed/provisioning/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // This package has the automatically generated typed clients. 20 | package v1alpha1 21 | -------------------------------------------------------------------------------- /pkg/generated/clientset/versioned/typed/provisioning/v1alpha1/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | // Package fake has the automatically generated clients. 20 | package fake 21 | -------------------------------------------------------------------------------- /pkg/generated/clientset/versioned/typed/provisioning/v1alpha1/fake/fake_provisioning_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | package fake 20 | 21 | import ( 22 | rest "k8s.io/client-go/rest" 23 | testing "k8s.io/client-go/testing" 24 | v1alpha1 "totalsoft.ro/platform-controllers/pkg/generated/clientset/versioned/typed/provisioning/v1alpha1" 25 | ) 26 | 27 | type FakeProvisioningV1alpha1 struct { 28 | *testing.Fake 29 | } 30 | 31 | func (c *FakeProvisioningV1alpha1) AzureDatabases(namespace string) v1alpha1.AzureDatabaseInterface { 32 | return &FakeAzureDatabases{c, namespace} 33 | } 34 | 35 | func (c *FakeProvisioningV1alpha1) AzureManagedDatabases(namespace string) v1alpha1.AzureManagedDatabaseInterface { 36 | return &FakeAzureManagedDatabases{c, namespace} 37 | } 38 | 39 | func (c *FakeProvisioningV1alpha1) AzurePowerShellScripts(namespace string) v1alpha1.AzurePowerShellScriptInterface { 40 | return &FakeAzurePowerShellScripts{c, namespace} 41 | } 42 | 43 | func (c *FakeProvisioningV1alpha1) AzureVirtualDesktops(namespace string) v1alpha1.AzureVirtualDesktopInterface { 44 | return &FakeAzureVirtualDesktops{c, namespace} 45 | } 46 | 47 | func (c *FakeProvisioningV1alpha1) AzureVirtualMachines(namespace string) v1alpha1.AzureVirtualMachineInterface { 48 | return &FakeAzureVirtualMachines{c, namespace} 49 | } 50 | 51 | func (c *FakeProvisioningV1alpha1) EntraUsers(namespace string) v1alpha1.EntraUserInterface { 52 | return &FakeEntraUsers{c, namespace} 53 | } 54 | 55 | func (c *FakeProvisioningV1alpha1) HelmReleases(namespace string) v1alpha1.HelmReleaseInterface { 56 | return &FakeHelmReleases{c, namespace} 57 | } 58 | 59 | func (c *FakeProvisioningV1alpha1) LocalScripts(namespace string) v1alpha1.LocalScriptInterface { 60 | return &FakeLocalScripts{c, namespace} 61 | } 62 | 63 | func (c *FakeProvisioningV1alpha1) MinioBuckets(namespace string) v1alpha1.MinioBucketInterface { 64 | return &FakeMinioBuckets{c, namespace} 65 | } 66 | 67 | func (c *FakeProvisioningV1alpha1) MsSqlDatabases(namespace string) v1alpha1.MsSqlDatabaseInterface { 68 | return &FakeMsSqlDatabases{c, namespace} 69 | } 70 | 71 | // RESTClient returns a RESTClient that is used to communicate 72 | // with API server by this client implementation. 73 | func (c *FakeProvisioningV1alpha1) RESTClient() rest.Interface { 74 | var ret *rest.RESTClient 75 | return ret 76 | } 77 | -------------------------------------------------------------------------------- /pkg/generated/clientset/versioned/typed/provisioning/v1alpha1/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by client-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | type AzureDatabaseExpansion interface{} 22 | 23 | type AzureManagedDatabaseExpansion interface{} 24 | 25 | type AzurePowerShellScriptExpansion interface{} 26 | 27 | type AzureVirtualDesktopExpansion interface{} 28 | 29 | type AzureVirtualMachineExpansion interface{} 30 | 31 | type EntraUserExpansion interface{} 32 | 33 | type HelmReleaseExpansion interface{} 34 | 35 | type LocalScriptExpansion interface{} 36 | 37 | type MinioBucketExpansion interface{} 38 | 39 | type MsSqlDatabaseExpansion interface{} 40 | -------------------------------------------------------------------------------- /pkg/generated/informers/externalversions/configuration/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by informer-gen. DO NOT EDIT. 18 | 19 | package configuration 20 | 21 | import ( 22 | v1alpha1 "totalsoft.ro/platform-controllers/pkg/generated/informers/externalversions/configuration/v1alpha1" 23 | internalinterfaces "totalsoft.ro/platform-controllers/pkg/generated/informers/externalversions/internalinterfaces" 24 | ) 25 | 26 | // Interface provides access to each of this group's versions. 27 | type Interface interface { 28 | // V1alpha1 provides access to shared informers for resources in V1alpha1. 29 | V1alpha1() v1alpha1.Interface 30 | } 31 | 32 | type group struct { 33 | factory internalinterfaces.SharedInformerFactory 34 | namespace string 35 | tweakListOptions internalinterfaces.TweakListOptionsFunc 36 | } 37 | 38 | // New returns a new Interface. 39 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 40 | return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 41 | } 42 | 43 | // V1alpha1 returns a new v1alpha1.Interface. 44 | func (g *group) V1alpha1() v1alpha1.Interface { 45 | return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) 46 | } 47 | -------------------------------------------------------------------------------- /pkg/generated/informers/externalversions/configuration/v1alpha1/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by informer-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | import ( 22 | internalinterfaces "totalsoft.ro/platform-controllers/pkg/generated/informers/externalversions/internalinterfaces" 23 | ) 24 | 25 | // Interface provides access to all the informers in this group version. 26 | type Interface interface { 27 | // ConfigurationDomains returns a ConfigurationDomainInformer. 28 | ConfigurationDomains() ConfigurationDomainInformer 29 | } 30 | 31 | type version struct { 32 | factory internalinterfaces.SharedInformerFactory 33 | namespace string 34 | tweakListOptions internalinterfaces.TweakListOptionsFunc 35 | } 36 | 37 | // New returns a new Interface. 38 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 39 | return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 40 | } 41 | 42 | // ConfigurationDomains returns a ConfigurationDomainInformer. 43 | func (v *version) ConfigurationDomains() ConfigurationDomainInformer { 44 | return &configurationDomainInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 45 | } 46 | -------------------------------------------------------------------------------- /pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by informer-gen. DO NOT EDIT. 18 | 19 | package internalinterfaces 20 | 21 | import ( 22 | time "time" 23 | 24 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 25 | runtime "k8s.io/apimachinery/pkg/runtime" 26 | cache "k8s.io/client-go/tools/cache" 27 | versioned "totalsoft.ro/platform-controllers/pkg/generated/clientset/versioned" 28 | ) 29 | 30 | // NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. 31 | type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer 32 | 33 | // SharedInformerFactory a small interface to allow for adding an informer without an import cycle 34 | type SharedInformerFactory interface { 35 | Start(stopCh <-chan struct{}) 36 | InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer 37 | } 38 | 39 | // TweakListOptionsFunc is a function that transforms a v1.ListOptions. 40 | type TweakListOptionsFunc func(*v1.ListOptions) 41 | -------------------------------------------------------------------------------- /pkg/generated/informers/externalversions/platform/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by informer-gen. DO NOT EDIT. 18 | 19 | package platform 20 | 21 | import ( 22 | internalinterfaces "totalsoft.ro/platform-controllers/pkg/generated/informers/externalversions/internalinterfaces" 23 | v1alpha1 "totalsoft.ro/platform-controllers/pkg/generated/informers/externalversions/platform/v1alpha1" 24 | ) 25 | 26 | // Interface provides access to each of this group's versions. 27 | type Interface interface { 28 | // V1alpha1 provides access to shared informers for resources in V1alpha1. 29 | V1alpha1() v1alpha1.Interface 30 | } 31 | 32 | type group struct { 33 | factory internalinterfaces.SharedInformerFactory 34 | namespace string 35 | tweakListOptions internalinterfaces.TweakListOptionsFunc 36 | } 37 | 38 | // New returns a new Interface. 39 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 40 | return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 41 | } 42 | 43 | // V1alpha1 returns a new v1alpha1.Interface. 44 | func (g *group) V1alpha1() v1alpha1.Interface { 45 | return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) 46 | } 47 | -------------------------------------------------------------------------------- /pkg/generated/informers/externalversions/platform/v1alpha1/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by informer-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | import ( 22 | internalinterfaces "totalsoft.ro/platform-controllers/pkg/generated/informers/externalversions/internalinterfaces" 23 | ) 24 | 25 | // Interface provides access to all the informers in this group version. 26 | type Interface interface { 27 | // Domains returns a DomainInformer. 28 | Domains() DomainInformer 29 | // Platforms returns a PlatformInformer. 30 | Platforms() PlatformInformer 31 | // Services returns a ServiceInformer. 32 | Services() ServiceInformer 33 | // Tenants returns a TenantInformer. 34 | Tenants() TenantInformer 35 | } 36 | 37 | type version struct { 38 | factory internalinterfaces.SharedInformerFactory 39 | namespace string 40 | tweakListOptions internalinterfaces.TweakListOptionsFunc 41 | } 42 | 43 | // New returns a new Interface. 44 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 45 | return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 46 | } 47 | 48 | // Domains returns a DomainInformer. 49 | func (v *version) Domains() DomainInformer { 50 | return &domainInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 51 | } 52 | 53 | // Platforms returns a PlatformInformer. 54 | func (v *version) Platforms() PlatformInformer { 55 | return &platformInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} 56 | } 57 | 58 | // Services returns a ServiceInformer. 59 | func (v *version) Services() ServiceInformer { 60 | return &serviceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 61 | } 62 | 63 | // Tenants returns a TenantInformer. 64 | func (v *version) Tenants() TenantInformer { 65 | return &tenantInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 66 | } 67 | -------------------------------------------------------------------------------- /pkg/generated/informers/externalversions/provisioning/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by informer-gen. DO NOT EDIT. 18 | 19 | package provisioning 20 | 21 | import ( 22 | internalinterfaces "totalsoft.ro/platform-controllers/pkg/generated/informers/externalversions/internalinterfaces" 23 | v1alpha1 "totalsoft.ro/platform-controllers/pkg/generated/informers/externalversions/provisioning/v1alpha1" 24 | ) 25 | 26 | // Interface provides access to each of this group's versions. 27 | type Interface interface { 28 | // V1alpha1 provides access to shared informers for resources in V1alpha1. 29 | V1alpha1() v1alpha1.Interface 30 | } 31 | 32 | type group struct { 33 | factory internalinterfaces.SharedInformerFactory 34 | namespace string 35 | tweakListOptions internalinterfaces.TweakListOptionsFunc 36 | } 37 | 38 | // New returns a new Interface. 39 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 40 | return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 41 | } 42 | 43 | // V1alpha1 returns a new v1alpha1.Interface. 44 | func (g *group) V1alpha1() v1alpha1.Interface { 45 | return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) 46 | } 47 | -------------------------------------------------------------------------------- /pkg/generated/listers/configuration/v1alpha1/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by lister-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // ConfigurationDomainListerExpansion allows custom methods to be added to 22 | // ConfigurationDomainLister. 23 | type ConfigurationDomainListerExpansion interface{} 24 | 25 | // ConfigurationDomainNamespaceListerExpansion allows custom methods to be added to 26 | // ConfigurationDomainNamespaceLister. 27 | type ConfigurationDomainNamespaceListerExpansion interface{} 28 | -------------------------------------------------------------------------------- /pkg/generated/listers/platform/v1alpha1/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by lister-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | // DomainListerExpansion allows custom methods to be added to 22 | // DomainLister. 23 | type DomainListerExpansion interface{} 24 | 25 | // DomainNamespaceListerExpansion allows custom methods to be added to 26 | // DomainNamespaceLister. 27 | type DomainNamespaceListerExpansion interface{} 28 | 29 | // PlatformListerExpansion allows custom methods to be added to 30 | // PlatformLister. 31 | type PlatformListerExpansion interface{} 32 | 33 | // ServiceListerExpansion allows custom methods to be added to 34 | // ServiceLister. 35 | type ServiceListerExpansion interface{} 36 | 37 | // ServiceNamespaceListerExpansion allows custom methods to be added to 38 | // ServiceNamespaceLister. 39 | type ServiceNamespaceListerExpansion interface{} 40 | 41 | // TenantListerExpansion allows custom methods to be added to 42 | // TenantLister. 43 | type TenantListerExpansion interface{} 44 | 45 | // TenantNamespaceListerExpansion allows custom methods to be added to 46 | // TenantNamespaceLister. 47 | type TenantNamespaceListerExpansion interface{} 48 | -------------------------------------------------------------------------------- /pkg/generated/listers/platform/v1alpha1/platform.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Code generated by lister-gen. DO NOT EDIT. 18 | 19 | package v1alpha1 20 | 21 | import ( 22 | "k8s.io/apimachinery/pkg/api/errors" 23 | "k8s.io/apimachinery/pkg/labels" 24 | "k8s.io/client-go/tools/cache" 25 | v1alpha1 "totalsoft.ro/platform-controllers/pkg/apis/platform/v1alpha1" 26 | ) 27 | 28 | // PlatformLister helps list Platforms. 29 | // All objects returned here must be treated as read-only. 30 | type PlatformLister interface { 31 | // List lists all Platforms in the indexer. 32 | // Objects returned here must be treated as read-only. 33 | List(selector labels.Selector) (ret []*v1alpha1.Platform, err error) 34 | // Get retrieves the Platform from the index for a given name. 35 | // Objects returned here must be treated as read-only. 36 | Get(name string) (*v1alpha1.Platform, error) 37 | PlatformListerExpansion 38 | } 39 | 40 | // platformLister implements the PlatformLister interface. 41 | type platformLister struct { 42 | indexer cache.Indexer 43 | } 44 | 45 | // NewPlatformLister returns a new PlatformLister. 46 | func NewPlatformLister(indexer cache.Indexer) PlatformLister { 47 | return &platformLister{indexer: indexer} 48 | } 49 | 50 | // List lists all Platforms in the indexer. 51 | func (s *platformLister) List(selector labels.Selector) (ret []*v1alpha1.Platform, err error) { 52 | err = cache.ListAll(s.indexer, selector, func(m interface{}) { 53 | ret = append(ret, m.(*v1alpha1.Platform)) 54 | }) 55 | return ret, err 56 | } 57 | 58 | // Get retrieves the Platform from the index for a given name. 59 | func (s *platformLister) Get(name string) (*v1alpha1.Platform, error) { 60 | obj, exists, err := s.indexer.GetByKey(name) 61 | if err != nil { 62 | return nil, err 63 | } 64 | if !exists { 65 | return nil, errors.NewNotFound(v1alpha1.Resource("platform"), name) 66 | } 67 | return obj.(*v1alpha1.Platform), nil 68 | } 69 | -------------------------------------------------------------------------------- /pkg/signals/signal.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2017 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package signals 18 | 19 | import ( 20 | "os" 21 | "os/signal" 22 | ) 23 | 24 | var onlyOneSignalHandler = make(chan struct{}) 25 | 26 | // SetupSignalHandler registered for SIGTERM and SIGINT. A stop channel is returned 27 | // which is closed on one of these signals. If a second signal is caught, the program 28 | // is terminated with exit code 1. 29 | func SetupSignalHandler() (stopCh <-chan struct{}) { 30 | close(onlyOneSignalHandler) // panics when called twice 31 | 32 | stop := make(chan struct{}) 33 | c := make(chan os.Signal, 2) 34 | signal.Notify(c, shutdownSignals...) 35 | go func() { 36 | <-c 37 | close(stop) 38 | <-c 39 | os.Exit(1) // second signal. Exit directly. 40 | }() 41 | 42 | return stop 43 | } 44 | -------------------------------------------------------------------------------- /pkg/signals/signal_posix.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | // +build !windows 3 | 4 | /* 5 | Copyright 2017 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package signals 21 | 22 | import ( 23 | "os" 24 | "syscall" 25 | ) 26 | 27 | var shutdownSignals = []os.Signal{os.Interrupt, syscall.SIGTERM} 28 | -------------------------------------------------------------------------------- /pkg/signals/signal_windows.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2017 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package signals 18 | 19 | import ( 20 | "os" 21 | ) 22 | 23 | var shutdownSignals = []os.Signal{os.Interrupt} 24 | --------------------------------------------------------------------------------