This repository has been archived by the owner on Jul 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 276
Use the AzureResource Informer; Refactor for clarity #20
Merged
Merged
Changes from 20 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
c47406a
eds: Use the AzureResource Informer
draychev 120253e
kube: Refactor Kubernetes Provider
draychev bc6a11f
mesh: Adding mesh.provider types enum
draychev 9c6d111
azure: Split Client and Provider
draychev 849601a
k8s: Split Client and Provider
draychev 7eba42b
mesh: No need for ServiceProviderI
draychev 3d649f8
Refactor
draychev 019c72a
azure: Adding tests
draychev d899eb6
kube: Adding tests
draychev fab06b1
Moving run-*.sh to ./scripts
draychev 2308aa5
Remove AZURE_RESOURCE_GROUP
draychev 4908690
Remove AZURE_RESOURCE_GROUP
draychev cf316cf
Better AzureResource
draychev 3eb21cf
Move gRPC tools to pkg/utils/grpc.go
draychev c2104bd
Port number as a CLI argument
draychev 6fc7e22
Handle SIGINT / SIGTERM
draychev 62f54fc
Refactor
draychev d06e2ce
Merge branch 'master' into draychev/use-azure-resource-4
draychev 633463e
Delete unused Providers enum
draychev efb12ea
mesh.GetComputeIDForService should return a slice of ComputeIDs
draychev 7510205
Adding comments
draychev 60ce065
Refactor for clarity; Bring struct declaration close to where it is used
draychev 825ad38
Merge branch 'master' into draychev/use-azure-resource-4
draychev b55d1ea
Fix a typo
draychev f4264c9
Leave a TODO to consolidate parseFlags
draychev ed6645b
Move provider identifiying string to a string const
draychev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,26 +5,27 @@ import ( | |
"flag" | ||
"fmt" | ||
"os" | ||
"os/signal" | ||
"syscall" | ||
|
||
"github.com/deislabs/smc/pkg/utils" | ||
|
||
envoyControlPlane "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v2" | ||
"github.com/golang/glog" | ||
"github.com/spf13/pflag" | ||
|
||
"github.com/deislabs/smc/cmd" | ||
sdsServer "github.com/deislabs/smc/pkg/envoy/sds" | ||
) | ||
|
||
const ( | ||
serverType = "SDS" | ||
port = 15123 | ||
|
||
verbosityFlag = "verbosity" | ||
) | ||
|
||
var ( | ||
flags = pflag.NewFlagSet(`diplomat-sds`, pflag.ExitOnError) | ||
keysDirectory = flags.String("keys-directory", "", "Directory where the keys are stored") | ||
verbosity = flags.Int(verbosityFlag, 1, "Set logging verbosity level") | ||
verbosity = flags.Int("verbosity", 1, "Set logging verbosity level") | ||
port = flags.Int("port", 15123, "Service Discovery Service port number. (Default: 15123)") | ||
) | ||
|
||
func main() { | ||
|
@@ -34,10 +35,16 @@ func main() { | |
ctx, cancel := context.WithCancel(context.Background()) | ||
defer cancel() | ||
|
||
grpcServer, lis := cmd.NewGrpc(serverType, port) | ||
grpcServer, lis := utils.NewGrpc(serverType, *port) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as @vramakrishnan requested - we moved the gRPC tools in pkg/utils |
||
sds := sdsServer.NewSDSServer(keysDirectory) | ||
envoyControlPlane.RegisterSecretDiscoveryServiceServer(grpcServer, sds) | ||
cmd.GrpcServe(ctx, grpcServer, lis, cancel, serverType) | ||
go utils.GrpcServe(ctx, grpcServer, lis, cancel, serverType) | ||
|
||
sigChan := make(chan os.Signal, 1) | ||
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM) | ||
<-sigChan | ||
|
||
glog.Info("Goodbye!") | ||
Comment on lines
+43
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The syscall handling block here is a bit of a noop at the moment. Reasons for putting it: |
||
} | ||
|
||
func parseFlags() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: smc.osm.k8s.io/v1 | ||
kind: AzureResource | ||
metadata: | ||
name: bookstore | ||
namespace: smc | ||
labels: | ||
app: bookstore-1 | ||
spec: | ||
resourceid: /subscriptions/abc/resourcegroups/xyz/providers/Microsoft.Compute/virtualMachines/myVM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
FROM alpine:3.10.1 | ||
ADD bin/eds /eds | ||
ADD ./run-eds.sh /run-eds.sh | ||
ADD ./scripts/run-eds.sh /run-eds.sh | ||
RUN chmod +x /eds | ||
RUN chmod +x /run-eds.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We no longer need
AZURE_RESOURCE_GROUP
- the subscription UUID is now available in theAzureResource
CRD