fluent-plugin-fluent-package-update-notifier 0.2.2 → 0.2.4

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: d6b58421959b2e9d36929c8ed6bc52139fd830c6147d630de19b019d07f2973e
4
- data.tar.gz: 0a40182ce179a0212d6f4d54ad8a0bc323ee9bb45ee23bc273b6d367d89caed8
3
+ metadata.gz: f4415b49c83f3e66b9a8de69c86c69f0a71a1bff90f6f5800ccdf87aaa80ef9d
4
+ data.tar.gz: a717bd088e0f79f5d94f835503629debba331e3a6b0f606a53007440cae42ecf
5
5
  SHA512:
6
- metadata.gz: 695c738e6b156d46fca6a6b0c4ea2a375f9f1f36d9f16596c6b1cfcc9dccb1da0bbd8da9ce35935532379d3cad7b7745c356a07d7ffd0df477dbb383157694a4
7
- data.tar.gz: 8ae0f486c43f97dc74764b088599520205fef393a0254ec861d5787272de4ee355c93c6c28aad7966fc97cd5f460f271fc1322655d8274b613fdf282fc0721b1
6
+ metadata.gz: a0d17e42755f3fc8ed61d2f976cd19d68c824f6e73e7ea6d60ceabe7edef8c250c5f4c9dbf27c94846a8603ff8e0d85572dd2f22e2bc0a4f274a1ae8c480883a
7
+ data.tar.gz: 204259fd7b172e6821dd034207512a14939b827d7b3508e7efb0712024504b5ebb5276c57b6ddf9781ece57dc1b0bdb7d39581a25cd1b6cda8f467629c7395ff
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # 0.2.4 - 2026-10-19
2
+
3
+ * Fix checking the x64 msi for updates on ARM64 Windows (#26)
4
+ * Fix update check failing with TypeError on the standard channel (#27)
5
+ * Fix update check never finding deb packages on Debian and Ubuntu (#28)
6
+ * Fix update check never finding rpm packages on Red Hat compatible platforms and Amazon Linux (#29)
7
+ * Stop downloading whole packages when checking for updates (#30)
8
+
9
+ # 0.2.3 - 2025-08-28
10
+
11
+ * Remove unnecessary error log (#10)
12
+ * Relax log level (#11)
13
+
1
14
  # 0.2.2 - 2025-08-27
2
15
 
3
16
  * in_fluent_package_update_notifier: support multi worker (#8)
@@ -21,9 +21,10 @@ module Fluent
21
21
  begin
22
22
  require ENV["FLUENT_PACKAGE_CONFIG"] || DEFAULT_PACKAGE_CONFIG_PATH
23
23
  rescue LoadError
24
- @logger.error "Failed to load #{ENV["FLUENT_PACKAGE_CONFIG"] || DEFAULT_PACKAGE_CONFIG_PATH}"
24
+ @logger.info "Failed to load #{ENV["FLUENT_PACKAGE_CONFIG"] || DEFAULT_PACKAGE_CONFIG_PATH}"
25
25
  end
26
26
  @host_os = RbConfig::CONFIG['host_os']
27
+ @host_cpu = RbConfig::CONFIG['host_cpu']
27
28
  Specinfra.configuration.backend = windows? ? :cmd : :exec
28
29
  @os_info = Specinfra.backend.os_info
29
30
  end
@@ -42,7 +43,7 @@ module Fluent
42
43
  end
43
44
 
44
45
  def cached_tags_path
45
- ENV["FLUENT_PACKAGE_TAGS_PATH"] ?
46
+ ENV["FLUENT_PACKAGE_TAGS_PATH"] ?
46
47
  ENV["FLUENT_PACKAGE_TAGS_PATH"] : "#{@tmp_dir}/fluent-package-tags.json"
47
48
  end
48
49
 
@@ -51,20 +52,16 @@ module Fluent
51
52
  end
52
53
 
53
54
  def fetch_tags
54
- begin
55
- if tags_cached?
56
- yield JSON.parse(File.open(cached_tags_path).read)
57
- else
58
- URI.open(release_tags_url) do |resource|
59
- File.open(cached_tags_path, "w+") do |f|
60
- json = resource.read
61
- f.write(json)
62
- yield JSON.parse(json)
63
- end
55
+ if tags_cached?
56
+ yield JSON.parse(File.open(cached_tags_path).read)
57
+ else
58
+ URI.open(release_tags_url) do |resource|
59
+ File.open(cached_tags_path, "w+") do |f|
60
+ json = resource.read
61
+ f.write(json)
62
+ yield JSON.parse(json)
64
63
  end
65
64
  end
66
- rescue => e
67
- @logger.error "Failed to fetch tags", error: e
68
65
  end
69
66
  end
70
67
 
@@ -84,13 +81,15 @@ module Fluent
84
81
  when "debian", "ubuntu"
85
82
  @os_info[:arch] == "x86_64" ? "amd64" : "arm64"
86
83
  when "redhat", "amazon"
87
- @os_info[:arch] == "x86_64" ? "x64_64" : "aarch64"
84
+ @os_info[:arch] == "x86_64" ? "x86_64" : "aarch64"
85
+ when "windows"
86
+ @host_cpu == "aarch64" ? "arm64" : "x64"
88
87
  end
89
88
  end
90
89
 
91
90
  def package_url(prefix, distribution, version)
92
91
  major = version.segments.first
93
- channel = @options[:lts] ? "lts/#{major}" : major
92
+ channel = @options[:lts] ? "lts/#{major}" : major.to_s
94
93
  case distribution
95
94
  when "debian", "ubuntu"
96
95
  codename = @os_info[:codename]
@@ -98,18 +97,17 @@ module Fluent
98
97
  "fluent-package_#{version}-1_#{package_arch}.deb"])
99
98
  when "redhat"
100
99
  major = Gem::Version.new(@os_info[:release]).segments.first
101
- File.join([prefix, channel, distribution, major, package_arch,
102
- "fluent-package_#{version}-1.el#{major}.#{package_arch}.rpm"])
100
+ File.join([prefix, channel, distribution, major.to_s, package_arch,
101
+ "fluent-package-#{version}-1.el#{major}.#{package_arch}.rpm"])
103
102
  when "amazon/2023"
104
103
  File.join([prefix, channel, distribution, package_arch,
105
- "fluent-package_#{version}-1.amzn2023.#{package_arch}.rpm"])
104
+ "fluent-package-#{version}-1.amzn2023.#{package_arch}.rpm"])
106
105
  when "amazon/2"
107
- arch = @os_info[:arch] == "x86_64" ? "x64_64" : "aarch64"
108
106
  File.join([prefix, channel, distribution, package_arch,
109
- "fluent-package_#{version}-1.amzn2.#{package_arch}.rpm"])
107
+ "fluent-package-#{version}-1.amzn2.#{package_arch}.rpm"])
110
108
  when "windows"
111
109
  File.join([prefix, channel, distribution,
112
- "fluent-package-#{version}-x64.msi"])
110
+ "fluent-package-#{version}-#{package_arch}.msi"])
113
111
  end
