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

Invalid ReplacementTransformer behavior if dot is in pattern string #192

Closed
jingvar opened this issue Apr 28, 2020 · 1 comment
Closed
Assignees
Labels
bug Something isn't working priority/critical Items critical to be implemented, usually by the next release
Milestone

Comments

@jingvar
Copy link
Contributor

jingvar commented Apr 28, 2020

Describe the bug
If ReplacementTransformer has a pattern with a dot , it generates a message
"pattern-based substitution can only be applied to string target fields"

Steps To Reproduce
config.yaml

apiVersion: airshipit.org/v1alpha1
kind: ReplacementTransformer
metadata:
  name: notImportantHere
replacements:
- source:
    value: 12345678
  target:
    objref:
      kind: KubeadmControlPlane
    fieldrefs:
    - spec.kubeadmConfigSpec.files[path=konfigadm.yaml].content%{k8s-version}%

test.yaml

apiVersion: controlplane.cluster.x-k8s.io/v1alpha3
kind: KubeadmControlPlane
metadata:
  name: cluster-controlplane
spec:
  infrastructureTemplate:
    apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
    kind: Metal3MachineTemplate
    name: $(cluster-name)
  kubeadmConfigSpec:
    files:
    - content: |
        kubernetes:
          version: {k8s-version}
        container_runtime:
          type: docker
      owner: root:root
      path: konfigadm.yaml
      permissions: "0640"

Expected behavior
Should work like a dotless pattern.

Environment
airshipctl build from commit f555af3

@jingvar jingvar added bug Something isn't working triage Needs evaluation by project members labels Apr 28, 2020
@airshipbot airshipbot added the ready for review Change related to the issue is ready for review label Apr 28, 2020
@airshipbot
Copy link

airshipbot commented Apr 28, 2020

Related Change #723516

Subject: Replacement transformer improvement
Link: https://review.opendev.org/723516
Status: MERGED
Owner: Dmitry Ukov (dukov@mirantis.com)

This change will close this issue when merged.

Approvals

Code-Review
+1 John Williams
+2 Alexander Hughes
+2 Pete Birley
Verified
+2 Zuul
Workflow
+1 Matt McEuen

Last Updated: 2020-04-29 18:00:05 CDT

@dukov dukov self-assigned this Apr 28, 2020
@drewwalters96 drewwalters96 removed the triage Needs evaluation by project members label Apr 29, 2020
@drewwalters96 drewwalters96 modified the milestones: alphav1, betav1 Apr 29, 2020
@drewwalters96 drewwalters96 added the priority/critical Items critical to be implemented, usually by the next release label Apr 29, 2020
@eak13 eak13 removed the ready for review Change related to the issue is ready for review label Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority/critical Items critical to be implemented, usually by the next release
Projects
None yet
Development

No branches or pull requests

5 participants