Class: K8y::Kubeconfig::Cluster
- Inherits:
-
Object
- Object
- K8y::Kubeconfig::Cluster
- Defined in:
- lib/k8y/kubeconfig/cluster.rb
Instance Attribute Summary collapse
-
#certificate_authority ⇒ Object
readonly
Returns the value of attribute certificate_authority.
-
#certificate_authority_data ⇒ Object
readonly
Returns the value of attribute certificate_authority_data.
-
#insecure_skip_tls_verify ⇒ Object
readonly
Returns the value of attribute insecure_skip_tls_verify.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name:, insecure_skip_tls_verify:, certificate_authority:, certificate_authority_data:, server:) ⇒ Cluster
constructor
A new instance of Cluster.
Constructor Details
#initialize(name:, insecure_skip_tls_verify:, certificate_authority:, certificate_authority_data:, server:) ⇒ Cluster
Returns a new instance of Cluster.
21 22 23 24 25 26 27 |
# File 'lib/k8y/kubeconfig/cluster.rb', line 21 def initialize(name:, insecure_skip_tls_verify:, certificate_authority:, certificate_authority_data:, server:) @name = name @insecure_skip_tls_verify = insecure_skip_tls_verify @certificate_authority = @certificate_authority_data = @server = server end |
Instance Attribute Details
#certificate_authority ⇒ Object (readonly)
Returns the value of attribute certificate_authority.
6 7 8 |
# File 'lib/k8y/kubeconfig/cluster.rb', line 6 def @certificate_authority end |
#certificate_authority_data ⇒ Object (readonly)
Returns the value of attribute certificate_authority_data.
6 7 8 |
# File 'lib/k8y/kubeconfig/cluster.rb', line 6 def @certificate_authority_data end |
#insecure_skip_tls_verify ⇒ Object (readonly)
Returns the value of attribute insecure_skip_tls_verify.
6 7 8 |
# File 'lib/k8y/kubeconfig/cluster.rb', line 6 def insecure_skip_tls_verify @insecure_skip_tls_verify end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/k8y/kubeconfig/cluster.rb', line 6 def name @name end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
6 7 8 |
# File 'lib/k8y/kubeconfig/cluster.rb', line 6 def server @server end |
Class Method Details
.from_hash(hash) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/k8y/kubeconfig/cluster.rb', line 8 def self.from_hash(hash) cluster = hash.fetch("cluster") new( insecure_skip_tls_verify: cluster.fetch("insecure-skip-tls-verify", false), certificate_authority: cluster.fetch("certificate-authority", nil), certificate_authority_data: cluster.fetch("certificate-authority-data", nil), server: cluster.fetch("server"), name: hash.fetch("name") ) rescue Psych::Exception, KeyError => e raise Error, e end |