From 66e5c2231f111118f617077bb142b4cba4da532a Mon Sep 17 00:00:00 2001 From: nshekhar Date: Thu, 24 Oct 2024 14:12:47 +0530 Subject: [PATCH] Add support for diagnosticSettings --- Taskfile.yml | 240 +++++++++--------- ...pi20201101_loadbalancer_20220301_vmss.yaml | 28 ++ ...201101_networkinterface_vmss_20220301.yaml | 17 ++ ...0201101_publicipaddress_20220301_vmss.yaml | 12 + ...20201101_virtualnetwork_vmss_20220301.yaml | 12 + ...1_virtualnetworkssubnet_vmss_20220301.yaml | 9 + .../refs/v1api20210401_storageaccount.yaml | 14 + .../v1api/refs/v1api20210601_workspace.yaml | 11 + .../v1api20220301_virtualmachinescaleset.yaml | 51 ++++ 9 files changed, 274 insertions(+), 120 deletions(-) create mode 100644 v2/samples/insights/v1api/refs/v1api20201101_loadbalancer_20220301_vmss.yaml create mode 100644 v2/samples/insights/v1api/refs/v1api20201101_networkinterface_vmss_20220301.yaml create mode 100644 v2/samples/insights/v1api/refs/v1api20201101_publicipaddress_20220301_vmss.yaml create mode 100644 v2/samples/insights/v1api/refs/v1api20201101_virtualnetwork_vmss_20220301.yaml create mode 100644 v2/samples/insights/v1api/refs/v1api20201101_virtualnetworkssubnet_vmss_20220301.yaml create mode 100644 v2/samples/insights/v1api/refs/v1api20210401_storageaccount.yaml create mode 100644 v2/samples/insights/v1api/refs/v1api20210601_workspace.yaml create mode 100644 v2/samples/insights/v1api/refs/v1api20220301_virtualmachinescaleset.yaml diff --git a/Taskfile.yml b/Taskfile.yml index fb89963bba8..359e776dc85 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -1,4 +1,4 @@ -version: "3.7" +version: '3.7' run: when_changed output: prefixed @@ -15,18 +15,18 @@ vars: CONTROLLER_APP: aso-controller CONTROLLER_ROOT: v2/ CONTROLLER_OUTPUT: - sh: "realpath v2/config" + sh: 'realpath v2/config' TEST_RESOURCE_PREFIX: asotest TEST_LIVE_RESOURCE_PREFIX: asolivetest SCRIPTS_ROOT: - sh: "realpath scripts/v2" + sh: 'realpath scripts/v2' HEADER_FILE: - sh: "realpath v2/boilerplate.go.txt" + sh: 'realpath v2/boilerplate.go.txt' TEST_OUT: - sh: "realpath reports" + sh: 'realpath reports' VERSION: # Version tags for the v2 controller must start with "v2", e.g. "v2.0.0-alpha.0". @@ -45,7 +45,7 @@ vars: CROSSPLANE_APP: crossplane-gen CROSSPLANE_ROOT: ./hack/crossplane/ CROSSPLANE_OUTPUT: - sh: "realpath hack/crossplane/config" + sh: 'realpath hack/crossplane/config' # how long to let tests against live resources run for LIVE_TEST_TIMEOUT: 3h @@ -102,7 +102,7 @@ tasks: - task: doc:build-site basic-checks: - deps: + deps: - header-check - specifier-check @@ -135,7 +135,7 @@ tasks: asoctl:unit-tests: desc: Run {{.ASOCTL_APP}} unit tests. - dir: "{{.ASOCTL_ROOT}}" + dir: '{{.ASOCTL_ROOT}}' deps: - controller:generate-crds cmds: @@ -143,26 +143,26 @@ tasks: asoctl:unit-tests-cover: desc: Run {{.ASOCTL_APP}} unit tests and output coverage. - dir: "{{.ASOCTL_ROOT}}" + dir: '{{.ASOCTL_ROOT}}' deps: - controller:generate-crds cmds: - defer: # want to run even on failure task: produce-markdown-summary vars: - INPUT_FILE: "{{.TEST_OUT}}/asoctl-unit-tests.json" - OUTPUT_FILE: "{{.TEST_OUT}}/asoctl-unit-tests.md" + INPUT_FILE: '{{.TEST_OUT}}/asoctl-unit-tests.json' + OUTPUT_FILE: '{{.TEST_OUT}}/asoctl-unit-tests.md' - go test ./... -tags=noexit -race -covermode atomic -coverprofile=asoctl-coverage.out -json -coverpkg=./... -run '{{default ".*" .TEST_FILTER}}' > '{{.TEST_OUT}}/asoctl-unit-tests.json' asoctl:lint: desc: Run {{.ASOCTL_APP}} fast lint checks. - dir: "{{.ASOCTL_ROOT}}" + dir: '{{.ASOCTL_ROOT}}' cmds: - golangci-lint run --verbose --fast=false --timeout 5m ./... asoctl:build: desc: Generate the {{.ASOCTL_APP}} binary. - dir: "{{.ASOCTL_ROOT}}" + dir: '{{.ASOCTL_ROOT}}' label: asoctl:build-{{.GOOS}}-{{.GOARCH}} generates: - "{{.ARCHIVE}}" @@ -172,10 +172,10 @@ tasks: - if [ "{{.ARCHIVETYPE}}" = ".zip" ]; then zip -j -r {{.ARCHIVE}} {{.EXECUTABLE}}; fi - if [ "{{.ARCHIVETYPE}}" = ".gz" ]; then gzip -v -c {{.EXECUTABLE}} > {{.ARCHIVE}} ; fi vars: - GOOS: "{{default OS .GOOS}}" + GOOS: '{{default OS .GOOS}}' EXT: '{{if eq .GOOS "windows"}}.exe{{else}}{{end}}' ARCHIVETYPE: '{{if eq .GOOS "windows"}}.zip{{else}}.gz{{end}}' - GOARCH: "{{default ARCH .GOARCH}}" + GOARCH: '{{default ARCH .GOARCH}}' EXECUTABLE: ./bin/{{.GOOS}}-{{.GOARCH}}/{{.ASOCTL_APP}}{{.EXT}} ARCHIVE: ../../bin/{{.ASOCTL_APP}}-{{.GOOS}}-{{.GOARCH}}{{.ARCHIVETYPE}} @@ -183,21 +183,21 @@ tasks: desc: Produce asoctl files required for an ASOv2 release dir: "{{.CONTROLLER_ROOT}}" deps: - # Regenerating the deepcopy files deletes and regenerates them, - # so we have to ensure this runs before we do any asoctl builds + # Regenerating the deepcopy files deletes and regenerates them, + # so we have to ensure this runs before we do any asoctl builds - controller:run-kustomize cmds: - task: asoctl:build - vars: { GOOS: "linux", GOARCH: "amd64" } + vars: {GOOS: "linux", GOARCH: "amd64"} - task: asoctl:build - vars: { GOOS: "linux", GOARCH: "arm64" } + vars: {GOOS: "linux", GOARCH: "arm64"} - task: asoctl:build - vars: { GOOS: "darwin", GOARCH: "amd64" } + vars: {GOOS: "darwin", GOARCH: "amd64"} - task: asoctl:build - vars: { GOOS: "darwin", GOARCH: "arm64" } + vars: {GOOS: "darwin", GOARCH: "arm64"} - task: asoctl:build - vars: { GOOS: "windows", GOARCH: "amd64" } - + vars: {GOOS: "windows", GOARCH: "amd64"} + ############### Generator targets ############### generator:quick-checks: @@ -214,36 +214,36 @@ tasks: generator:unit-tests: desc: Run {{.GENERATOR_APP}} unit tests. - dir: "{{.GENERATOR_ROOT}}" + dir: '{{.GENERATOR_ROOT}}' cmds: - go test ./... -tags=noexit -run '{{default ".*" .TEST_FILTER}}' generator:unit-tests-cover: desc: Run {{.GENERATOR_APP}} unit tests and output coverage. - dir: "{{.GENERATOR_ROOT}}" + dir: '{{.GENERATOR_ROOT}}' cmds: - defer: # want to run even on failure task: produce-markdown-summary vars: - INPUT_FILE: "{{.TEST_OUT}}/generator-unit-tests.json" - OUTPUT_FILE: "{{.TEST_OUT}}/generator-unit-tests.md" + INPUT_FILE: '{{.TEST_OUT}}/generator-unit-tests.json' + OUTPUT_FILE: '{{.TEST_OUT}}/generator-unit-tests.md' - go test ./... -tags=noexit -race -covermode atomic -coverprofile=generator-coverage.out -json -coverpkg=./... -run '{{default ".*" .TEST_FILTER}}' > '{{.TEST_OUT}}/generator-unit-tests.json' generator:update-golden-tests: desc: Update {{.GENERATOR_APP}} golden test outputs. - dir: "{{.GENERATOR_ROOT}}" + dir: '{{.GENERATOR_ROOT}}' cmds: - go test ./... -run ^TestGolden -update generator:lint: desc: Run {{.GENERATOR_APP}} fast lint checks. - dir: "{{.GENERATOR_ROOT}}" + dir: '{{.GENERATOR_ROOT}}' cmds: - golangci-lint run --verbose --fast=false generator:build: desc: Generate the {{.GENERATOR_APP}} binary. - dir: "{{.GENERATOR_ROOT}}" + dir: '{{.GENERATOR_ROOT}}' cmds: - go build {{.LDFLAGS}} -o ../../bin/{{.GENERATOR_APP}} . @@ -277,7 +277,7 @@ tasks: - task: cleanup-old-live-azure-resources - task: controller:test-integration-kind-ci - task: controller:test-multitenant-integration-kind-ci - - task: cleanup-old-live-azure-resources # Run this on both sides of the test pass to do our best to avoid leaking something + - task: cleanup-old-live-azure-resources # Run this on both sides of the test pass to do our best to avoid leaking something controller:ci-live: cmds: @@ -287,7 +287,7 @@ tasks: controller:lint: desc: Run fast lint checks. - deps: + deps: - controller:generate-crds dir: "{{.CONTROLLER_ROOT}}" cmds: @@ -296,7 +296,7 @@ tasks: controller:verify-samples: desc: Verify that a sample exists for each supported resource - deps: + deps: - controller:generate-crds cmds: - "{{.SCRIPTS_ROOT}}/check_samples.py v2/" @@ -317,14 +317,14 @@ tasks: desc: Run {{.CONTROLLER_APP}} unit tests and output coverage. dir: "{{.CONTROLLER_ROOT}}" deps: - - controller:generate-crds - - controller:bundle-crds # bundle-crds is here because some tests assert on generated CRD shape + - controller:generate-crds + - controller:bundle-crds # bundle-crds is here because some tests assert on generated CRD shape cmds: - defer: # want to run even on failure task: produce-markdown-summary vars: - INPUT_FILE: "{{.TEST_OUT}}/controller-unit-tests.json" - OUTPUT_FILE: "{{.TEST_OUT}}/controller-unit-tests.md" + INPUT_FILE: '{{.TEST_OUT}}/controller-unit-tests.json' + OUTPUT_FILE: '{{.TEST_OUT}}/controller-unit-tests.md' # -race fails at the moment in gopter - possibly due to our shared generator variable? - go test -short -tags=noexit -timeout 10m -covermode atomic -coverprofile=controller-coverage.out -json -coverpkg="./..." -run '{{default ".*" .TEST_FILTER}}' ./... > '{{.TEST_OUT}}/controller-unit-tests.json' @@ -404,7 +404,7 @@ tasks: controller:build: desc: Generate the {{.CONTROLLER_APP}} binary. dir: "{{.CONTROLLER_ROOT}}" - deps: + deps: - controller:generate-crds sources: - "go.mod" @@ -438,7 +438,7 @@ tasks: controller:docker-push-local: desc: Pushes the controller container image to a local registry - deps: + deps: - controller:bundle-crds dir: "{{.CONTROLLER_ROOT}}" run: always @@ -469,10 +469,10 @@ tasks: cmds: - 'if [ -z "{{.DOCKER_PUSH_TARGET}}" ]; then echo "Error: DOCKER_PUSH_TARGET must be set"; exit 1; fi' - docker buildx create --use - - docker buildx build --push + - docker buildx build --push --build-arg VERSION_FLAGS={{.VERSION_FLAGS}} --build-arg CONTROLLER_APP={{.CONTROLLER_APP}} - --platform {{.PLATFORMS}} + --platform {{.PLATFORMS}} --tag "{{.DOCKER_PUSH_TARGET}}/{{.CONTROLLER_DOCKER_IMAGE}}" . vars: PLATFORMS: '{{default "linux/amd64,linux/arm64" .PLATFORMS}}' @@ -507,7 +507,7 @@ tasks: controller:test-integration-envtest: desc: Run integration tests with envtest using record/replay. dir: "{{.CONTROLLER_ROOT}}" - deps: + deps: - controller:run-kustomize-for-envtest cmds: # -race fails at the moment in controller-runtime @@ -524,36 +524,36 @@ tasks: controller:test-integration-envtest-record: desc: Run integration tests with envtest with a longer timeout suitable for recording the tests. dir: "{{.CONTROLLER_ROOT}}" - deps: + deps: - controller:run-kustomize-for-envtest cmds: - - go test -timeout {{.TIMEOUT}} -run '{{default ".*" .TEST_FILTER}}' {{.VERBOSE}} ./internal/controllers -args -live + - go test -timeout {{.TIMEOUT}} -run '{{default ".*" .TEST_FILTER}}' {{.VERBOSE}} ./internal/controllers -args -live vars: VERBOSE: sh: if [ $TEST_FILTER ]; then echo "-v"; fi - TIMEOUT: "{{.LIVE_TEST_TIMEOUT}}" + TIMEOUT: '{{.LIVE_TEST_TIMEOUT}}' controller:test-integration-envtest-cover: desc: Run integration tests with envtest using record/replay and output coverage. dir: "{{.CONTROLLER_ROOT}}" - deps: + deps: - controller:run-kustomize-for-envtest cmds: - defer: # want to run even on failure task: produce-markdown-summary vars: - INPUT_FILE: "{{.TEST_OUT}}/controller-integration-tests.json" - OUTPUT_FILE: "{{.TEST_OUT}}/controller-integration-tests.md" + INPUT_FILE: '{{.TEST_OUT}}/controller-integration-tests.json' + OUTPUT_FILE: '{{.TEST_OUT}}/controller-integration-tests.md' - defer: # want to run even on failure task: produce-markdown-summary vars: - INPUT_FILE: "{{.TEST_OUT}}/controller-integration-genruntime-tests.json" - OUTPUT_FILE: "{{.TEST_OUT}}/controller-integration-genruntime-tests.md" + INPUT_FILE: '{{.TEST_OUT}}/controller-integration-genruntime-tests.json' + OUTPUT_FILE: '{{.TEST_OUT}}/controller-integration-genruntime-tests.md' - defer: # want to run even on failure task: produce-markdown-summary vars: - INPUT_FILE: "{{.TEST_OUT}}/controller-integration-genericarmclient-tests.json" - OUTPUT_FILE: "{{.TEST_OUT}}/controller-integration-genericarmclient-tests.md" + INPUT_FILE: '{{.TEST_OUT}}/controller-integration-genericarmclient-tests.json' + OUTPUT_FILE: '{{.TEST_OUT}}/controller-integration-genericarmclient-tests.md' # -race fails at the moment in controller-runtime - go test -covermode atomic -coverprofile=coverage-integration-envtest.out -coverpkg="./..." -json -timeout 15m -run '{{default ".*" .TEST_FILTER}}' ./internal/controllers > '{{.TEST_OUT}}/controller-integration-tests.json' - go test -covermode atomic -coverprofile=coverage-integration-genruntime-envtest.out -coverpkg="./..." -json -timeout 15m -run '{{default ".*" .TEST_FILTER}}' ./pkg/genruntime/test > '{{.TEST_OUT}}/controller-integration-genruntime-tests.json' @@ -562,7 +562,7 @@ tasks: controller:test-integration-envtest-live: desc: Run integration tests with envtest against live data and output coverage. dir: "{{.CONTROLLER_ROOT}}" - deps: + deps: - controller:run-kustomize-for-envtest - cleanup-azure-resources cmds: @@ -574,7 +574,7 @@ tasks: controller:test-integration-kind-ci: desc: Run live integration tests in kind and deletes the kind cluster afterwards. dir: "{{.CONTROLLER_ROOT}}" - deps: + deps: - controller:kind-create-helm-workload-identity cmds: # This timeout is purposefully low - if we find that this job is taking a long time we may need to think of other ways @@ -588,7 +588,7 @@ tasks: controller:test-integration-kind: desc: Run live integration tests in kind. dir: "{{.CONTROLLER_ROOT}}" - deps: + deps: - controller:kind-create-helm-workload-identity cmds: # This timeout is purposefully low - if we find that this job is taking a long time we may need to think of other ways @@ -598,8 +598,8 @@ tasks: controller:test-multitenant-integration-kind-ci: desc: Run live multitenant integration tests in kind. dir: "{{.CONTROLLER_ROOT}}" - deps: - - controller:kind-create-multitenant-cluster-helm + deps: + - controller:kind-create-multitenant-cluster-helm cmds: # This timeout is purposefully low - if we find that this job is # taking a long time we may need to think of other ways to keep @@ -614,7 +614,7 @@ tasks: controller:test-multitenant-integration-kind: desc: Run live multitenant integration tests in kind. dir: "{{.CONTROLLER_ROOT}}" - deps: + deps: - controller:kind-create-multitenant-cluster-helm cmds: # This timeout is purposefully low - if we find that this job is @@ -625,7 +625,7 @@ tasks: controller:test-integration-ci: desc: Run integration tests for CI dir: "{{.CONTROLLER_ROOT}}" - deps: + deps: - controller:test-integration-envtest-cover controller:test-integration-ci-live: @@ -637,7 +637,7 @@ tasks: controller:generate-types: desc: Run {{.GENERATOR_APP}} to generate input files for controller-gen for {{.CONTROLLER_APP}}. dir: v2 - deps: + deps: - generator:build sources: - ./bin/{{.GENERATOR_APP}} @@ -648,7 +648,7 @@ tasks: controller:generate-crds: desc: Run controller-gen to generate {{.CONTROLLER_APP}} CRD files. - deps: + deps: - controller:generate-types - controller:generate-genruntime-deepcopy sources: @@ -676,13 +676,13 @@ tasks: cmds: - find ./pkg/genruntime -type f -name "zz_generated.*" -delete - cd pkg/genruntime && controller-gen {{.OBJECT_OPTIONS}} paths=./... - - cd pkg/genruntime && gofmt -l -s -w . # We do this because controller-gen can generate these files in a way that isn't gofmt'ed which can break things down the line + - cd pkg/genruntime && gofmt -l -s -w . # We do this because controller-gen can generate these files in a way that isn't gofmt'ed which can break things down the line vars: OBJECT_OPTIONS: object:headerFile={{.HEADER_FILE}} controller:generate-kustomize: desc: Run {{.GENERATOR_APP}} to generate the Kustomize file for registering CRDs. - deps: + deps: - controller:generate-crds dir: v2 sources: @@ -696,7 +696,7 @@ tasks: controller:run-kustomize: desc: Generates the CRD & configuration bundle. - deps: + deps: - controller:generate-kustomize dir: "v2/" cmds: @@ -709,7 +709,7 @@ tasks: controller:make-multitenant-files: desc: Splits the deployment yaml into cluster and tenant files for multitenant deployment - deps: + deps: - controller:run-kustomize dir: "v2/bin" cmds: @@ -718,7 +718,7 @@ tasks: controller:run-kustomize-for-envtest: desc: Generates the CRDs for use in envtest - deps: + deps: - controller:generate-kustomize dir: "v2/" sources: @@ -764,12 +764,12 @@ tasks: dir: "{{.CONTROLLER_ROOT}}" cmds: - "helm upgrade --install --set azureSubscriptionID=$AZURE_SUBSCRIPTION_ID \ - --set azureTenantID=$AZURE_TENANT_ID \ - --set azureClientID={{.AZURE_MI_CLIENT_ID}} \ - --set useWorkloadIdentityAuth=true \ - {{.IMAGE_REPOSITORY_CMD}} \ - --set crdPattern=* \ - aso2 -n {{.ASO_NAMESPACE}} --create-namespace ./charts/azure-service-operator/" + --set azureTenantID=$AZURE_TENANT_ID \ + --set azureClientID={{.AZURE_MI_CLIENT_ID}} \ + --set useWorkloadIdentityAuth=true \ + {{.IMAGE_REPOSITORY_CMD}} \ + --set crdPattern=* \ + aso2 -n {{.ASO_NAMESPACE}} --create-namespace ./charts/azure-service-operator/" - task: controller:wait-for-operator-ready vars: IMAGE_REPOSITORY: "{{default .LOCAL_REGISTRY_CONTROLLER_DOCKER_IMAGE .IMAGE_REPOSITORY}}" @@ -781,21 +781,21 @@ tasks: echo "--set image.repository={{.IMAGE_REPOSITORY}}" else echo "" - fi + fi controller:install-helm-single-tenant: desc: Generate and install helm chart on cluster using workload identity dir: "{{.CONTROLLER_ROOT}}" cmds: - - "helm upgrade --install --set azureSubscriptionID=$AZURE_SUBSCRIPTION_ID \ - --set azureTenantID=$AZURE_TENANT_ID \ - --set azureClientID={{.AZURE_MI_CLIENT_ID}} \ - --set image.repository={{.LOCAL_REGISTRY_CONTROLLER_DOCKER_IMAGE}} \ - --set useWorkloadIdentityAuth=true \ - --set multitenant.enable=true \ - --set azureOperatorMode=watchers \ - --set-string azureTargetNamespaces='{t1-items,t1-more}' \ - aso2 -n tenant1-system --create-namespace ./charts/azure-service-operator/" + - "helm upgrade --install --set azureSubscriptionID=$AZURE_SUBSCRIPTION_ID \ + --set azureTenantID=$AZURE_TENANT_ID \ + --set azureClientID={{.AZURE_MI_CLIENT_ID}} \ + --set image.repository={{.LOCAL_REGISTRY_CONTROLLER_DOCKER_IMAGE}} \ + --set useWorkloadIdentityAuth=true \ + --set multitenant.enable=true \ + --set azureOperatorMode=watchers \ + --set-string azureTargetNamespaces='{t1-items,t1-more}' \ + aso2 -n tenant1-system --create-namespace ./charts/azure-service-operator/" vars: IMAGE_REPOSITORY: "{{default .LOCAL_REGISTRY_CONTROLLER_DOCKER_IMAGE .IMAGE_REPOSITORY}}" AZURE_MI_CLIENT_ID: @@ -822,22 +822,22 @@ tasks: cmds: - "export KIND_CLUSTER_NAME=asov2 && {{.SCRIPTS_ROOT}}/kind-with-registry.sh" status: - - 'kind get clusters | grep "^asov2$"' + - "kind get clusters | grep \"^asov2$\"" controller:kind-create-wi: desc: Creates a kind cluster and local Docker registry with OIDC + workload identity enabled. Images in the local registry can be pulled in the kind cluster. run: always - deps: + deps: - az-login cmds: - "rm -rf {{.KIND_WORKLOAD_IDENTITY_PATH}}" - "mkdir -p {{.KIND_WORKLOAD_IDENTITY_PATH}}" - "{{.SCRIPTS_ROOT}}/create-kind-wi-storage.sh -d {{.KIND_WORKLOAD_IDENTITY_PATH}} -p {{.TEST_LIVE_RESOURCE_PREFIX}}" - "export KIND_CLUSTER_NAME=asov2-wi && \ - export SERVICE_ACCOUNT_ISSUER=$(cat {{.KIND_WORKLOAD_IDENTITY_PATH}}/azure/saissuer.txt) && \ - {{.SCRIPTS_ROOT}}/kind-with-registry.sh" + export SERVICE_ACCOUNT_ISSUER=$(cat {{.KIND_WORKLOAD_IDENTITY_PATH}}/azure/saissuer.txt) && \ + {{.SCRIPTS_ROOT}}/kind-with-registry.sh" status: - - 'kind get clusters | grep "^asov2-wi$"' + - "kind get clusters | grep \"^asov2-wi$\"" env: SERVICE_ACCOUNT_KEY_FILE: sh: "echo ${HOSTROOT:-$PWD}/{{.KIND_WORKLOAD_IDENTITY_PATH}}/sa.pub" # Have to use HOSTROOT here for mounting files when in docker-in-docker as paths are relative to host @@ -846,7 +846,7 @@ tasks: controller:create-mi-for-workload-identity: desc: Creates a managed identity and federated identity credential and stores their details in the specified path - deps: + deps: - az-login cmds: - "{{.SCRIPTS_ROOT}}/make-mi-fic.py -g {{.RESOURCE_GROUP}} -i {{.ISSUER}} -s {{.SUBJECT}} -d ./{{.DIR}}" @@ -914,7 +914,7 @@ tasks: controller:scan-image: desc: Builds a local image and scans the image using trivy - deps: + deps: - controller:docker-build cmds: - "trivy image {{.CONTROLLER_DOCKER_IMAGE}}" @@ -922,7 +922,7 @@ tasks: controller:install: desc: Installs the controller, webhooks, and CRDs into the default kubectl cluster - deps: + deps: - controller:generate-kustomize dir: "{{.CONTROLLER_ROOT}}" cmds: @@ -932,7 +932,7 @@ tasks: controller:bundle-crds: desc: Bundles CRDs... - deps: + deps: - controller:generate-kustomize dir: "{{.CONTROLLER_ROOT}}" sources: @@ -967,7 +967,7 @@ tasks: DIR: "{{.DIR | default .KIND_WORKLOAD_IDENTITY_PATH}}" env: # Override the AZURE_CLIENT_ID env variable here - AZURE_MI_CLIENT_ID: # TODO: Ideally would override AZURE_CLIENT_ID here but we can't because of https://github.com/go-task/task/issues/1038 + AZURE_MI_CLIENT_ID: # TODO: Ideally would override AZURE_CLIENT_ID here but we can't because of https://github.com/go-task/task/issues/1038 sh: "cat {{.DIR}}/azure/miclientid.txt" controller:deploy-multitenant-testing-secret: @@ -976,7 +976,7 @@ tasks: - "{{.SCRIPTS_ROOT}}/deploy-multitenant-testing-secret.sh" env: # Override the AZURE_CLIENT_ID env variable here - AZURE_MI_CLIENT_ID: # TODO: Ideally would override AZURE_CLIENT_ID here but we can't because of https://github.com/go-task/task/issues/1038 + AZURE_MI_CLIENT_ID: # TODO: Ideally would override AZURE_CLIENT_ID here but we can't because of https://github.com/go-task/task/issues/1038 sh: "cat {{.KIND_WORKLOAD_IDENTITY_PATH}}/azure/miclientid.txt" controller:wait-for-operator-ready: @@ -1001,7 +1001,7 @@ tasks: # TODO: This currently doesn't work because the installation via raw YAML doesn't pass crdpattern. controller:kind-create-multitenant-cluster: desc: Creates a local kind cluster with ASO installed in multitenant configuration. - deps: + deps: - controller:make-multitenant-files cmds: - task: controller:kind-create-wi @@ -1049,9 +1049,9 @@ tasks: - "cmctl check api --wait=2m" # Install cluster scope chart (mode == webhooks) - "helm upgrade --install --set multitenant.enable=true --set azureOperatorMode=webhooks \ - --set image.repository={{.LOCAL_REGISTRY_CONTROLLER_DOCKER_IMAGE}} \ - --set crdPattern=* \ - aso2 -n {{.NAMESPACE}} --create-namespace ./charts/azure-service-operator/" + --set image.repository={{.LOCAL_REGISTRY_CONTROLLER_DOCKER_IMAGE}} \ + --set crdPattern=* \ + aso2 -n {{.NAMESPACE}} --create-namespace ./charts/azure-service-operator/" - task: controller:wait-for-operator-ready vars: NAMESPACE: "{{.NAMESPACE}}" @@ -1100,18 +1100,18 @@ tasks: cmds: - task: basic-checks - # TODO: We currently have no tests - # crossplane:test: - # desc: Run {{.CROSSPLANE_APP}} unit tests. - # dir: "{{.CROSSPLANE_ROOT}}" - # cmds: - # - go test ./... -tags=noexit -timeout 10m +# TODO: We currently have no tests +# crossplane:test: +# desc: Run {{.CROSSPLANE_APP}} unit tests. +# dir: "{{.CROSSPLANE_ROOT}}" +# cmds: +# - go test ./... -tags=noexit -timeout 10m - # crossplane:update-golden-tests: - # desc: Update {{.CROSSPLANE_APP}} golden test outputs. - # dir: "{{.CROSSPLANE_ROOT}}" - # cmds: - # - go test ./pkg/codegen -run ^TestGolden$ -update -timeout 10m +# crossplane:update-golden-tests: +# desc: Update {{.CROSSPLANE_APP}} golden test outputs. +# dir: "{{.CROSSPLANE_ROOT}}" +# cmds: +# - go test ./pkg/codegen -run ^TestGolden$ -update -timeout 10m # TODO: No non-generated code in this directory at the moment # crossplane:lint: @@ -1122,7 +1122,7 @@ tasks: crossplane:generate-crds: desc: Run controller-gen to generate {{.CROSSPLANE_APP}} CRD files. - deps: + deps: - crossplane:generate-types dir: "{{.CROSSPLANE_ROOT}}" sources: @@ -1144,8 +1144,8 @@ tasks: crossplane:generate-types: desc: Run {{.GENERATOR_APP}} to generate input files for controller-gen for {{.CROSSPLANE_APP}}. dir: "{{.CROSSPLANE_ROOT}}" - deps: - - generator:build + deps: + - generator:build sources: - ../../v2/bin/{{.GENERATOR_APP}} - azure-crossplane.yaml @@ -1153,7 +1153,7 @@ tasks: - ../../v2/bin/{{.GENERATOR_APP}} gen-types azure-crossplane.yaml crossplane:ci: - deps: + deps: - basic-checks - crossplane:generate-crds @@ -1179,7 +1179,7 @@ tasks: doc:crd-api: desc: Generates API docs for CRDs - deps: + deps: - controller:generate-crds dir: "{{.CONTROLLER_ROOT}}" cmds: @@ -1202,14 +1202,14 @@ tasks: cleanup-azure-resources: desc: Removes any resources created by the integration tests. - deps: - - az-login + deps: + - az-login cmds: - '{{.SCRIPTS_ROOT}}/delete-old-resourcegroups.sh -p "{{.TEST_RESOURCE_PREFIX}}"' cleanup-old-live-azure-resources: desc: Removes any old resources created by the integration tests (old means older than 3 hours). - deps: + deps: - az-login # This finds all resource groups which match the specified pattern (asolivetest*) # and are older than 3 hours (10800 seconds). @@ -1269,8 +1269,8 @@ tasks: produce-markdown-summary: desc: Builds a test output summary for Github - deps: - - build-mangle-test + deps: + - build-mangle-test cmds: - cmd: ./v2/tools/mangle-test-json/mangle-test-json "{{.INPUT_FILE}}" > "{{.OUTPUT_FILE}}" @@ -1284,8 +1284,8 @@ tasks: desc: Creates a storage account for use in OIDC federation with a random name in resource group "aso-wi-storage" dir: "v2/" cmds: - - "{{.SCRIPTS_ROOT}}/workloadidentitystorage/deploy.sh" + - '{{.SCRIPTS_ROOT}}/workloadidentitystorage/deploy.sh' env: KIND_OIDC_STORAGE_ACCOUNT_RG: aso-wi-storage KIND_OIDC_STORAGE_ACCOUNT: - sh: echo "asowi$(openssl rand -hex 6)" + sh: echo "asowi$(openssl rand -hex 6)" diff --git a/v2/samples/insights/v1api/refs/v1api20201101_loadbalancer_20220301_vmss.yaml b/v2/samples/insights/v1api/refs/v1api20201101_loadbalancer_20220301_vmss.yaml new file mode 100644 index 00000000000..aabb0edc758 --- /dev/null +++ b/v2/samples/insights/v1api/refs/v1api20201101_loadbalancer_20220301_vmss.yaml @@ -0,0 +1,28 @@ +apiVersion: network.azure.com/v1api20201101 +kind: LoadBalancer +metadata: + name: sampleloadbalancervmss1 + namespace: default +spec: + location: westus3 + owner: + name: aso-sample-rg + sku: + name: Standard + frontendIPConfigurations: + - name: LoadBalancerFrontend + publicIPAddress: + reference: + group: network.azure.com + kind: PublicIPAddress + name: samplepublicipvmss1 + inboundNatPools: + - name: samplenatpoolvmss1 + frontendIPConfiguration: + reference: + armId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/aso-sample-rg/providers/Microsoft.Network/loadBalancers/sampleloadbalancervmss1/frontendIPConfigurations/LoadBalancerFrontend + protocol: Tcp + frontendPortRangeStart: 50000 + frontendPortRangeEnd: 51000 + backendPort: 22 + diff --git a/v2/samples/insights/v1api/refs/v1api20201101_networkinterface_vmss_20220301.yaml b/v2/samples/insights/v1api/refs/v1api20201101_networkinterface_vmss_20220301.yaml new file mode 100644 index 00000000000..6b7ab79e656 --- /dev/null +++ b/v2/samples/insights/v1api/refs/v1api20201101_networkinterface_vmss_20220301.yaml @@ -0,0 +1,17 @@ +apiVersion: network.azure.com/v1api20201101 +kind: NetworkInterface +metadata: + name: samplenicvmss1 + namespace: default +spec: + location: westus3 + owner: + name: aso-sample-rg + ipConfigurations: + - name: ipconfig1 + privateIPAllocationMethod: Dynamic + subnet: + reference: + group: network.azure.com + kind: VirtualNetworksSubnet + name: samplesubnetvmss1 diff --git a/v2/samples/insights/v1api/refs/v1api20201101_publicipaddress_20220301_vmss.yaml b/v2/samples/insights/v1api/refs/v1api20201101_publicipaddress_20220301_vmss.yaml new file mode 100644 index 00000000000..d0184f5e390 --- /dev/null +++ b/v2/samples/insights/v1api/refs/v1api20201101_publicipaddress_20220301_vmss.yaml @@ -0,0 +1,12 @@ +apiVersion: network.azure.com/v1api20201101 +kind: PublicIPAddress +metadata: + name: samplepublicipvmss1 + namespace: default +spec: + location: westus3 + owner: + name: aso-sample-rg + sku: + name: Standard + publicIPAllocationMethod: Static diff --git a/v2/samples/insights/v1api/refs/v1api20201101_virtualnetwork_vmss_20220301.yaml b/v2/samples/insights/v1api/refs/v1api20201101_virtualnetwork_vmss_20220301.yaml new file mode 100644 index 00000000000..f63f0d4671f --- /dev/null +++ b/v2/samples/insights/v1api/refs/v1api20201101_virtualnetwork_vmss_20220301.yaml @@ -0,0 +1,12 @@ +apiVersion: network.azure.com/v1api20201101 +kind: VirtualNetwork +metadata: + name: samplevnetvmss1 + namespace: default +spec: + location: westus3 + owner: + name: aso-sample-rg + addressSpace: + addressPrefixes: + - 10.0.0.0/16 diff --git a/v2/samples/insights/v1api/refs/v1api20201101_virtualnetworkssubnet_vmss_20220301.yaml b/v2/samples/insights/v1api/refs/v1api20201101_virtualnetworkssubnet_vmss_20220301.yaml new file mode 100644 index 00000000000..64b5014d8b8 --- /dev/null +++ b/v2/samples/insights/v1api/refs/v1api20201101_virtualnetworkssubnet_vmss_20220301.yaml @@ -0,0 +1,9 @@ +apiVersion: network.azure.com/v1api20201101 +kind: VirtualNetworksSubnet +metadata: + name: samplesubnetvmss1 + namespace: default +spec: + owner: + name: samplevnetvmss1 + addressPrefix: 10.0.0.0/24 diff --git a/v2/samples/insights/v1api/refs/v1api20210401_storageaccount.yaml b/v2/samples/insights/v1api/refs/v1api20210401_storageaccount.yaml new file mode 100644 index 00000000000..e32bda1021f --- /dev/null +++ b/v2/samples/insights/v1api/refs/v1api20210401_storageaccount.yaml @@ -0,0 +1,14 @@ +apiVersion: storage.azure.com/v1api20210401 +kind: StorageAccount +metadata: + name: samplestoragema + namespace: default +spec: + location: westcentralus + kind: StorageV2 + sku: + name: Standard_LRS + owner: + name: aso-sample-rg + accessTier: Hot + # supportsHttpsTrafficOnly: true diff --git a/v2/samples/insights/v1api/refs/v1api20210601_workspace.yaml b/v2/samples/insights/v1api/refs/v1api20210601_workspace.yaml new file mode 100644 index 00000000000..638e3557483 --- /dev/null +++ b/v2/samples/insights/v1api/refs/v1api20210601_workspace.yaml @@ -0,0 +1,11 @@ +apiVersion: operationalinsights.azure.com/v1api20210601 +kind: Workspace +metadata: + name: sampleworkspace + namespace: default +spec: + location: westcentralus + owner: + name: aso-sample-rg + sku: + name: Standalone diff --git a/v2/samples/insights/v1api/refs/v1api20220301_virtualmachinescaleset.yaml b/v2/samples/insights/v1api/refs/v1api20220301_virtualmachinescaleset.yaml new file mode 100644 index 00000000000..b04ac484fc2 --- /dev/null +++ b/v2/samples/insights/v1api/refs/v1api20220301_virtualmachinescaleset.yaml @@ -0,0 +1,51 @@ +apiVersion: compute.azure.com/v1api20220301 +kind: VirtualMachineScaleSet +metadata: + name: aso-sample-vmss + namespace: default +spec: + location: westus3 + owner: + name: aso-sample-rg + platformFaultDomainCount: 2 + singlePlacementGroup: false + sku: + capacity: 1 + name: STANDARD_D1_v2 + upgradePolicy: + mode: Automatic + virtualMachineProfile: + extensionProfile: + extensions: + - name: mycustomextension + publisher: Microsoft.Azure.Extensions + settings: + commandToExecute: /bin/bash -c "echo hello" + type: CustomScript + typeHandlerVersion: "2.0" + networkProfile: + networkInterfaceConfigurations: + - ipConfigurations: + - loadBalancerInboundNatPools: + - reference: + armId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/aso-sample-rg/providers/Microsoft.Network/loadBalancers/sampleloadbalancervmss1/inboundNatPools/samplenatpoolvmss1 + name: myipconfiguration + subnet: + reference: + group: network.azure.com + kind: VirtualNetworksSubnet + name: samplesubnetvmss1 + name: mynicconfig + primary: true + osProfile: + computerNamePrefix: computer + adminUsername: adminUser + adminPassword: + key: password + name: sample-vmss-secret + storageProfile: + imageReference: + publisher: Canonical + offer: 0001-com-ubuntu-server-jammy + sku: 22_04-lts + version: latest