Closed daraghlowe closed 2 years ago
The second problem might be caused by the integer key. Can you please try quoting it? Ref issue #3446
@monopole can you please take a look at the issue of the anchors still not working in the provided sample?
Second issue is indeed #3446.
@ack
/retitle Error during expansion of "!!merge <<:" anchor tags
Thanks @eddiezane @KnVerey, the integer key is the second issue, confirmed that it works fine when I put it in quotes.
/triage accepted
I am currently still receiving errors on the below yaml snippet (from https://github.com/knative/eventing/releases/download/v0.26.0/eventing-core.yaml) :
# Copyright 2018 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: apps/v1
kind: Deployment
metadata:
name: pingsource-mt-adapter
namespace: knative-eventing
labels:
eventing.knative.dev/release: "v0.26.0"
app.kubernetes.io/name: pingsource-mt-adapter
app.kubernetes.io/version: "0.26.0"
app.kubernetes.io/part-of: knative-eventing
spec:
# when set to 0 (and only 0) will be set to 1 when the first PingSource is created.
replicas: 0
selector:
matchLabels: &labels
eventing.knative.dev/source: ping-source-controller
sources.knative.dev/role: adapter
template:
metadata:
labels:
!!merge <<: *labels
eventing.knative.dev/release: "v0.26.0"
app.kubernetes.io/name: pingsource-mt-adapter
app.kubernetes.io/version: "0.26.0"
app.kubernetes.io/part-of: knative-eventing
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels: *labels
topologyKey: kubernetes.io/hostname
weight: 100
enableServiceLinks: false
containers:
- name: dispatcher
image: gcr.io/knative-releases/knative.dev/eventing/cmd/mtping@sha256:f47e953dfeb7747579f200b43af75f7796a5ab0e6fb616199abff233f3d03b4f
env:
- name: SYSTEM_NAMESPACE
value: ""
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
# DO NOT MODIFY: The values below are being filled by the ping source controller
# See 500-controller.yaml
- name: K_METRICS_CONFIG
value: ""
- name: K_LOGGING_CONFIG
value: ""
- name: K_LEADER_ELECTION_CONFIG
value: ""
- name: K_NO_SHUTDOWN_AFTER
value: ""
- name: K_SINK_TIMEOUT
value: "-1"
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
ports:
- containerPort: 9090
name: metrics
protocol: TCP
resources:
requests:
cpu: 125m
memory: 64Mi
limits:
cpu: 1000m
memory: 2048Mi
serviceAccountName: pingsource-mt-adapter
The error received is:
Error: map[string]interface {}{"apiVersion":"apps/v1", "kind":"Deployment", "metadata":map[string]interface {}{"labels":map[string]interface {}{"app.kubernetes.io/name":"pingsource-mt-adapter", "app.kubernetes.io/part-of":"knative-eventing", "app.kubernetes.io/version":"0.26.0", "eventing.knative.dev/release":"v0.26.0"}, "name":"pingsource-mt-adapter", "namespace":"knative-eventing"}, "spec":map[string]interface {}{"replicas":0, "selector":map[string]interface {}{"matchLabels":map[string]interface {}{"eventing.knative.dev/source":"ping-source-controller", "sources.knative.dev/role":"adapter"}}, "template":map[string]interface {}{"metadata":map[string]interface {}{"labels":map[interface {}]interface {}{"app.kubernetes.io/name":"pingsource-mt-adapter", "app.kubernetes.io/part-of":"knative-eventing", "app.kubernetes.io/version":"0.26.0", "eventing.knative.dev/release":"v0.26.0", "eventing.knative.dev/source":"ping-source-controller", "sources.knative.dev/role":"adapter"}}, "spec":map[string]interface {}{"affinity":map[string]interface {}{"podAntiAffinity":map[string]interface {}{"preferredDuringSchedulingIgnoredDuringExecution":[]interface {}{map[string]interface {}{"podAffinityTerm":map[string]interface {}{"labelSelector":map[string]interface {}{"matchLabels":map[string]interface {}{"eventing.knative.dev/source":"ping-source-controller", "sources.knative.dev/role":"adapter"}}, "topologyKey":"kubernetes.io/hostname"}, "weight":100}}}}, "containers":[]interface {}{map[string]interface {}{"env":[]interface {}{map[string]interface {}{"name":"SYSTEM_NAMESPACE", "value":"", "valueFrom":map[string]interface {}{"fieldRef":map[string]interface {}{"apiVersion":"v1", "fieldPath":"metadata.namespace"}}}, map[string]interface {}{"name":"K_METRICS_CONFIG", "value":""}, map[string]interface {}{"name":"K_LOGGING_CONFIG", "value":""}, map[string]interface {}{"name":"K_LEADER_ELECTION_CONFIG", "value":""}, map[string]interface {}{"name":"K_NO_SHUTDOWN_AFTER", "value":""}, map[string]interface {}{"name":"K_SINK_TIMEOUT", "value":"-1"}, map[string]interface {}{"name":"POD_NAME", "valueFrom":map[string]interface {}{"fieldRef":map[string]interface {}{"fieldPath":"metadata.name"}}}}, "image":"gcr.io/knative-releases/knative.dev/eventing/cmd/mtping@sha256:f47e953dfeb7747579f200b43af75f7796a5ab0e6fb616199abff233f3d03b4f", "name":"dispatcher", "ports":[]interface {}{map[string]interface {}{"containerPort":9090, "name":"metrics", "protocol":"TCP"}}, "resources":map[string]interface {}{"limits":map[string]interface {}{"cpu":"1000m", "memory":"2048Mi"}, "requests":map[string]interface {}{"cpu":"125m", "memory":"64Mi"}}}}, "enableServiceLinks":false, "serviceAccountName":"pingsource-mt-adapter"}}}}: json: unsupported type: map[interface {}]interface {}
➜ ~/Downloads kustomize version
{Version:kustomize/v4.4.0 GitCommit:63ec6bdb3d737a7c66901828c5743656c49b60e1 BuildDate:2021-09-27T16:24:12Z GoOs:linux GoArch:amd64}
Please advise - thanks!
I'm having this same issue, I tried to understand more deeply the issue and come up with a solution...
I'm still reading the Contribution Guidelines, and I was not sure if I could do it because I'm not familiar with the codebase.
I opened a PR on my fork, and I'm still dealing with some corner cases related to comments and JSON serialization... https://github.com/RafaeLeal/kustomize/pull/1/files
After signing the CLA I can open this PR if there's nothing terribly wrong with it 😅
@RafaeLeal I took a very quick glance at your PR, and nothing about it seems terribly outlandish, it would be great if you could open the PR here and we can do a more thorough review.
@natasha41575 Created, thanks! :)
This is a follow up issue to #3675 as we still see errors when using the kustomize version 4.4 that has the YAML anchor fix. We're also seeing a similar error (
unsupported type: map[interface {}]interface {}
) for some other YAML in knative that doesn't have a YAML anchor.We use kustomize v3.8.10 which works fine with knative but we get errors when using the later versions that use kyaml.
kustomization.yaml
The YAML anchor in serving-domainmapping.yaml and serving-core.yaml looks like this:
Error during build:
The non YAML anchor related error example is in release.yaml:
The error we get is here: