fluent-plugin-azure-storage-append-blob-lts 0.6.2 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24eb19ac68cd42369ff7f147be24635945aad7c003f4ed789bcb4189d5f9a96e
4
- data.tar.gz: f293437b177cf4f7fc7a02694150f03f479c70749a3973d2ffc45a19377b7784
3
+ metadata.gz: f9e6de27ebbf624d51968e415d502111523d3fd670d2345558381b03895934d6
4
+ data.tar.gz: 80fbe42cee9d82adb02afbaf2cfed1fd92b0d4fbbbfb1e67b50e328795d90b23
5
5
  SHA512:
6
- metadata.gz: 7be9b8cf563a7c2cf5b10667a8d037ea5a17d84a78ab3a782a937f5c06e0f850804985fef3b5b6eff795e965c4eefa0d690ddd737485929fa4882df416e420c0
7
- data.tar.gz: d4bb668e69155459e1b69ce954f9b8434a9dfa5e92dbf5e1324e9a1d50514c2e7b6b34e513f5fcb3621f5ba7b2b2dee5d7dea1cf37788ffe198869f5d7a3a0a4
6
+ metadata.gz: d3c2e0296f88ae875f19043e322678aa9a7ea3a26e9bb41f9f4292991ff09a6a50022d03c1da48b36e0c724c2e9e83f70ef431e1b9a3fc628507774a8de32943
7
+ data.tar.gz: a86038ca1acc515dd05df9f86d014cef337c5cc8a70847a15dd94b8f86fe2233c5b0a49be988f26a3da86f298d1aa27465aab4fb904ddd8eeef9e16535291d99
data/README.md CHANGED
@@ -29,6 +29,7 @@ And then execute:
29
29
  type azure-storage-append-blob
30
30
 
31
31
  azure_cloud <azure cloud environment>
32
+ azure_storage_dns_suffix <your azure storage dns suffix> # only used for Azure Stack Cloud
32
33
  azure_storage_account <your azure storage account>
33
34
  azure_storage_access_key <your azure storage access key> # leave empty to use MSI
34
35
  azure_storage_connection_string <your azure storage connection string> # leave empty to use MSI
@@ -59,6 +60,12 @@ Default: `AZUREPUBLICCLOUD`
59
60
 
