From c610d9423185c576b15496fd62ea043ee2fb7850 Mon Sep 17 00:00:00 2001 From: ederst Date: Tue, 31 Aug 2021 13:14:41 +0200 Subject: [PATCH 1/5] Adapt CI and release workflow --- .github/workflows/check-pr.yml | 40 ++++++++ .github/workflows/main.yml | 172 +++++++++++++++++++++++---------- tools/get_version.sh | 1 + 3 files changed, 164 insertions(+), 49 deletions(-) create mode 100644 .github/workflows/check-pr.yml diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml new file mode 100644 index 0000000000000..df06cb037638d --- /dev/null +++ b/.github/workflows/check-pr.yml @@ -0,0 +1,40 @@ +name: Check PR +on: + pull_request: + types: + - opened + - edited + - labeled + - unlabeled + - reopened + - synchronize + branches: + - 'master*' + - 'release*' + +jobs: + check-pr: + name: Check PR + runs-on: ubuntu-latest + steps: + - name: Check commit messages for WIP + uses: gsactions/commit-message-checker@v1 + with: + pattern: '^(?!WIP)' + flags: 'gmi' + error: Work in progress + checkAllCommitMessages: true + accessToken: ${{ secrets.GITHUB_TOKEN }} + + - name: Check PR labels + uses: jesusvasquez333/verify-pr-label-action@v1.4.0 + with: + valid-labels: 'merge' + invalid-labels: 'do-not-merge, wip, wait-before-merge' + disable-reviews: true + github-token: '${{ secrets.GITHUB_TOKEN }}' + + - name: Enable auto merge + uses: alexwilson/enable-github-automerge-action@main + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6245319eb981e..e6f26f45e6787 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,9 +1,16 @@ ---- name: CI -"on": - - push - - pull_request +on: + push: + tags: + - "*" + branches: + - "master*" + - "release*" + pull_request: + branches: + - "master*" + - "release*" env: GOPROXY: https://proxy.golang.org @@ -13,81 +20,114 @@ permissions: contents: read jobs: - build-linux: - strategy: - matrix: - os: - - name: Linux-amd64 - runs-on: ubuntu-24.04 - arch: amd64 - - name: Linux-arm64 - runs-on: ubuntu-24.04-arm - arch: arm64 - name: build-linux-${{ matrix.os.arch }} - runs-on: ${{ matrix.os.runs-on }} + changes: + runs-on: ubuntu-24.04 + outputs: + src: ${{ steps.filter.outputs.src }} steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + + - name: Detect changes + uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + src: + - '!.github/**' + + build-linux-amd64: + needs: changes + if: ${{ needs.changes.outputs.src == 'true' || startsWith(github.ref, 'refs/tags/') }} + runs-on: ubuntu-24.04 + steps: + - name: Checkout full + if: startsWith(github.ref, 'refs/tags/') + run: | + git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} -b ${GITHUB_REF#refs/tags/} ${{ env.GOPATH }}/src/k8s.io/kops + + - name: Checkout shallow + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + if: startsWith(github.ref, 'refs/tags/') == false with: path: ${{ env.GOPATH }}/src/k8s.io/kops - - name: Set up go uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 with: go-version-file: "${{ env.GOPATH }}/src/k8s.io/kops/go.mod" - - name: make all examples test + - name: Make all examples test working-directory: ${{ env.GOPATH }}/src/k8s.io/kops run: | make all examples test + - name: Upload Linux binaries + if: startsWith(github.ref, 'refs/tags/') + uses: actions/upload-artifact@v4 + with: + name: kops-linux-amd64 + path: ${{ env.GOPATH }}/src/k8s.io/kops/.build/dist/linux/amd64/* + if-no-files-found: error + retention-days: 1 + build-macos-amd64: + needs: changes + if: ${{ needs.changes.outputs.src == 'true' || startsWith(github.ref, 'refs/tags/') }} runs-on: macos-latest steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: Checkout full + if: startsWith(github.ref, 'refs/tags/') + run: | + git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} -b ${GITHUB_REF#refs/tags/} ${{ env.GOPATH }}/src/k8s.io/kops + + - name: Checkout shallow + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + if: startsWith(github.ref, 'refs/tags/') == false with: path: ${{ env.GOPATH }}/src/k8s.io/kops - name: Set up go - uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 + uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed with: - go-version-file: "${{ env.GOPATH }}/src/k8s.io/kops/go.mod" + go-version-file: '${{ env.GOPATH }}/src/k8s.io/kops/go.mod' - - name: make kops examples test + # Build and upload arm64 + - name: Make kops examples test (arm64) working-directory: ${{ env.GOPATH }}/src/k8s.io/kops run: | - make kops examples test + GOARCH=arm64 make kops examples test - build-windows-amd64: - runs-on: windows-2022 - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: Upload kops MacOS binary (arm64) + if: startsWith(github.ref, 'refs/tags/') + uses: actions/upload-artifact@v4 with: - path: ${{ env.GOPATH }}/src/k8s.io/kops + name: kops-darwin-arm64 + path: ${{ env.GOPATH }}/src/k8s.io/kops/.build/dist/darwin/arm64/kops + if-no-files-found: error + retention-days: 1 - - name: Set up go - uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 - with: - go-version-file: "${{ env.GOPATH }}/src/k8s.io/kops/go.mod" - - - name: make kops examples test + # Build and upload amd64 + - name: Make kops examples test (amd64) working-directory: ${{ env.GOPATH }}/src/k8s.io/kops run: | - make kops examples test-windows + GOARCH=amd64 make kops + + - name: Upload kops MacOS binary (amd64) + if: startsWith(github.ref, 'refs/tags/') + uses: actions/upload-artifact@v4 + with: + name: kops-darwin-amd64 + path: ${{ env.GOPATH }}/src/k8s.io/kops/.build/dist/darwin/amd64/kops + if-no-files-found: error + retention-days: 1 verify: - strategy: - matrix: - os: - - name: Linux-amd64 - runs-on: ubuntu-24.04 - arch: amd64 - - name: Linux-arm64 - runs-on: ubuntu-24.04-arm - arch: arm64 - name: verify-${{ matrix.os.arch }} - runs-on: ${{ matrix.os.runs-on }} + needs: changes + if: ${{ needs.changes.outputs.src == 'true' || startsWith(github.ref, 'refs/tags/') }} + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: path: ${{ env.GOPATH }}/src/k8s.io/kops @@ -96,7 +136,41 @@ jobs: with: go-version-file: "${{ env.GOPATH }}/src/k8s.io/kops/go.mod" - - name: make quick-ci + - name: Make quick-ci working-directory: ${{ env.GOPATH }}/src/k8s.io/kops run: | make quick-ci + + release: + runs-on: ubuntu-24.04 + if: startsWith(github.ref, 'refs/tags/') + permissions: + contents: write + needs: + - build-linux-amd64 + - build-macos-amd64 + - verify + steps: + - name: Download all binary artifacts + uses: actions/download-artifact@v4 + + - name: Rename kops binary artifacts + run: | + mv kops-darwin-amd64/kops kops-darwin-amd64/kops-darwin-amd64 + mv kops-darwin-arm64/kops kops-darwin-arm64/kops-darwin-arm64 + mv kops-linux-amd64/kops kops-linux-amd64/kops-linux-amd64 + mv kops-linux-amd64/channels kops-linux-amd64/channels-linux-amd64 + mv kops-linux-amd64/protokube kops-linux-amd64/protokube-linux-amd64 + mv kops-linux-amd64/nodeup kops-linux-amd64/nodeup-linux-amd64 + + - name: Release + uses: softprops/action-gh-release@v2 + with: + fail_on_unmatched_files: true + files: | + kops-darwin-amd64/kops-darwin-amd64 + kops-darwin-arm64/kops-darwin-arm64 + kops-linux-amd64/kops-linux-amd64 + kops-linux-amd64/channels-linux-amd64 + kops-linux-amd64/protokube-linux-amd64 + kops-linux-amd64/nodeup-linux-amd64 diff --git a/tools/get_version.sh b/tools/get_version.sh index 1c709b0581878..5d48abc062529 100755 --- a/tools/get_version.sh +++ b/tools/get_version.sh @@ -36,6 +36,7 @@ if [[ -n "${CI}" ]]; then EXACT_TAG=$(git describe --tags --exact-match 2>/dev/null || true) if [[ -n "${EXACT_TAG}" ]]; then VERSION="${EXACT_TAG#v}" # Remove the v prefix from the git tag + VERSION="${VERSION//-bp*/}" # remove the bearingpoint version from the tag if [[ "${VERSION}" != "${KOPS_RELEASE_VERSION}" ]]; then echo "Build was tagged with ${VERSION}, but kops-version.go had version ${KOPS_RELEASE_VERSION}" exit 1 From f33a761c7ac121f96a870209e24fe647f7ee0270 Mon Sep 17 00:00:00 2001 From: ederst Date: Mon, 11 Jul 2022 16:28:54 +0200 Subject: [PATCH 2/5] WIP: Configure IPv6 for Calico --- .../k8s-1.25.yaml.template | 4 ++-- .../networking.projectcalico.org/k8s-1.25.yaml.template | 8 +++++--- upup/pkg/fi/cloudup/template_functions.go | 7 +++++++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/upup/models/cloudup/resources/addons/networking.projectcalico.org.canal/k8s-1.25.yaml.template b/upup/models/cloudup/resources/addons/networking.projectcalico.org.canal/k8s-1.25.yaml.template index 8ec49c94ae6dd..7030292802cb8 100644 --- a/upup/models/cloudup/resources/addons/networking.projectcalico.org.canal/k8s-1.25.yaml.template +++ b/upup/models/cloudup/resources/addons/networking.projectcalico.org.canal/k8s-1.25.yaml.template @@ -4843,14 +4843,14 @@ spec: operator: Exists - key: kubernetes.io/os operator: In - values: + values: - linux - matchExpressions: - key: node-role.kubernetes.io/master operator: Exists - key: kubernetes.io/os operator: In - values: + values: - linux tolerations: # Mark the pod as a critical add-on for rescheduling. diff --git a/upup/models/cloudup/resources/addons/networking.projectcalico.org/k8s-1.25.yaml.template b/upup/models/cloudup/resources/addons/networking.projectcalico.org/k8s-1.25.yaml.template index f4d8cfbb991d8..19b670ce7ad43 100644 --- a/upup/models/cloudup/resources/addons/networking.projectcalico.org/k8s-1.25.yaml.template +++ b/upup/models/cloudup/resources/addons/networking.projectcalico.org/k8s-1.25.yaml.template @@ -102,7 +102,7 @@ data: "mtu": __CNI_MTU__, "ipam": { "assign_ipv4": "{{ not IsIPv6Only }}", - "assign_ipv6": "{{ IsIPv6Only }}", + "assign_ipv6": "{{ CalicoUseIPv6 }}", {{- if IsIPv6Only }} "type": "host-local", "ranges": [[{ "subnet": "usePodCidrIPv6" }]] @@ -6327,7 +6327,7 @@ spec: - name: IP value: "{{- if not IsIPv6Only -}}autodetect{{- else -}}none{{- end -}}" - name: IP6 - value: "{{- if IsIPv6Only -}}autodetect{{- else -}}none{{- end -}}" + value: "{{- if CalicoUseIPv6 -}}autodetect{{- else -}}none{{- end -}}" {{- if IsIPv6Only }} - name: IP_AUTODETECTION_METHOD value: "{{- or .Networking.Calico.IPv4AutoDetectionMethod "none" }}" @@ -6377,6 +6377,8 @@ spec: {{- else }} - name: CALICO_IPV4POOL_CIDR value: "{{ .KubeControllerManager.ClusterCIDR }}" + - name: CALICO_IPV6POOL_NAT_OUTGOING + value: "{{- CalicoUseIPv6 }}" {{- end }} # Disable file logging so `kubectl logs` works. - name: CALICO_DISABLE_FILE_LOGGING @@ -6386,7 +6388,7 @@ spec: value: "ACCEPT" # Set IPv6 on Kubernetes. - name: FELIX_IPV6SUPPORT - value: "{{ IsIPv6Only }}" + value: "{{ CalicoUseIPv6 }}" - name: FELIX_HEALTHENABLED value: "true" diff --git a/upup/pkg/fi/cloudup/template_functions.go b/upup/pkg/fi/cloudup/template_functions.go index 0ae70874b27d9..a200339e01dc0 100644 --- a/upup/pkg/fi/cloudup/template_functions.go +++ b/upup/pkg/fi/cloudup/template_functions.go @@ -312,6 +312,13 @@ func (tf *TemplateFunctions) AddTo(dest template.FuncMap, secretStore fi.SecretS } return "Never" } + dest["CalicoUseIPv6"] = func() bool { + // TODO: + // In the templates this is done: + // value: "{{- or .Networking.Calico.IPv6AutoDetectionMethod "none" }}" + // But doc states that default is "first-found", so this might not work like expected (IPv6 always on) + return cluster.Spec.IsIPv6Only() || (c.IPv6AutoDetectionMethod != "" && c.IPv6AutoDetectionMethod != "none") + } } if cluster.Spec.Networking.Cilium != nil { From 8e63e7011af6cfe9511ad96079989b0b30d6636c Mon Sep 17 00:00:00 2001 From: ederst Date: Tue, 4 Feb 2025 13:00:47 +0100 Subject: [PATCH 3/5] Run hack/update-expected --- ...s3_object_privatecalico.example.com-addons-bootstrap_content | 2 +- ...ple.com-addons-networking.projectcalico.org-k8s-1.25_content | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/integration/update_cluster/privatecalico/data/aws_s3_object_privatecalico.example.com-addons-bootstrap_content b/tests/integration/update_cluster/privatecalico/data/aws_s3_object_privatecalico.example.com-addons-bootstrap_content index 794c236bcf052..d5cda8fc87b1e 100644 --- a/tests/integration/update_cluster/privatecalico/data/aws_s3_object_privatecalico.example.com-addons-bootstrap_content +++ b/tests/integration/update_cluster/privatecalico/data/aws_s3_object_privatecalico.example.com-addons-bootstrap_content @@ -99,7 +99,7 @@ spec: version: 9.99.0 - id: k8s-1.25 manifest: networking.projectcalico.org/k8s-1.25.yaml - manifestHash: f16968ad43bb21350e5b985ef6137cda40767f6a06509ec9b05e6b1e80b60301 + manifestHash: 7ac921f8b7527a44d91610a9a81160873f2246d8e474cd63cda0ad52e2c3b8a0 name: networking.projectcalico.org prune: kinds: diff --git a/tests/integration/update_cluster/privatecalico/data/aws_s3_object_privatecalico.example.com-addons-networking.projectcalico.org-k8s-1.25_content b/tests/integration/update_cluster/privatecalico/data/aws_s3_object_privatecalico.example.com-addons-networking.projectcalico.org-k8s-1.25_content index f5cb92679626e..c446051ab68c8 100644 --- a/tests/integration/update_cluster/privatecalico/data/aws_s3_object_privatecalico.example.com-addons-networking.projectcalico.org-k8s-1.25_content +++ b/tests/integration/update_cluster/privatecalico/data/aws_s3_object_privatecalico.example.com-addons-networking.projectcalico.org-k8s-1.25_content @@ -6294,6 +6294,8 @@ spec: name: calico-config - name: CALICO_IPV4POOL_CIDR value: 100.96.0.0/11 + - name: CALICO_IPV6POOL_NAT_OUTGOING + value: "false" - name: CALICO_DISABLE_FILE_LOGGING value: "true" - name: FELIX_DEFAULTENDPOINTTOHOSTACTION From 2c987d2aad3e0341f9d60608d68ae966083585ca Mon Sep 17 00:00:00 2001 From: ederst Date: Tue, 26 Nov 2024 18:15:20 +0100 Subject: [PATCH 4/5] WIP: Determine ports to delete based on tags --- upup/pkg/fi/cloudup/openstack/cloud.go | 45 +++++++++++++++++++------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/upup/pkg/fi/cloudup/openstack/cloud.go b/upup/pkg/fi/cloudup/openstack/cloud.go index e4e274e8a20b2..75436116f4ddb 100644 --- a/upup/pkg/fi/cloudup/openstack/cloud.go +++ b/upup/pkg/fi/cloudup/openstack/cloud.go @@ -617,6 +617,37 @@ func InstanceInClusterAndIG(instance servers.Server, clusterName string, instanc return true } +func deletePorts(c OpenstackCloud, instanceGroupName string, clusterName string) error { + tags := []string{ + fmt.Sprintf("%s=%s", TagClusterName, clusterName), + fmt.Sprintf("%s=%s", TagKopsInstanceGroup, instanceGroupName), + } + + ports, err := c.ListPorts(ports.ListOpts{Tags: strings.Join(tags, ",")}) + if err != nil { + return fmt.Errorf("could not list ports %v", err) + } + + for _, port := range ports { + // previous approach was problematic: + // for example in case there is a group called "worker" and "worker-2", it will delete ports of "worker" as well, + // because there might be port names like: + // * "port-worker-2-" + // * "port-worker-20-" + klog.V(2).Infof("Delete port '%s' (%s)", port.Name, port.ID) + err := c.DeletePort(port.ID) + + // TODO: + // really give up after trying to delete one port? other ports will be orphaned + // better to try all ports and collect errors? + if err != nil { + return fmt.Errorf("could not delete port %q: %v", port.ID, err) + } + } + + return nil +} + func deleteGroup(c OpenstackCloud, g *cloudinstances.CloudInstanceGroup) error { cluster := g.Raw.(*kops.Cluster) allInstances, err := c.ListInstances(servers.ListOpts{ @@ -639,18 +670,10 @@ func deleteGroup(c OpenstackCloud, g *cloudinstances.CloudInstanceGroup) error { return fmt.Errorf("could not delete instance %q: %v", instance.ID, err) } } - ports, err := c.ListPorts(ports.ListOpts{}) - if err != nil { - return fmt.Errorf("could not list ports %v", err) - } - for _, port := range ports { - if strings.HasPrefix(port.Name, fmt.Sprintf("port-%s", g.InstanceGroup.Name)) && fi.ArrayContains(port.Tags, fmt.Sprintf("%s=%s", TagClusterName, cluster.Name)) { - err := c.DeletePort(port.ID) - if err != nil { - return fmt.Errorf("could not delete port %q: %v", port.ID, err) - } - } + err = deletePorts(c, g.InstanceGroup.Name, cluster.Name) + if err != nil { + return err } sgName := g.InstanceGroup.Name From 1f05bc8b6c59861b95618b76c6f238bb6673895e Mon Sep 17 00:00:00 2001 From: ederst Date: Wed, 5 Feb 2025 14:56:42 +0100 Subject: [PATCH 5/5] WIP: include ig assets when running get assets --- cmd/kops/get_assets.go | 7 ++++-- cmd/kops/update_cluster.go | 4 ++++ docs/cli/kops_get_assets.md | 5 +++-- upup/pkg/fi/cloudup/apply_cluster.go | 32 ++++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 4 deletions(-) diff --git a/cmd/kops/get_assets.go b/cmd/kops/get_assets.go index 6afd21fee5745..41b9d0c55f121 100644 --- a/cmd/kops/get_assets.go +++ b/cmd/kops/get_assets.go @@ -49,7 +49,7 @@ var ( kops get assets # Copy assets to the local repositories configured in the cluster spec. - kops get assets --copy + kops get assets --copy `)) getAssetsShort = i18n.T(`Display assets for cluster.`) @@ -57,7 +57,8 @@ var ( type GetAssetsOptions struct { *GetOptions - Copy bool + Copy bool + IncludeIGAssets bool } type Image struct { @@ -96,6 +97,7 @@ func NewCmdGetAssets(f *util.Factory, out io.Writer, getOptions *GetOptions) *co } cmd.Flags().BoolVar(&options.Copy, "copy", options.Copy, "copy assets to local repository") + cmd.Flags().BoolVar(&options.IncludeIGAssets, "include-ig-assets", options.IncludeIGAssets, "include assets of the instance groups") return cmd } @@ -105,6 +107,7 @@ func RunGetAssets(ctx context.Context, f *util.Factory, out io.Writer, options * CoreUpdateClusterOptions: CoreUpdateClusterOptions{ Target: cloudup.TargetDryRun, GetAssets: true, + GetIGAssets: options.IncludeIGAssets, ClusterName: options.ClusterName, }, }) diff --git a/cmd/kops/update_cluster.go b/cmd/kops/update_cluster.go index 8a3d9cfa20d6e..3390c02985b29 100644 --- a/cmd/kops/update_cluster.go +++ b/cmd/kops/update_cluster.go @@ -92,6 +92,9 @@ type CoreUpdateClusterOptions struct { // GetAssets is whether this is invoked from the CmdGetAssets. GetAssets bool + // GetIGAssets is whether this is called to obtain the IG assets as well + GetIGAssets bool + ClusterName string // InstanceGroups is the list of instance groups to update; @@ -374,6 +377,7 @@ func RunUpdateCluster(ctx context.Context, f *util.Factory, out io.Writer, c *Up TargetName: targetName, LifecycleOverrides: lifecycleOverrideMap, GetAssets: c.GetAssets, + GetIGAssets: c.GetIGAssets, DeletionProcessing: deletionProcessing, ControlPlaneRunningVersion: minControlPlaneRunningVersion, } diff --git a/docs/cli/kops_get_assets.md b/docs/cli/kops_get_assets.md index 71c6583ac0350..7e79bfaff0d8c 100644 --- a/docs/cli/kops_get_assets.md +++ b/docs/cli/kops_get_assets.md @@ -30,8 +30,9 @@ kops get assets [CLUSTER] [flags] ### Options ``` - --copy copy assets to local repository - -h, --help help for assets + --copy copy assets to local repository + -h, --help help for assets + --include-ig-assets include assets of the instance groups ``` ### Options inherited from parent commands diff --git a/upup/pkg/fi/cloudup/apply_cluster.go b/upup/pkg/fi/cloudup/apply_cluster.go index c81b2d957490c..5c9652e8a5a93 100644 --- a/upup/pkg/fi/cloudup/apply_cluster.go +++ b/upup/pkg/fi/cloudup/apply_cluster.go @@ -30,6 +30,7 @@ import ( "k8s.io/klog/v2" kopsbase "k8s.io/kops" "k8s.io/kops/pkg/apis/kops" + kopsmodel "k8s.io/kops/pkg/apis/kops/model" "k8s.io/kops/pkg/apis/kops/registry" "k8s.io/kops/pkg/apis/kops/util" "k8s.io/kops/pkg/apis/kops/validation" @@ -126,6 +127,9 @@ type ApplyClusterCmd struct { // GetAssets is whether this is called just to obtain the list of assets. GetAssets bool + // GetIGAssets is whether this is called to obtain the IG assets as well + GetIGAssets bool + // TaskMap is the map of tasks that we built (output) TaskMap map[string]fi.CloudupTask @@ -524,6 +528,34 @@ func (c *ApplyClusterCmd) Run(ctx context.Context) (*ApplyResults, error) { NodeUpAssets: nodeUpAssets.NodeUpAssets, } + // Note(sprietl): + // Include assets of the Instance Groups when getting the Cluster assets + if c.GetIGAssets { + for _, ig := range allInstanceGroups { + igModel, err := kopsmodel.ForInstanceGroup(cluster, ig) + if err != nil { + return nil, fmt.Errorf("building instance group model: %w", err) + } + + // TODO(sprietl): find out if this is relevant here + // if !hasAPIServer && n.assetBuilder.KubeletSupportedVersion != "" { + // // Set kubernetes version to avoid spurious rolling-update + // config.KubernetesVersion = n.assetBuilder.KubeletSupportedVersion + + // // TODO: Rename KubernetesVersion to ControlPlaneVersion + + // if err := igModel.ForceKubernetesVersion(n.assetBuilder.KubeletSupportedVersion); err != nil { + // return nil, nil, err + // } + // } + + _, err = nodemodel.BuildKubernetesFileAssets(igModel, assetBuilder) + if err != nil { + return nil, fmt.Errorf("unable to build k8s file assets: %w", err) + } + } + } + { templates, err := templates.LoadTemplates(ctx, cluster, models.NewAssetPath("cloudup/resources")) if err != nil {