Skip to content

Commit

Permalink
Update hack/versions
Browse files Browse the repository at this point in the history
So that we don't have to run terraform fmt after updating the versions
file
  • Loading branch information
errm committed Nov 2, 2023
1 parent 0d1cb38 commit 6064beb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions hack/versions
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ unless K8S_VERSION
end

ADDONS = %w(vpc-cni kube-proxy coredns aws-ebs-csi-driver)
PADDING = ADDONS.map(&:size).max

def pad(string)
string.ljust(PADDING)
end

addons = []

Expand All @@ -24,14 +29,16 @@ ADDONS.each do |addon|
end

puts <<-VERSION
# Run hack/versions k8sVersionNumber > versions.tf
# to generate the latest values for this
locals {
versions = {
k8s = "#{K8S_VERSION}"
#{pad("k8s")} = "#{K8S_VERSION}"
VERSION

addons.each do |addon|
puts <<-VERSION
#{addon["addonName"].gsub("-", "_")} = "#{addon["addonVersions"].map { |version| version["addonVersion"] }.sort.last}"
#{pad(addon["addonName"].gsub("-", "_"))} = "#{addon["addonVersions"].map { |version| version["addonVersion"] }.sort.last}"
VERSION
end

Expand Down

0 comments on commit 6064beb

Please sign in to comment.