60
61
  Cloud environment used to determine the storage endpoint suffix to use, see [here](https://github.com/Azure/go-autorest/blob/master/autorest/azure/environments.go).
61
62
 
63
+ Use `AZURESTACKCLOUD` for Azure Stack Cloud.
64
+
65
+ ### `azure_storage_dns_suffix` (Required only for Azure Stack Cloud)
66
+
67
+ Your Azure Storage endpoint suffix. This can be retrieved from Azure Storage connection string, `EndpointSuffix` section.
68
+
62
69
  ### `azure_storage_account` (Required)
63
70
 
64
71
  Your Azure Storage Account Name. This can be retrieved from Azure Management portal.
@@ -72,11 +79,11 @@ If all are empty, the plugin will use the local Managed Identity endpoint to obt
72
79
 
73
80
  ### `azure_imds_api_version` (Optional, only for MSI)
74
81
 
75
- Default: `2019-08-15`
82
+ Default: `2020-12-01`
76
83
 
77
84
  The Instance Metadata Service is used during the OAuth flow to obtain an access token. This API is versioned and specifying the version is mandatory.
78
85
 
79
- See [here](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/instance-metadata-service#versioning) for more details.
86
+ See [here](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/instance-metadata-service?tabs=windows#versioning) for more details.
80
87
 
81
88
  ### `azure_token_refresh_interval` (Optional, only for MSI)
82
89
 
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = 'fluent-plugin-azure-storage-append-blob-lts'
6
- spec.version = '0.6.2'
6
+ spec.version = '0.6.3'
7
7
  spec.authors = ['Jonas-Taha El Sesiy']
8
8
  spec.email = ['github@elsesiy.com']
9
9
 
@@ -36,11 +36,12 @@ module Fluent
36
36
  config_param :azure_storage_account, :string, default: nil
37
37
  config_param :azure_storage_access_key, :string, default: nil, secret: true
38
38
  config_param :azure_storage_connection_string, :string, default: nil, secret: true
39
+ config_param :azure_storage_dns_suffix, :string, default: nil
39
40
  config_param :azure_storage_sas_token, :string, default: nil, secret: true
40
41
  config_param :azure_cloud, :string, default: 'AZUREPUBLICCLOUD'
41
42
  config_param :azure_msi_client_id, :string, default: nil
42
43
  config_param :azure_container, :string, default: nil
43
- config_param :azure_imds_api_version, :string, default: '2019-08-15'
44
+ config_param :azure_imds_api_version, :string, default: '2020-12-01'
44
45
  config_param :azure_token_refresh_interval, :integer, default: 60
45
46
  config_param :azure_object_key_format, :string, default: '%{path}%{time_slice}-%{index}.log'
46
47
  config_param :auto_create_container, :bool, default: true
@@ -75,9 +76,15 @@ module Fluent
75
76
  end
76
77
  end
77
78
 
78
- @azure_storage_dns_suffix = @storage_endpoint_mapping[@azure_cloud]
79
- if @azure_storage_dns_suffix.nil?
80
- raise ConfigError 'azure_cloud invalid, must be either of AZURECHINACLOUD, AZUREGERMANCLOUD, AZUREPUBLICCLOUD, AZUREUSGOVERNMENTCLOUD'
79
+ if @azure_cloud == 'AZURESTACKCLOUD'
80
+ if @azure_storage_dns_suffix.nil?
81
+ raise ConfigError, 'azure_storage_dns_suffix invalid, must not be empty for AZURESTACKCLOUD'
82
+ end
83
+ else
84
+ @azure_storage_dns_suffix = @storage_endpoint_mapping[@azure_cloud]
85
+ if @azure_storage_dns_suffix.nil?
86
+ raise ConfigError, 'azure_cloud invalid, must be either of AZURECHINACLOUD, AZUREGERMANCLOUD, AZUREPUBLICCLOUD, AZUREUSGOVERNMENTCLOUD, AZURESTACKCLOUD'
87
+ end
81
88
  end
82
89
 
83
90
  if (@azure_storage_access_key.nil? || @azure_storage_access_key.empty?) &&
@@ -34,6 +34,16 @@ class AzureStorageAppendBlobOutTest < Test::Unit::TestCase
34
34
  path log
35
35
  ).freeze
36
36
 
37
+ AZURESTACKCLOUD_CONFIG = %(
38
+ azure_cloud AZURESTACKCLOUD
39
+ azure_storage_dns_suffix test.storage.dns.suffix
40
+ azure_storage_account test_storage_account
41
+ azure_storage_access_key MY_FAKE_SECRET
42
+ azure_container test_container
43
+ time_slice_format %Y%m%d-%H
44
+ path log
45
+ ).freeze
46
+
37
47
  def create_driver(conf: CONFIG, service: nil)
38
48
  d = Fluent::Test::Driver::Output.new(Fluent::Plugin::AzureStorageAppendBlobOut).configure(conf)
39
49
  d.instance.instance_variable_set(:@bs, service)
@@ -43,7 +53,7 @@ class AzureStorageAppendBlobOutTest < Test::Unit::TestCase
43
53
 
44
54
  sub_test_case 'test config' do
45
55
  test 'config should reject with no azure container' do
46
- assert_raise Fluent::ConfigError do
56
+ assert_raise Fluent::ConfigError.new('azure_container needs to be specified') do
47
57
  create_driver conf: %(
48
58
  azure_storage_account test_storage_account
49
59
  azure_storage_access_key MY_FAKE_SECRET
@@ -54,6 +64,22 @@ class AzureStorageAppendBlobOutTest < Test::Unit::TestCase
54
64
  end
55
65
  end
56
66
 
67
+ test 'config should reject for invalid cloud ' do
68
+ assert_raise Fluent::ConfigError.new('azure_cloud invalid, must be either of AZURECHINACLOUD, AZUREGERMANCLOUD, AZUREPUBLICCLOUD, AZUREUSGOVERNMENTCLOUD, AZURESTACKCLOUD') do
69
+ create_driver conf: %(
70
+ azure_cloud INVALIDCLOUD
71
+ )
72
+ end
73
+ end
74
+
75
+ test 'config should reject for Azure Stack Cloud with no azure storage dns suffix' do
76
+ assert_raise Fluent::ConfigError.new('azure_storage_dns_suffix invalid, must not be empty for AZURESTACKCLOUD') do
77
+ create_driver conf: %(
78
+ azure_cloud AZURESTACKCLOUD
79
+ )
80
+ end
81
+ end
82
+
57
83
  test 'config with access key should set instance variables' do
58
84
  d = create_driver
59
85
  assert_equal 'core.cloudapi.de', d.instance.instance_variable_get(:@azure_storage_dns_suffix)
@@ -81,6 +107,16 @@ class AzureStorageAppendBlobOutTest < Test::Unit::TestCase
81
107
  assert_equal false, d.instance.instance_variable_get(:@use_msi)
82
108
  assert_equal true, d.instance.auto_create_container
83
109
  end
110
+
111
+ test 'config for Azure Stack Cloud should set instance variables' do
112
+ d = create_driver conf: AZURESTACKCLOUD_CONFIG
113
+ assert_equal 'test.storage.dns.suffix', d.instance.instance_variable_get(:@azure_storage_dns_suffix)
114
+ assert_equal 'test_storage_account', d.instance.azure_storage_account
115
+ assert_equal 'MY_FAKE_SECRET', d.instance.azure_storage_access_key
116
+ assert_equal 'test_container', d.instance.azure_container
117
+ assert_equal true, d.instance.auto_create_container
118
+ assert_equal '%{path}%{time_slice}-%{index}.log', d.instance.azure_object_key_format
119
+ end
84
120
  end
85
121
 
86
122
  sub_test_case 'test path slicing' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-azure-storage-append-blob-lts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas-Taha El Sesiy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-04 00:00:00.000000000 Z
11
+ date: 2021-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler