Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ca/auth: update Azure token when invalid #1134

Merged
merged 3 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,6 @@ jobs:
# to the tagged commit.
echo "info=$(git describe --tags --long --dirty)" >> $GITHUB_OUTPUT

- name: get CA base git tag
id: get-ca-tag
if: ${{ format('{0}', inputs.build-cluster-autoscaler) == 'true' }}
run: |
echo "tag=$(cat cluster-autoscaler/ca.tag)" >> $GITHUB_OUTPUT

- name: set custom docker config directory
uses: ./.github/actions/set-docker-config-dir

Expand Down Expand Up @@ -307,8 +301,6 @@ jobs:
tags: ${{ needs.tags.outputs.cluster-autoscaler }}
cache-from: type=registry,ref=cache.neon.build/cluster-autoscaler-neonvm:cache
cache-to: ${{ github.ref_name == 'main' && 'type=registry,ref=cache.neon.build/cluster-autoscaler-neonvm:cache,mode=max' || '' }}
build-args: |
CA_GIT_TAG=${{ steps.get-ca-tag.outputs.tag }}

- name: Copy all images to ECR
if: ${{ format('{0}', inputs.upload-to-ecr) == 'true' }}
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/check-ca-builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ jobs:
username: ${{ secrets.NEON_CI_DOCKERCACHE_USERNAME }}
password: ${{ secrets.NEON_CI_DOCKERCACHE_PASSWORD }}

- name: get CA base git tag
id: get-ca-tag
run: |
echo "tag=$(cat cluster-autoscaler/ca.tag)" | tee -a $GITHUB_OUTPUT

- name: Build cluster-autoscaler image
uses: docker/build-push-action@v6
with:
Expand All @@ -45,5 +40,3 @@ jobs:
push: false
file: cluster-autoscaler/Dockerfile
cache-from: type=registry,ref=cache.neon.build/cluster-autoscaler-neonvm:cache
build-args: |
CA_GIT_TAG=${{ steps.get-ca-tag.outputs.tag }}
6 changes: 4 additions & 2 deletions cluster-autoscaler/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ FROM golang:1.20.12 AS builder

WORKDIR /workspace

ARG CA_GIT_TAG
COPY ca.branch ca.branch
COPY ca.commit ca.commit

# Download the repo. It's... quite large, but thankfully this should get cached
RUN git clone --depth=1 -b $CA_GIT_TAG https://github.com/kubernetes/autoscaler
RUN git clone -b `cat ca.branch` https://github.com/kubernetes/autoscaler
RUN CA_GIT_TAG=`cat ca.commit` cd autoscaler && git reset --hard $CA_GIT_TAG

# Only ADD the patch after downloading, to avoid wrecking the cache
COPY ca.patch ca.patch
Expand Down
1 change: 1 addition & 0 deletions cluster-autoscaler/ca.branch
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cluster-autoscaler-release-1.28
1 change: 1 addition & 0 deletions cluster-autoscaler/ca.commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10a229ac17ea8049248d1c3ce2923b94a4f9085c
29 changes: 10 additions & 19 deletions cluster-autoscaler/ca.patch
Original file line number Diff line number Diff line change
@@ -1,44 +1,35 @@
diff --git a/cluster-autoscaler/utils/kubernetes/listers.go b/cluster-autoscaler/utils/kubernetes/listers.go
index 198fdfb37..d534fc1ef 100644
--- a/cluster-autoscaler/utils/kubernetes/listers.go
+++ b/cluster-autoscaler/utils/kubernetes/listers.go
@@ -17,14 +17,19 @@ limitations under the License.
--- a/cluster-autoscaler/utils/kubernetes/listers.go (revision 6a3cf228856724a44fb66f0e2274ebf75e89e6e9)
+++ b/cluster-autoscaler/utils/kubernetes/listers.go (date 1730896304084)
@@ -17,6 +17,11 @@
package kubernetes

import (
+ "encoding/json"
"time"

appsv1 "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1"
apiv1 "k8s.io/api/core/v1"
policyv1 "k8s.io/api/policy/v1"
+ "k8s.io/apimachinery/pkg/api/resource"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/watch"
client "k8s.io/client-go/kubernetes"
v1appslister "k8s.io/client-go/listers/apps/v1"
v1batchlister "k8s.io/client-go/listers/batch/v1"
@@ -169,6 +174,7 @@ func NewScheduledPodLister(kubeClient client.Interface, stopchannel <-chan struc
"time"

appsv1 "k8s.io/api/apps/v1"
@@ -169,6 +174,7 @@
selector := fields.ParseSelectorOrDie("spec.nodeName!=" + "" + ",status.phase!=" +
string(apiv1.PodSucceeded) + ",status.phase!=" + string(apiv1.PodFailed))
podListWatch := cache.NewListWatchFromClient(kubeClient.CoreV1().RESTClient(), "pods", apiv1.NamespaceAll, selector)
+ podListWatch = wrapListWatchWithNeonVMUsage(podListWatch)
store, reflector := cache.NewNamespaceKeyedIndexerAndReflector(podListWatch, &apiv1.Pod{}, time.Hour)
podLister := v1lister.NewPodLister(store)
go reflector.Run(stopchannel)
@@ -212,6 +218,7 @@ func NewScheduledAndUnschedulablePodLister(kubeClient client.Interface, stopchan
@@ -212,6 +218,7 @@
selector := fields.ParseSelectorOrDie("status.phase!=" +
string(apiv1.PodSucceeded) + ",status.phase!=" + string(apiv1.PodFailed))
podListWatch := cache.NewListWatchFromClient(kubeClient.CoreV1().RESTClient(), "pods", apiv1.NamespaceAll, selector)
+ podListWatch = wrapListWatchWithNeonVMUsage(podListWatch)
store, reflector := cache.NewNamespaceKeyedIndexerAndReflector(podListWatch, &apiv1.Pod{}, time.Hour)
podLister := v1lister.NewPodLister(store)
go reflector.Run(stopchannel)
@@ -221,6 +228,105 @@ func NewScheduledAndUnschedulablePodLister(kubeClient client.Interface, stopchan
@@ -221,6 +228,105 @@
}
}

Expand Down
1 change: 0 additions & 1 deletion cluster-autoscaler/ca.tag

This file was deleted.

Loading