Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
  •  
  •  
  •  
13 changes: 10 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package main

import (
Expand Down Expand Up @@ -70,7 +77,7 @@ func main() {
sdkGRPC.InitMeta(loadedConfig.ClientID, loadedConfig.CloudAccountID)

controller, commander, reporter := createGrpcClients(ctx, loadedConfig)

if controller != nil {
if err := controller.Connect(); err != nil {
log.Warnf("Unable to connect to control plane: %v", err)
Expand Down Expand Up @@ -135,15 +142,15 @@ func handleSignals(
}

func connectionUnavilable(loadedConfig *config.Config) bool {
return loadedConfig.Server.Host == "" || loadedConfig.Server.GrpcPort == 0
return loadedConfig.Server.Host == "" || loadedConfig.Server.GrpcPort == 0
}

func createGrpcClients(ctx context.Context, loadedConfig *config.Config) (client.Controller, client.Commander, client.MetricReporter) {
if connectionUnavilable(loadedConfig) {
log.Infof("GRPC clients not created")
return nil, nil, nil
}

grpcDialOptions := setDialOptions(loadedConfig)
secureMetricsDialOpts, err := sdkGRPC.SecureDialOptions(
loadedConfig.TLS.Enable,
Expand Down
7 changes: 7 additions & 0 deletions sdk/agent/config/config_helpers.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package config

const (
Expand Down
7 changes: 7 additions & 0 deletions sdk/backoff.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package sdk

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/backoff_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package sdk

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/certificates.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package sdk

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/certificates_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package sdk

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/checksum/checksum.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package checksum

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/checksum/checksum_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package checksum

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/client/client.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

//go:generate enumer -type=MsgClassification -text -yaml -json -transform=snake -trimprefix=MsgClassification

package client
Expand Down
7 changes: 7 additions & 0 deletions sdk/client/commander.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package client

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/client/commander_mock_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package client

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/client/commander_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package client

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/client/connect.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package client

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/client/controller.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package client

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/client/controller_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package client

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/client/errors.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package client

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/client/message.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package client

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/client/metric_reporter.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package client

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/client/metric_reporter_mock_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package client

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/client/metric_reporter_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package client

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/config_apply.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package sdk

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/config_apply_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package sdk

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/config_helpers.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package sdk

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/config_helpers_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package sdk

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/examples/server.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package main

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/examples/services/command_service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package services

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/examples/services/metrics_service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package services

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/files/file_helpers.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package files

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/files/file_helpers_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package files

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/grpc/conts.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package grpc

const (
Expand Down
7 changes: 7 additions & 0 deletions sdk/grpc/grpc.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package grpc

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/grpc/grpc_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package grpc

import (
Expand Down
7 changes: 7 additions & 0 deletions sdk/grpc/meta.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) F5, Inc.
*
* This source code is licensed under the Apache License, Version 2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

package grpc

import (
Expand Down
Loading