Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Terraform Plugin SDK to Reconcile MRs #592

Merged
merged 35 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d8f267d
Switch to the no-fork architecture for the azurerm resources
ulucinar Nov 15, 2023
c1a315b
ResourceGroup.azure example manifest now uses a randomized name
ulucinar Nov 15, 2023
4fb6e16
Do not add "region" as an identifier field
ulucinar Nov 17, 2023
2eace0a
Fix network.Subnet example manifest
sergenyalcin Nov 17, 2023
d5b2bb5
Bump the required Go version in the Makefile to v1.21
ulucinar Nov 17, 2023
eadd6c8
Fix network.Subnet example manifest
sergenyalcin Nov 20, 2023
803545a
Fix web.AppActiveSlot example manifest
sergenyalcin Nov 20, 2023
612b88b
Exclude azure provider while preparing the uptest job
sergenyalcin Nov 27, 2023
4ad01e3
Fix external name configurations of a few container group resources
sergenyalcin Nov 28, 2023
52a57c7
Fix example manifest of container.TokenPassword resource
sergenyalcin Nov 28, 2023
38c70c9
configure azure auth for no-fork external clients
erhancagirici Nov 28, 2023
7ee7ff6
fix import order
erhancagirici Nov 28, 2023
f816652
Fix dbforpostgresql.ActiveDirectoryAdministrator example manifest
sergenyalcin Dec 1, 2023
a7bd343
Add auto-generated SSA topological markers for maps & scalar lists
ulucinar Dec 13, 2023
984d1ff
add dependencies for BackupPolicyBlobStorage.dataprotection.azure exa…
erhancagirici Dec 14, 2023
c50e201
Update upjet dependency to the ulucinar/b674f3dd0c9f9dc238b2bbd5518fa…
sergenyalcin Dec 15, 2023
d068fc5
Update upjet dependency to 9543be90ce6b1001213a5bb3429bb6947a131fd3 c…
sergenyalcin Dec 18, 2023
3f32767
Fix authorization.ResourceGroupPolicyAssignment example manifest
sergenyalcin Dec 18, 2023
306f5b8
remove explicit sync mode configuration from resources
erhancagirici Dec 19, 2023
07f21f7
generate - remove explicit sync mode configuration from resources
erhancagirici Dec 19, 2023
00fc4ca
Fix external name configuration of storage.BlobInventoryPolicy resource
sergenyalcin Dec 21, 2023
08aa075
Use IdentifierFromProvider for storage.BlobInventoryPolicy resource
sergenyalcin Dec 21, 2023
00918d5
- Fix external name configuration of storage.EncryptionScope and stor…
sergenyalcin Dec 21, 2023
2360255
Fix two network group resources
sergenyalcin Dec 22, 2023
52ea37b
Fix network.ManagerManagementGroupConnection resource by adding Custo…
sergenyalcin Dec 22, 2023
0063f85
Bump upjet to commit 343f24ceaee4
ulucinar Dec 22, 2023
43978cc
- Update upjet dependency 81e262067d2b9e7099ca6a07b15e8d2ca1a08b5e
sergenyalcin Dec 25, 2023
b272492
Add custom diff for azurerm_windows_virtual_machine_scale_set
sergenyalcin Dec 25, 2023
ac9afd4
fix RedisCache.apimanagement example manifest
erhancagirici Dec 25, 2023
bf6a28c
fix missing parantheses for DedicatedHost.compute external name config
erhancagirici Dec 26, 2023
e6987c0
Remove jsonencode keyword from resources.ResourceGroupTemplateDeploym…
sergenyalcin Dec 27, 2023
1a8765c
Fix external name template of authorization.ResourceGroupPolicyAssign…
sergenyalcin Dec 27, 2023
b8933f6
fix external name config for Gateway/apimanagement.azure
erhancagirici Dec 28, 2023
9d67f2f
Run make generate
ulucinar Jan 2, 2024
22f6bb8
Remove the following fields from IdentifierFields slices:
sergenyalcin Jan 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
jobs:
ci:
uses: upbound/uptest/.github/workflows/provider-ci.yml@main
with:
go-version: 1.21
secrets:
UPBOUND_MARKETPLACE_PUSH_ROBOT_USR: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }}
UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW }}
2 changes: 1 addition & 1 deletion .github/workflows/native-provider-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
uses: upbound/uptest/.github/workflows/native-provider-bump.yml@main
with:
provider-source: hashicorp/azurerm
go-version: 1.19
go-version: 1.21
secrets:
TOKEN: ${{ secrets.OFFICIAL_PROVIDERS_GA_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/publish-service-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
subpackages: ${{ github.event.inputs.subpackages }}
size: ${{ github.event.inputs.size }}
concurrency: ${{ github.event.inputs.concurrency }}
go-version: 1.21
secrets:
UPBOUND_MARKETPLACE_PUSH_ROBOT_USR: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR_RC }}
UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW_RC }}
1 change: 1 addition & 0 deletions .github/workflows/updoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ jobs:
uses: upbound/uptest/.github/workflows/provider-updoc.yml@main
with:
providers: "monolith config"
go-version: 1.21
secrets:
UPBOUND_CI_PROD_BUCKET_SA: ${{ secrets.UPBOUND_CI_PROD_BUCKET_SA }}
2 changes: 1 addition & 1 deletion .github/workflows/uptest-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

env:
# Common versions
GO_VERSION: '1.19'
GO_VERSION: '1.21'
DOCKER_BUILDX_VERSION: 'v0.8.2'

jobs:
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ GO_TEST_PARALLEL := $(shell echo $$(( $(NPROCS) / 2 )))
# correctly.
export GOPRIVATE = github.com/upbound/*

GO_REQUIRED_VERSION ?= 1.19
GO_REQUIRED_VERSION ?= 1.21
# GOLANGCILINT_VERSION is inherited from build submodule by default.
# Uncomment below if you need to override the version.
# GOLANGCILINT_VERSION ?= 1.54.0
Expand All @@ -67,7 +67,7 @@ export SUBPACKAGES := $(SUBPACKAGES)
KIND_VERSION = v0.15.0
UP_VERSION = v0.20.0
UP_CHANNEL = stable
UPTEST_VERSION = v0.6.1
UPTEST_VERSION = v0.8.0

export UP_VERSION := $(UP_VERSION)
export UP_CHANNEL := $(UP_CHANNEL)
Expand Down Expand Up @@ -212,8 +212,8 @@ family-e2e:
for m in $$(tr ',' ' ' <<< $${UPTEST_EXAMPLE_LIST}); do \
$(INFO) Processing the example manifest "$${m}"; \
for api in $$(sed -nE 's/^apiVersion: *(.+)/\1/p' "$${m}" | cut -d. -f1); do \
if [[ $${api} == "v1" ]]; then \
$(INFO) v1 is not a valid provider. Skipping...; \
if [[ $${api} == "v1" || $${api} == "azure" ]]; then \
$(INFO) $${api} is not a valid provider. Skipping...; \
continue; \
fi; \
if [[ $${INSTALL_APIS} =~ " $${api} " ]]; then \
Expand Down Expand Up @@ -242,7 +242,7 @@ crddiff: $(UPTEST)
continue ; \
fi ; \
echo "Checking $${crd} for breaking API changes..." ; \
changes_detected=$$($(UPTEST) crddiff revision <(git cat-file -p "$${GITHUB_BASE_REF}:$${crd}") "$${crd}" 2>&1) ; \
changes_detected=$$($(UPTEST) crddiff revision --enable-upjet-extensions <(git cat-file -p "$${GITHUB_BASE_REF}:$${crd}") "$${crd}" 2>&1) ; \
if [[ $$? != 0 ]] ; then \
printf "\033[31m"; echo "Breaking change detected!"; printf "\033[0m" ; \
echo "$${changes_detected}" ; \
Expand Down
4 changes: 3 additions & 1 deletion cmd/generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package main

import (
"context"
"encoding/json"
"fmt"
"os"
Expand Down Expand Up @@ -42,7 +43,8 @@ func main() {
if err != nil {
panic(fmt.Sprintf("cannot calculate the absolute path with %s", *repoRoot))
}
p := config.GetProvider()
p, err := config.GetProvider(context.Background(), true)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
dumpGeneratedResourceList(p, generatedResourceList)
dumpSkippedResourcesCSV(p, skippedResourcesCSV)
pipeline.Run(p, absRootDir)
Expand Down
14 changes: 8 additions & 6 deletions cmd/provider/alertsmanagement/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package main

import (
"context"
"math/rand"
"os"
"path/filepath"
"time"
Expand Down Expand Up @@ -113,6 +112,9 @@ func main() {
terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource)))
}

ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: log,
Expand All @@ -121,9 +123,10 @@ func main() {
MaxConcurrentReconciles: *maxReconcileRate,
Features: &feature.Flags{},
},
Provider: config.GetProvider(),
SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler),
PollJitter: pollJitter,
Provider: provider,
SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler),
PollJitter: pollJitter,
OperationTrackerStore: tjcontroller.NewOperationStore(log),
}

if *enableManagementPolicies {
Expand All @@ -147,7 +150,7 @@ func main() {
}

// Ensure default store config exists.
kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{
kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{
ObjectMeta: metav1.ObjectMeta{
Name: "default",
},
Expand All @@ -161,7 +164,6 @@ func main() {
})), "cannot create default store config")
}

rand.Seed(time.Now().UnixNano())
kingpin.FatalIfError(controller.Setup_alertsmanagement(mgr, o), "Cannot setup Azure controllers")
kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager")
}
14 changes: 8 additions & 6 deletions cmd/provider/analysisservices/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package main

import (
"context"
"math/rand"
"os"
"path/filepath"
"time"
Expand Down Expand Up @@ -113,6 +112,9 @@ func main() {
terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource)))
}

ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: log,
Expand All @@ -121,9 +123,10 @@ func main() {
MaxConcurrentReconciles: *maxReconcileRate,
Features: &feature.Flags{},
},
Provider: config.GetProvider(),
SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler),
PollJitter: pollJitter,
Provider: provider,
SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler),
PollJitter: pollJitter,
OperationTrackerStore: tjcontroller.NewOperationStore(log),
}

if *enableManagementPolicies {
Expand All @@ -147,7 +150,7 @@ func main() {
}

// Ensure default store config exists.
kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{
kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{
ObjectMeta: metav1.ObjectMeta{
Name: "default",
},
Expand All @@ -161,7 +164,6 @@ func main() {
})), "cannot create default store config")
}

rand.Seed(time.Now().UnixNano())
kingpin.FatalIfError(controller.Setup_analysisservices(mgr, o), "Cannot setup Azure controllers")
kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager")
}
14 changes: 8 additions & 6 deletions cmd/provider/apimanagement/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package main

import (
"context"
"math/rand"
"os"
"path/filepath"
"time"
Expand Down Expand Up @@ -113,6 +112,9 @@ func main() {
terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource)))
}

ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: log,
Expand All @@ -121,9 +123,10 @@ func main() {
MaxConcurrentReconciles: *maxReconcileRate,
Features: &feature.Flags{},
},
Provider: config.GetProvider(),
SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler),
PollJitter: pollJitter,
Provider: provider,
SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler),
PollJitter: pollJitter,
OperationTrackerStore: tjcontroller.NewOperationStore(log),
}

if *enableManagementPolicies {
Expand All @@ -147,7 +150,7 @@ func main() {
}

// Ensure default store config exists.
kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{
kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{
ObjectMeta: metav1.ObjectMeta{
Name: "default",
},
Expand All @@ -161,7 +164,6 @@ func main() {
})), "cannot create default store config")
}

rand.Seed(time.Now().UnixNano())
kingpin.FatalIfError(controller.Setup_apimanagement(mgr, o), "Cannot setup Azure controllers")
kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager")
}
14 changes: 8 additions & 6 deletions cmd/provider/appconfiguration/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package main

import (
"context"
"math/rand"
"os"
"path/filepath"
"time"
Expand Down Expand Up @@ -113,6 +112,9 @@ func main() {
terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource)))
}

ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: log,
Expand All @@ -121,9 +123,10 @@ func main() {
MaxConcurrentReconciles: *maxReconcileRate,
Features: &feature.Flags{},
},
Provider: config.GetProvider(),
SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler),
PollJitter: pollJitter,
Provider: provider,
SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler),
PollJitter: pollJitter,
OperationTrackerStore: tjcontroller.NewOperationStore(log),
}

if *enableManagementPolicies {
Expand All @@ -147,7 +150,7 @@ func main() {
}

// Ensure default store config exists.
kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{
kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{
ObjectMeta: metav1.ObjectMeta{
Name: "default",
},
Expand All @@ -161,7 +164,6 @@ func main() {
})), "cannot create default store config")
}

rand.Seed(time.Now().UnixNano())
kingpin.FatalIfError(controller.Setup_appconfiguration(mgr, o), "Cannot setup Azure controllers")
kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager")
}
14 changes: 8 additions & 6 deletions cmd/provider/appplatform/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package main

import (
"context"
"math/rand"
"os"
"path/filepath"
"time"
Expand Down Expand Up @@ -113,6 +112,9 @@ func main() {
terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource)))
}

ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: log,
Expand All @@ -121,9 +123,10 @@ func main() {
MaxConcurrentReconciles: *maxReconcileRate,
Features: &feature.Flags{},
},
Provider: config.GetProvider(),
SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler),
PollJitter: pollJitter,
Provider: provider,
SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler),
PollJitter: pollJitter,
OperationTrackerStore: tjcontroller.NewOperationStore(log),
}

if *enableManagementPolicies {
Expand All @@ -147,7 +150,7 @@ func main() {
}

// Ensure default store config exists.
kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{
kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{
ObjectMeta: metav1.ObjectMeta{
Name: "default",
},
Expand All @@ -161,7 +164,6 @@ func main() {
})), "cannot create default store config")
}

rand.Seed(time.Now().UnixNano())
kingpin.FatalIfError(controller.Setup_appplatform(mgr, o), "Cannot setup Azure controllers")
kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager")
}
14 changes: 8 additions & 6 deletions cmd/provider/attestation/zz_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package main

import (
"context"
"math/rand"
"os"
"path/filepath"
"time"
Expand Down Expand Up @@ -113,6 +112,9 @@ func main() {
terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource)))
}

ctx := context.Background()
provider, err := config.GetProvider(ctx, false)
kingpin.FatalIfError(err, "Cannot initialize the provider configuration")
o := tjcontroller.Options{
Options: xpcontroller.Options{
Logger: log,
Expand All @@ -121,9 +123,10 @@ func main() {
MaxConcurrentReconciles: *maxReconcileRate,
Features: &feature.Flags{},
},
Provider: config.GetProvider(),
SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler),
PollJitter: pollJitter,
Provider: provider,
SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler),
PollJitter: pollJitter,
OperationTrackerStore: tjcontroller.NewOperationStore(log),
}

if *enableManagementPolicies {
Expand All @@ -147,7 +150,7 @@ func main() {
}

// Ensure default store config exists.
kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{
kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{
ObjectMeta: metav1.ObjectMeta{
Name: "default",
},
Expand All @@ -161,7 +164,6 @@ func main() {
})), "cannot create default store config")
}

rand.Seed(time.Now().UnixNano())
kingpin.FatalIfError(controller.Setup_attestation(mgr, o), "Cannot setup Azure controllers")
kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager")
}
Loading
Loading