Coder Social home page Coder Social logo

Comments (6)

TheBeatles1994 avatar TheBeatles1994 commented on May 18, 2024

Can you provide more information? Such as the webhook file.

from open-simulator.

astronauts1 avatar astronauts1 commented on May 18, 2024

yaml:

{{- if and .Values.admissionWebhooks.enabled .Values.admissionWebhooks.patch.enabled (not .Values.admissionWebhooks.certManager.enabled) }}
apiVersion: batch/v1
kind: Job
metadata:
  name:  {{ template "kubevela.fullname" . }}-admission-patch
  namespace: {{ .Release.Namespace }}
  annotations:
    "helm.sh/hook": post-install,post-upgrade
    "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
  labels:
    app: {{ template "kubevela.name" . }}-admission-patch
    {{- include "kubevela.labels" . | nindent 4 }}
spec:
  {{- if .Capabilities.APIVersions.Has "batch/v1alpha1" }}
  # Alpha feature since k8s 1.12
  ttlSecondsAfterFinished: 0
  {{- end }}
  template:
    metadata:
      name:  {{ template "kubevela.fullname" . }}-admission-patch
      labels:
        app: {{ template "kubevela.name" . }}-admission-patch
        {{- include "kubevela.labels" . | nindent 8 }}
    spec:
      containers:
        - name: patch
          image: {{ .Values.admissionWebhooks.patch.image.repository }}:{{ .Values.admissionWebhooks.patch.image.tag }}
          imagePullPolicy: {{ .Values.admissionWebhooks.patch.image.pullPolicy }}
          args:
            - patch
            - --webhook-name={{ template "kubevela.fullname" . }}-admission
            - --namespace={{ .Release.Namespace }}
            - --secret-name={{ template "kubevela.fullname" . }}-admission
            - --patch-failure-policy={{ .Values.admissionWebhooks.failurePolicy }}
            - --crds=applications.core.oam.dev
      restartPolicy: OnFailure
      {{- with .Values.imagePullSecrets }}
      imagePullSecrets:
      {{- toYaml . | nindent 8 }}
      {{- end }}
      serviceAccountName: {{ template "kubevela.fullname" . }}-admission
      {{- with .Values.admissionWebhooks.patch.affinity }}
      affinity:
{{ toYaml . | indent 8 }}
      {{- end }}
      {{- with .Values.admissionWebhooks.patch.tolerations }}
      tolerations:
{{ toYaml . | indent 8 }}
      {{- end }}
      securityContext:
        runAsGroup: 2000
        runAsNonRoot: true
        runAsUser: 2000
{{- end }}

from open-simulator.

astronauts1 avatar astronauts1 commented on May 18, 2024

I think this may be the reason. chartRequested, err := loader.Load(chartPath)

from open-simulator.

Liwling avatar Liwling commented on May 18, 2024

Reason: the built-in capabilities field needs to be obtained from the cluster, so we can't load the value of the Capabilities field in the ProcessChart phase.
Solution: u can, according to the API version to be simulated, decide whether to execute this action( ttlSecondsAfterFinished: 0 )

from open-simulator.

Liwling avatar Liwling commented on May 18, 2024

In addition, I'm sorry about that we don't support to deal with the hook resources in helm.

from open-simulator.

astronauts1 avatar astronauts1 commented on May 18, 2024

ok. I got it.thank you!

from open-simulator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.