configgin 0.20.1 → 0.20.1.1
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/configgin.rb +13 -4
- data/lib/configgin/version.rb +1 -1
- data/lib/kube_link_generator.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 4c7414ca5ae185e043c4b5e085cd3d32bbd45e18f69faf400a35c30902ac56b8
         | 
| 4 | 
            +
              data.tar.gz: 663a9ce843fea21f5395ab635c5636808905e12174a07260d488cdb0d489dfe0
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 18be60efb06a4b567b03a2d6ff1561495629e27cdc99f9417521146ac1a544d9b1be23a09cd077a544958b639a578e3d8e6787734cb856a1333c86e4b83647c3
         | 
| 7 | 
            +
              data.tar.gz: 96099aab13ec542bb195dc4ca6f63cc4fc374a68fe05f6101c85b134e2e7f2cc7efbf5e67ba8e83e856071ae0316e82511f05eebd922b698841c4301b43932ff
         | 
    
        data/Gemfile.lock
    CHANGED
    
    
    
        data/lib/configgin.rb
    CHANGED
    
    | @@ -71,7 +71,8 @@ class Configgin | |
| 71 71 | 
             
              def export_job_properties(jobs)
         | 
| 72 72 | 
             
                # Co-located containers don't get to export properties.
         | 
| 73 73 | 
             
                return unless instance_group == ENV["KUBERNETES_CONTAINER_NAME"]
         | 
| 74 | 
            -
                # Jobs (errands) don't export properties.
         | 
| 74 | 
            +
                # Jobs (errands) and unowned pods (tests) don't export properties.
         | 
| 75 | 
            +
                return unless self_pod['metadata']['ownerReferences']
         | 
| 75 76 | 
             
                return unless self_pod['metadata']['ownerReferences'][0]['kind'] == "StatefulSet"
         | 
| 76 77 |  | 
| 77 78 | 
             
                sts = kube_client_stateful_set.get_stateful_set(instance_group, kube_namespace)
         | 
| @@ -101,12 +102,12 @@ class Configgin | |
| 101 102 |  | 
| 102 103 | 
             
                # version tag changes whenever the chart version or the secrets generation changes
         | 
| 103 104 | 
             
                version_tag = ENV["CONFIGGIN_VERSION_TAG"]
         | 
| 104 | 
            -
                new_tag = !secret.data | 
| 105 | 
            +
                new_tag = !secret.data[version_tag]
         | 
| 105 106 | 
             
                secret.data = {version_tag => ""} if new_tag # make sure old properties are deleted during upgrade
         | 
| 106 107 |  | 
| 107 108 | 
             
                digests = {}
         | 
| 108 109 | 
             
                jobs.each do |name, job|
         | 
| 109 | 
            -
                  secret.data["skiff-exported-properties-#{name}"] = Base64. | 
| 110 | 
            +
                  secret.data["skiff-exported-properties-#{name}"] = Base64.strict_encode64(job.exported_properties.to_json)
         | 
| 110 111 | 
             
                  digests[name] = property_digest(job.exported_properties)
         | 
| 111 112 |  | 
| 112 113 | 
             
                  # Record initial digest values whenever the tag changes, in which case the pod startup
         | 
| @@ -114,9 +115,10 @@ class Configgin | |
| 114 115 | 
             
                  # tags in the corresponding secrets. There is no annotation when importing this set of
         | 
| 115 116 | 
             
                  # initial values because the helm chart doesn't include any annotations, and we don't
         | 
| 116 117 | 
             
                  # want to trigger a pod restart by adding them.
         | 
| 117 | 
            -
                  encoded_digest = Base64. | 
| 118 | 
            +
                  encoded_digest = Base64.strict_encode64(digests[name])
         | 
| 118 119 | 
             
                  if new_tag
         | 
| 119 120 | 
             
                    secret.data["skiff-initial-digest-#{name}"] = encoded_digest
         | 
| 121 | 
            +
                    secret.data["skiff-initial-properties-#{name}"] = secret.data["skiff-exported-properties-#{name}"]
         | 
| 120 122 | 
             
                  end
         | 
| 121 123 | 
             
                  if secret.data["skiff-initial-digest-#{name}"] == encoded_digest
         | 
| 122 124 | 
             
                    digests[name] = nil
         | 
| @@ -124,6 +126,11 @@ class Configgin | |
| 124 126 | 
             
                end
         | 
| 125 127 | 
             
                kube_client.update_secret(secret)
         | 
| 126 128 |  | 
| 129 | 
            +
                warn "new_tag=#{new_tag}"
         | 
| 130 | 
            +
                secret.data.to_h.each_pair do |key, value|
         | 
| 131 | 
            +
                  warn "secret.data[#{key}]=#{value}"
         | 
| 132 | 
            +
                end
         | 
| 133 | 
            +
             | 
| 127 134 | 
             
                # Some pods might depend on the properties exported by this pod; add annotations
         | 
| 128 135 | 
             
                # to the template spec of the stateful sets so that the pods will be restarted if
         | 
| 129 136 | 
             
                # the exported values have changed from the initial values.
         | 
| @@ -154,9 +161,11 @@ class Configgin | |
| 154 161 | 
             
                  # only restarts pods when the checksum of the pod spec changes, so no-op "updates" are ok.
         | 
| 155 162 | 
             
                  annotations = {}
         | 
| 156 163 | 
             
                  sts.spec.template.metadata.annotations.each_pair do |key, value|
         | 
| 164 | 
            +
                    warn "Copying old annotation #{key}=#{value}"
         | 
| 157 165 | 
             
                    annotations[key] = value
         | 
| 158 166 | 
             
                  end
         | 
| 159 167 | 
             
                  digests.each_pair do |key, value|
         | 
| 168 | 
            +
                    warn "Setting new annotation #{key}=#{value}"
         | 
| 160 169 | 
             
                    annotations[key] = value
         | 
| 161 170 | 
             
                  end
         | 
| 162 171 |  | 
    
        data/lib/configgin/version.rb
    CHANGED
    
    
    
        data/lib/kube_link_generator.rb
    CHANGED
    
    | @@ -81,7 +81,7 @@ class KubeLinkSpecs | |
| 81 81 | 
             
                # tag in the corresponding secret.
         | 
| 82 82 | 
             
                secret = client.get_secret(role_name, namespace)
         | 
| 83 83 | 
             
                begin
         | 
| 84 | 
            -
                  JSON.parse(Base64. | 
| 84 | 
            +
                  JSON.parse(Base64.strict_decode64(secret.data["skiff-exported-properties-#{job_name}"]))
         | 
| 85 85 | 
             
                rescue
         | 
| 86 86 | 
             
                  puts "Role #{role_name} is missing skiff-exported-properties-#{job_name}"
         | 
| 87 87 | 
             
                  fail
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: configgin
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.20.1
         | 
| 4 | 
            +
              version: 0.20.1.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - SUSE
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2019-12- | 
| 11 | 
            +
            date: 2019-12-18 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         |