Skip to content

Commit

Permalink
fix: image pull policy
Browse files Browse the repository at this point in the history
Signed-off-by: Lin Yang <[email protected]>
  • Loading branch information
reaver-flomesh committed Jan 5, 2025
1 parent a0c6613 commit 9e80098
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.
3 changes: 2 additions & 1 deletion charts/fsm/templates/fsm-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ spec:
initContainers:
- name: init-fsm-controller
image: "{{ include "fsmCurl.image" . }}"
imagePullPolicy: {{ .Values.fsm.image.pullPolicy }}
command: ["curl", "http://fsm-bootstrap.{{ include "fsm.namespace" . }}:9091/healthz", "--connect-timeout", "2", "--retry", "50", "--retry-connrefused", "--retry-delay", "5"]
resources:
{{- toYaml .Values.fsm.fsmController.initResources | nindent 12 }}
- name: init-untar
image: "{{ include "fsmCurl.image" . }}"
imagePullPolicy: IfNotPresent
imagePullPolicy: {{ .Values.fsm.image.pullPolicy }}
command:
- sh
- -c
Expand Down
2 changes: 1 addition & 1 deletion charts/fsm/templates/fsm-ingress-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spec:
initContainers:
- name: wait-controller
image: "{{ include "fsmCurl.image" . }}"
imagePullPolicy: IfNotPresent
imagePullPolicy: {{ .Values.fsm.image.pullPolicy }}
{{- with .Values.fsm.fsmIngress.securityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
Expand Down
1 change: 1 addition & 0 deletions charts/fsm/templates/fsm-injector-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ spec:
initContainers:
- name: init-fsm-injector
image: "{{ include "fsmCurl.image" . }}"
imagePullPolicy: {{ .Values.fsm.image.pullPolicy }}
command: ["curl", "http://fsm-bootstrap.{{ include "fsm.namespace" . }}:9091/healthz", "--connect-timeout", "2", "--retry", "50", "--retry-connrefused", "--retry-delay", "5"]
resources:
{{- toYaml .Values.fsm.injector.initResources | nindent 12 }}
Expand Down
1 change: 1 addition & 0 deletions charts/fsm/templates/fsm-xnetwork.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ spec:
initContainers:
- name: fsm-init
image: "{{ include "fsmCurl.image" . }}"
imagePullPolicy: {{ .Values.fsm.image.pullPolicy }}
command: [ "curl", "http://fsm-bootstrap.{{ include "fsm.namespace" . }}:9091/healthz", "--connect-timeout", "2", "--retry", "50", "--retry-connrefused", "--retry-delay", "5"]
resources:
{{- toYaml .Values.fsm.fsmXnetwork.initResources | nindent 12 }}
Expand Down
6 changes: 3 additions & 3 deletions tests/framework/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ func (td *FsmTestData) InitTestData(t GinkgoTInterface) error {
}

if td.InstType == K3dCluster && td.ClusterConfig == nil {
k3dLogger.Logger.SetLevel(logrus.TraceLevel)
k3dLogger.Logger.SetLevel(logrus.DebugLevel)
clusterConfig := td.k3dClusterConfig()
if clusterConfig == nil {
return fmt.Errorf("failed to create k3d cluster")
Expand Down Expand Up @@ -679,7 +679,7 @@ func (td *FsmTestData) LoadImagesToK3d(imageNames []string) error {
}

td.T.Logf("Importing image(s) into cluster '%s'", td.ClusterName)
loadImageOpts := k3d.ImageImportOpts{KeepTar: false, KeepToolsNode: false, Mode: k3d.ImportModeAutoDetect}
loadImageOpts := k3d.ImageImportOpts{KeepTar: false, KeepToolsNode: false, Mode: k3d.ImportModeDirect}
if err := k3dClient.ImageImportIntoClusterMulti(context.TODO(), runtimes.SelectedRuntime, images, kc, loadImageOpts); err != nil {
td.T.Errorf("Failed to import image(s) into cluster '%s': %+v", td.ClusterName, err)
return err
Expand Down Expand Up @@ -822,7 +822,7 @@ func (td *FsmTestData) InstallFSM(instOpts InstallFSMOpts) error {
fmt.Sprintf("fsm.certmanager.issuerGroup=%s", instOpts.CertmanagerIssuerGroup))
}

if !(td.InstType == KindCluster) {
if !(td.InstType == KindCluster || td.InstType == K3dCluster) {
// Making sure the image is always pulled in registry-based testing
instOpts.SetOverrides = append(instOpts.SetOverrides,
"fsm.image.pullPolicy=Always")
Expand Down
14 changes: 4 additions & 10 deletions tests/framework/k3d-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ ports:
- port: 4001:4001/udp
nodeFilters:
- loadbalancer
#registries:
# use:
# - k3d-registry:5000
# config: |
# mirrors:
# "localhost:5001":
# endpoint:
# - http://k3d-registry:5000
options:
k3d:
wait: true
Expand All @@ -63,14 +55,16 @@ options:
- server:*
- arg: --kubelet-arg=eviction-hard=imagefs.available<1%,nodefs.available<1%
nodeFilters:
- server:*
- agent:*
- arg: --kubelet-arg=eviction-minimum-reclaim=imagefs.available=1%,nodefs.available=1%
nodeFilters:
- server:*
- agent:*
nodeLabels:
- label: ingress-ready=true # same as `--k3s-node-label 'foo=bar@agent:1'` -> this results in a Kubernetes node label
- label: ingress-ready=true
nodeFilters:
- agent:*
kubeconfig:
updateDefaultKubeconfig: true # add new cluster to your default Kubeconfig; same as `--kubeconfig-update-default` (default: true)
updateDefaultKubeconfig: true
switchCurrentContext: true

0 comments on commit 9e80098

Please sign in to comment.