#!/bin/bash # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. set -ex : "${HELM_VERSION:="v3.6.3"}" : "${KUBE_VERSION:="v1.22.0"}" : "${MINIKUBE_VERSION:="v1.22.0"}" : "${CALICO_VERSION:="v3.20"}" : "${YQ_VERSION:="v4.6.0"}" : "${HTTP_PROXY:=""}" : "${HTTPS_PROXY:=""}" : "${NO_PROXY:=""}" export DEBCONF_NONINTERACTIVE_SEEN=true export DEBIAN_FRONTEND=noninteractive sudo swapoff -a # Note: Including fix from https://review.opendev.org/c/openstack/openstack-helm-infra/+/763619/ echo "DefaultLimitMEMLOCK=16384" | sudo tee -a /etc/systemd/system.conf sudo systemctl daemon-reexec # Function to help generate a resolv.conf formatted file. # Arguments are positional: # 1st is location of file to be generated # 2nd is a custom nameserver that should be used exclusively if avalible. function generate_resolvconf() { local target target="${1}" local priority_nameserver priority_nameserver="${2}" if [[ ${priority_nameserver} ]]; then sudo -E tee "${target}" <