114
112
  end
115
113
 
@@ -117,8 +115,7 @@ module Fluent
117
115
  if linux?
118
116
  case @os_info[:family]
119
117
  when "debian", "ubuntu"
120
- family_codename = "#{@os_info[:family]}/#{@os_info[:codename]}"
121
- package_url(url_prefix, family_codename, target_version)
118
+ package_url(url_prefix, @os_info[:family], target_version)
122
119
  when "redhat"
123
120
  package_url(url_prefix, "redhat", target_version)
124
121
  when "amazon"
@@ -140,7 +137,9 @@ module Fluent
140
137
  major = target_version.segments.first
141
138
  check_remote_packages(target_version) do |url|
142
139
  begin
143
- URI.open(url)
140
+ # Sec-GPC prevents Scarf Gateway from counting this check as a download
141
+ # https://docs.scarf.sh/gateway/#do-not-track
142
+ URI.open(url, "Range" => "bytes=0-0", "Sec-GPC" => "1")
144
143
  return true
145
144
  rescue => e
146
145
  # package is not available
@@ -176,6 +175,7 @@ module Fluent
176
175
  end
177
176
  end
178
177
  end
178
+ ensure
179
179
  FileUtils.rm_rf(@tmp_dir)
180
180
  end
181
181
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-fluent-package-update-notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kentaro Hayashi
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  - !ruby/object:Gem::Version
81
81
  version: '0'
82
82
  requirements: []
83
- rubygems_version: 3.7.0
83
+ rubygems_version: 4.0.20
84
84
  specification_version: 4
85
85
  summary: Notify latest version of fluent-package
86
86
  test_files: []