-
Notifications
You must be signed in to change notification settings - Fork 99
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
Add DeploymentTemplate controller for GitOps support #8001
base: main
Are you sure you want to change the base?
Add DeploymentTemplate controller for GitOps support #8001
Conversation
} | ||
|
||
type OSFileSystem struct { | ||
FileSystem afero.Fs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of writing a filesystem abstraction I added this afero
library. Seems to be widely used, I replaced the OSFileSystem
with it. LMK if I should revert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there added functionalities that we get using afero
or is the main benefit that's it's an abstraction layer over os
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of writing a filesystem abstraction I added this
afero
library. Seems to be widely used, I replaced theOSFileSystem
with it. LMK if I should revert
The afero repo appears to have no commits for a year even though there are open PRs for it, including one for a CVE. I don't see depndabot PRs being active in the list at all, which suggests that this dependency could open us up to some security issues. None of the issues created in the last year have any comments or responses. If there's a compelling reason for using this library, then let's discuss how to manage it.
On the other hand, Radius already depends on viper, which gives us an indirect dependency on afero.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find! I added it here because the stdlib fs
does not include a filesystem abstraction with CreateFile
. The benefit of adding afero
was to not have to implement and maintain this ourselves. Since we already indirectly depend on this library, and that it's a pretty widespread dependency, I'd say we should be okay to use it. Thoughts? @brooke-hamilton
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rynowak thoughts on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the savings of using this library? I don't have fundamental concerns about it, I just can't tell from the diff what's going to change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also really like to remove viper as a dependency. We've got a lot of workarounds in place for for behaviors that aren't helpful to us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed afero
as a dependency and wrote a simple filesystem abstraction that we can use
@@ -527,7 +527,6 @@ func Test_Run(t *testing.T) { | |||
}) | |||
|
|||
t.Run("Deployment with missing parameters", func(t *testing.T) { | |||
//t.Skip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing commented out t.Skip()
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
pkg/cli/cmd/bicep/generatekubernetesmanifest/generatekubernetesmanifest.go
Outdated
Show resolved
Hide resolved
pkg/cli/cmd/bicep/generatekubernetesmanifest/generatekubernetesmanifest.go
Outdated
Show resolved
Hide resolved
pkg/cli/cmd/bicep/generatekubernetesmanifest/generatekubernetesmanifest.go
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran make generate build test
and got 8 failures.
=== FAIL: pkg/cli/cmd/bicep/generatekubernetesmanifest Test_Run/Create_basic_DeploymentTemplate (0.00s)
=== FAIL: pkg/cli/cmd/bicep/generatekubernetesmanifest Test_Run/Create_DeploymentTemplate_with_template_content (0.00s)
=== FAIL: pkg/cli/cmd/bicep/generatekubernetesmanifest Test_Run/Create_DeploymentTemplate_with_Azure_scope (0.00s)
=== FAIL: pkg/cli/cmd/bicep/generatekubernetesmanifest Test_Run/Create_DeploymentTemplate_with_AWS_scope (0.00s)
=== FAIL: pkg/cli/cmd/bicep/generatekubernetesmanifest Test_Run (0.00s)
=== FAIL: pkg/controller/reconciler Test_DeploymentResourceReconciler_Basic (10.01s)
=== FAIL: pkg/controller/reconciler Test_DeploymentTemplateReconciler_Basic (0.01s)
=== FAIL: pkg/controller/reconciler Test_DeploymentTemplateReconciler_FailureRecovery (0.00s)
Here's one example:
=== FAIL: pkg/cli/cmd/bicep/generatekubernetesmanifest Test_Run/Create_DeploymentTemplate_with_Azure_scope (0.00s)
Creating DeploymentTemplate YAML file
generatekubernetesmanifest_test.go:396:
Error Trace: /workspaces/radius/pkg/cli/cmd/bicep/generatekubernetesmanifest/generatekubernetesmanifest_test.go:396
Error: Not equal:
expected: "apiVersion: radapp.io/v1alpha3\nkind: DeploymentTemplate\nmetadata:\n name: azure.yaml\n namespace: radius-system\nspec:\n parameters: '{}'\n providerConfig: '{\"radius\":{\"type\":\"radius\",\"value\":{\"scope\":\"/planes/radius/local/resourceGroups/test-resource-group\"}},\"az\":{\"type\":\"azure\",\"value\":{\"scope\":\"/subscriptions/test-subId/resourceGroups/test-rg\"}},\"deployments\":{\"type\":\"Microsoft.Resources\",\"value\":{\"scope\":\"/planes/radius/local/resourceGroups/test-resource-group\"}}}'\n template: '{}'\n"
actual : "apiVersion: radapp.io/v1alpha3\nkind: DeploymentTemplate\nmetadata:\n name: azure.yaml\n namespace: radius-system\nspec:\n parameters: '{}'\n providerConfig: '{\"radius\":{\"type\":\"radius\",\"value\":{\"scope\":\"/planes/radius/local/resourceGroups/test-resource-group\"}},\"az\":{\"type\":\"azure\",\"value\":{\"scope\":\"/subscriptions/test-subId/resourceGroups/test-rg\"}},\"deployments\":{\"type\":\"Microsoft.Resources\",\"value\":{\"scope\":\"/planes/radius/local/resourceGroups/test-resource-group\"}}}'\n repository: azure.yaml\n template: '{}'\n"
Diff:
--- Expected
+++ Actual
@@ -8,2 +8,3 @@
providerConfig: '{"radius":{"type":"radius","value":{"scope":"/planes/radius/local/resourceGroups/test-resource-group"}},"az":{"type":"azure","value":{"scope":"/subscriptions/test-subId/resourceGroups/test-rg"}},"deployments":{"type":"Microsoft.Resources","value":{"scope":"/planes/radius/local/resourceGroups/test-resource-group"}}}'
+ repository: azure.yaml
template: '{}'
Test: Test_Run/Create_DeploymentTemplate_with_Azure_scope
--- FAIL: Test_Run/Create_DeploymentTemplate_with_Azure_scope (0.00s)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running make generate
results in these files being changed.
deploy/Chart/crds/radius/radapp.io_deploymentresources.yaml
deploy/Chart/crds/radius/radapp.io_deploymenttemplates.yaml
deploy/Chart/crds/radius/radapp.io_recipes.yaml
deploy/Chart/crds/ucpd/ucp.dev_queuemessages.yaml
deploy/Chart/crds/ucpd/ucp.dev_resources.yaml
For example, controller-gen.kubebuilder.io/version: v0.16.4
changes to controller-gen.kubebuilder.io/version: v0.16.0
Signed-off-by: willdavsmith <[email protected]>
Signed-off-by: willdavsmith <[email protected]>
Signed-off-by: willdavsmith <[email protected]>
Signed-off-by: willdavsmith <[email protected]>
Signed-off-by: willdavsmith <[email protected]>
Signed-off-by: willdavsmith <[email protected]>
Signed-off-by: willdavsmith <[email protected]>
Signed-off-by: willdavsmith <[email protected]>
Signed-off-by: willdavsmith <[email protected]>
Signed-off-by: willdavsmith <[email protected]>
Signed-off-by: willdavsmith <[email protected]>
Signed-off-by: willdavsmith <[email protected]>
Signed-off-by: willdavsmith <[email protected]>
Signed-off-by: willdavsmith <[email protected]>
Signed-off-by: willdavsmith <[email protected]>
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
Signed-off-by: willdavsmith <[email protected]>
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
Signed-off-by: willdavsmith <[email protected]>
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
Signed-off-by: willdavsmith <[email protected]>
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
Signed-off-by: willdavsmith <[email protected]>
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
Signed-off-by: willdavsmith <[email protected]>
Signed-off-by: Will Smith <[email protected]>
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
Description
rad bicep generate-kubernetes-manifest
CLIType of change
#6689
Contributor checklist
Please verify that the PR meets the following requirements, where applicable: