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

Fix breaking changes introduced with executionTier #105

Closed
orbatschow opened this issue Nov 7, 2022 · 0 comments · Fixed by #106
Closed

Fix breaking changes introduced with executionTier #105

orbatschow opened this issue Nov 7, 2022 · 0 comments · Fixed by #106

Comments

@orbatschow
Copy link
Contributor

orbatschow commented Nov 7, 2022

After merging #96 there were breaking changes.
It would be great to make the executionTier optional and default it to 0.

Steps to reproduce

Deploy the following ModRule on Kubernetes 1.23:

apiVersion: api.kubemod.io/v1beta1
kind: ModRule
metadata:
  annotations:
    argocd.argoproj.io/sync-wave: "1"
  name: quay-io-container-latest-tag
  namespace: kubemod-system
spec:
  match:
  - matchFor: Any
    matchValue: Pod
    select: $.kind
  patch:
  - op: replace
    path: /spec/containers/#0/image
    select: $.spec.containers[?(@.image =~ "^(quay.io)(/)([^:]+)$")].image
    value: '{{ regexReplaceAll "^(quay.io)(/)([^:]+)$" .SelectedItem "...redacted.../${3}:latest"
      }}'
  targetNamespaceRegex: .*
  type: Patch
status: {}

With KubeMod 0.16.0, the deployment issues the following error:

Resource: "api.kubemod.io/v1beta1, Resource=modrules", GroupVersionKind: "api.kubemod.io/v1beta1, Kind=ModRule"Name: "quay-io-container-latest-tag", Namespace: "kubemod-system"for: ".": ModRule.api.kubemod.io "quay-io-container-latest-tag" is invalid: spec.executionTier: Required valueError from server (Invalid): error when applying patch:{"spec":{"match":[{"matchValue":"Pod","select":"$.kind"}]}}

With KubeMod 0.17.0, the deployment issues the following error:

error: error validating ".": error validating data: ValidationError(ModRule.spec): missing required field "executionTier" in io.kubemod.api.v1beta1.ModRule.spec; if you choose to ignore these errors, turn validation off with --validate=false
@vassilvk vassilvk changed the title Fix breaking changes introduced with ExecutionTier Fix breaking changes introduced with executionTier Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant