Fix issue with the annotations and labels.

This commit is contained in:
2023-03-16 13:54:04 +00:00
parent bded5b0250
commit 10648997ad
8 changed files with 37 additions and 27 deletions
+3 -1
View File
@@ -176,7 +176,9 @@ params:
imagePullPolicy: imagePullPolicy:
- "Always" - "Always"
labels: labels:
"label-name": "label-value" this/works: "true"
annotations:
this/works/aswell: "true"
``` ```
+2 -2
View File
@@ -13,12 +13,12 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes # This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version. # to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/) # Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.21 version: 0.0.24
# This is the version number of the application being deployed. This version number should be # This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to # incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using. # follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes. # It is recommended to use it with quotes.
appVersion: "0.0.21" appVersion: "0.0.24"
keywords: keywords:
- operator - operator
- jobs - jobs
@@ -5,6 +5,18 @@ metadata:
labels: labels:
{{- include "chart.labels" . | nindent 4 }} {{- include "chart.labels" . | nindent 4 }}
rules: rules:
- apiGroups:
- batch
resources:
- jobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups: - apiGroups:
- jobsmanager.raczylo.com - jobsmanager.raczylo.com
resources: resources:
@@ -31,28 +43,6 @@ rules:
- get - get
- patch - patch
- update - update
# Add ability to manage jobs
- apiGroups:
- batch
resources:
- jobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
# Add access to events
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- update
--- ---
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding kind: ClusterRoleBinding
+2 -2
View File
@@ -12,8 +12,8 @@ controllerManager:
memory: 64Mi memory: 64Mi
manager: manager:
image: image:
repository: ghcr.io/lukaszraczylo/jobs-manager-operator repository: controller
tag: {{ .Chart.AppVersion }} tag: latest
resources: resources:
limits: limits:
cpu: 500m cpu: 500m
+3
View File
@@ -1,2 +1,5 @@
resources: resources:
- manager.yaml - manager.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
+12
View File
@@ -5,6 +5,18 @@ metadata:
creationTimestamp: null creationTimestamp: null
name: manager-role name: manager-role
rules: rules:
- apiGroups:
- batch
resources:
- jobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups: - apiGroups:
- jobsmanager.raczylo.com - jobsmanager.raczylo.com
resources: resources:
+2
View File
@@ -53,11 +53,13 @@ func (cp *connPackage) compileParameters(params ...jobsmanagerv1beta1.ManagedJob
cparams.ImagePullSecrets = append(cparams.ImagePullSecrets, params.ImagePullSecrets...) cparams.ImagePullSecrets = append(cparams.ImagePullSecrets, params.ImagePullSecrets...)
} }
if params.Labels != nil { if params.Labels != nil {
cparams.Labels = make(map[string]string)
for k, v := range params.Labels { for k, v := range params.Labels {
cparams.Labels[k] = v cparams.Labels[k] = v
} }
} }
if params.Annotations != nil { if params.Annotations != nil {
cparams.Annotations = make(map[string]string)
for k, v := range params.Annotations { for k, v := range params.Annotations {
cparams.Annotations[k] = v cparams.Annotations[k] = v
} }
+1
View File
@@ -40,6 +40,7 @@ type ManagedJobReconciler struct {
//+kubebuilder:rbac:groups=jobsmanager.raczylo.com,resources=managedjobs,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=jobsmanager.raczylo.com,resources=managedjobs,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=jobsmanager.raczylo.com,resources=managedjobs/status,verbs=get;update;patch //+kubebuilder:rbac:groups=jobsmanager.raczylo.com,resources=managedjobs/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=jobsmanager.raczylo.com,resources=managedjobs/finalizers,verbs=update //+kubebuilder:rbac:groups=jobsmanager.raczylo.com,resources=managedjobs/finalizers,verbs=update
//+kubebuilder:rbac:groups=batch,resources=jobs,verbs=get;list;watch;create;update;patch;delete
func (r *ManagedJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { func (r *ManagedJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx) _ = log.FromContext(ctx)