Skip to content
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

wrap into string #1295

Merged
merged 1 commit into from
Jul 18, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion source/plugins/ruby/KubernetesApiClient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ def getKubeResourceInfoV2(resource, api_group: nil)
response = http.request(kubeApiRequest)
responseCode = response.code
@Log.info "KubernetesAPIClient::getKubeResourceInfoV2 : Got response of #{response.code} for #{uri.request_uri} @ #{Time.now.utc.iso8601}"

# Send telemetry for response code if not success
if !response.nil? && !response.code.nil? && !response.code.start_with?("2")
@@K8sApiResponseTelemetryTimeTracker = ApplicationInsightsUtility.sendAPIResponseTelemetry(response.code, resource, "K8sAPIStatus", @@K8sApiResponseCodeHash, @@K8sApiResponseTelemetryTimeTracker)
Expand Down Expand Up @@ -213,6 +212,7 @@ def getClusterName(env = ENV)
end
end
end
@@ClusterName = "#{@@ClusterName}"
rescue => error
@Log.warn("getClusterName failed: #{error}")
end
Expand All @@ -231,6 +231,7 @@ def getClusterId(env = ENV)
if cluster && !cluster.nil? && !cluster.empty?
@@ClusterId = cluster
end
@@ClusterId = "#{@@ClusterId}"
rescue => error
@Log.warn("getClusterId failed: #{error}")
end
Expand Down
5 changes: 3 additions & 2 deletions source/plugins/ruby/oms_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RetryRequestException < Exception
end

class Common
require 'socket'
require 'socket'
require_relative 'omslog'

@@Hostname = nil
Expand Down Expand Up @@ -114,7 +114,7 @@ def validate_hostname_equivalent(hnBuffer)
# we are otherwise instructed.
rfcl = "RFCs 1123, 2181 with hostname range of {1,63} octets for non-root item."
return if is_hostname_compliant?(hnBuffer)
return if is_like_ipv4_string?(hnBuffer)
return if is_like_ipv4_string?(hnBuffer)
return if is_like_ipv6_string?(hnBuffer)
msg = "Hostname '#{hnBuffer}' not compliant (#{rfcl}). Not IP Address Either."
OMS::Log.warn_once(msg)
Expand All @@ -136,6 +136,7 @@ def get_hostname(ignoreOldValue = false)
rescue => error
OMS::Log.warn_once("Hostname '#{@@Hostname}' found, but did NOT validate as compliant. #{error}. Using anyway.")
end
@@Hostname = "#{@@Hostname}"
return @@Hostname
end
end # Class methods
Expand Down
Loading