Skip to content

Commit

Permalink
Enable YAML formatter tool
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Morales <v.morales@samsung.com>
  • Loading branch information
electrocucaracha committed Apr 9, 2024
1 parent e85ffa6 commit 863b166
Show file tree
Hide file tree
Showing 321 changed files with 38,220 additions and 48,933 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
bin/
yamlfmt
11 changes: 11 additions & 0 deletions .yamlfmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2024 The Nephio Authors.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
formatter:
type: basic
retain_line_breaks: true
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2024 The Nephio Authors.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

DOCKER_CMD ?= $(shell which docker 2> /dev/null || which podman 2> /dev/null || echo docker)

.PHONY: fmt
fmt:
sudo -E $(DOCKER_CMD) run --rm -u "$$(id -u):$$(id -g)" \
-v "$$(pwd):/mnt" \
-w /mnt mvdan/shfmt -l -w -i 4 -s .
[ -f yamlfmt ] || curl -s "https://i.jpillora.com/google/yamlfmt" | bash
./yamlfmt -dstar **/*.{yaml,yml}
54 changes: 27 additions & 27 deletions distros/gcp/cc-rootsync/apply-replacements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,33 @@ metadata:
annotations:
config.kubernetes.io/local-config: "true"
replacements:
- source:
kind: ConfigMap
name: kptfile.kpt.dev
fieldPath: data.name
targets:
- select:
- source:
kind: ConfigMap
name: setters
fieldPaths:
- data.name
- source:
kind: ConfigMap
name: gcp-context
fieldPath: data.project-id
targets:
- select:
name: kptfile.kpt.dev
fieldPath: data.name
targets:
- select:
kind: ConfigMap
name: setters
fieldPaths:
- data.name
- source:
kind: ConfigMap
name: setters
fieldPaths:
- data.project-id
- source:
kind: ConfigMap
name: gcp-context
fieldPath: data.location
targets:
- select:
name: gcp-context
fieldPath: data.project-id
targets:
- select:
kind: ConfigMap
name: setters
fieldPaths:
- data.project-id
- source:
kind: ConfigMap
name: setters
fieldPaths:
- data.location
name: gcp-context
fieldPath: data.location
targets:
- select:
kind: ConfigMap
name: setters
fieldPaths:
- data.location
56 changes: 28 additions & 28 deletions distros/gcp/nephio-mgmt/cert-manager/cert-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4951,9 +4951,9 @@ metadata: # kpt-merge: /cert-manager-webhook:subjectaccessreviews
annotations:
internal.kpt.dev/upstream-identifier: 'rbac.authorization.k8s.io|ClusterRole|default|cert-manager-webhook:subjectaccessreviews'
rules:
- apiGroups: ["authorization.k8s.io"]
resources: ["subjectaccessreviews"]
verbs: ["create"]
- apiGroups: ["authorization.k8s.io"]
resources: ["subjectaccessreviews"]
verbs: ["create"]
---
# Source: cert-manager/templates/cainjector-rbac.yaml
apiVersion: rbac.authorization.k8s.io/v1
Expand Down Expand Up @@ -5171,10 +5171,10 @@ roleRef:
kind: ClusterRole
name: cert-manager-webhook:subjectaccessreviews
subjects:
- apiGroup: ""
kind: ServiceAccount
name: cert-manager-webhook
namespace: cert-manager
- apiGroup: ""
kind: ServiceAccount
name: cert-manager-webhook
namespace: cert-manager
---
# Source: cert-manager/templates/cainjector-rbac.yaml
# leader election rules
Expand Down Expand Up @@ -5243,15 +5243,15 @@ metadata: # kpt-merge: cert-manager/cert-manager-webhook:dynamic-serving
annotations:
internal.kpt.dev/upstream-identifier: 'rbac.authorization.k8s.io|Role|cert-manager|cert-manager-webhook:dynamic-serving'
rules:
- apiGroups: [""]
resources: ["secrets"]
resourceNames:
- 'cert-manager-webhook-ca'
verbs: ["get", "list", "watch", "update"]
# It's not possible to grant CREATE permission on a single resourceName.
- apiGroups: [""]
resources: ["secrets"]
verbs: ["create"]
- apiGroups: [""]
resources: ["secrets"]
resourceNames:
- 'cert-manager-webhook-ca'
verbs: ["get", "list", "watch", "update"]
# It's not possible to grant CREATE permission on a single resourceName.
- apiGroups: [""]
resources: ["secrets"]
verbs: ["create"]
---
# Source: cert-manager/templates/cainjector-rbac.yaml
# grant cert-manager permission to manage the leaderelection configmap in the
Expand Down Expand Up @@ -5323,10 +5323,10 @@ roleRef:
kind: Role
name: cert-manager-webhook:dynamic-serving
subjects:
- apiGroup: ""
kind: ServiceAccount
name: cert-manager-webhook
namespace: cert-manager
- apiGroup: ""
kind: ServiceAccount
name: cert-manager-webhook
namespace: cert-manager
---
# Source: cert-manager/templates/service.yaml
apiVersion: v1
Expand All @@ -5345,10 +5345,10 @@ metadata: # kpt-merge: cert-manager/cert-manager
spec:
type: ClusterIP
ports:
- protocol: TCP
port: 9402
name: tcp-prometheus-servicemonitor
targetPort: 9402
- protocol: TCP
port: 9402
name: tcp-prometheus-servicemonitor
targetPort: 9402
selector:
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
Expand All @@ -5371,10 +5371,10 @@ metadata: # kpt-merge: cert-manager/cert-manager-webhook
spec:
type: ClusterIP
ports:
- name: https
port: 443
protocol: TCP
targetPort: "https"
- name: https
port: 443
protocol: TCP
targetPort: "https"
selector:
app.kubernetes.io/name: webhook
app.kubernetes.io/instance: cert-manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,31 @@ metadata: # kpt-merge: /nephio-controller-approval-role
annotations:
internal.kpt.dev/upstream-identifier: 'rbac.authorization.k8s.io|ClusterRole|default|nephio-controller-approval-role'
rules:
- apiGroups:
- porch.kpt.dev
resources:
- packagerevisions
- packagerevisions/status
- packagerevisions/approval
verbs:
- get
- list
- watch
- patch
- update
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- config.porch.kpt.dev
resources:
- packagevariants
- packagevariants/status
verbs:
- get
- list
- watch
- apiGroups:
- porch.kpt.dev
resources:
- packagerevisions
- packagerevisions/status
- packagerevisions/approval
verbs:
- get
- list
- watch
- patch
- update
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- config.porch.kpt.dev
resources:
- packagevariants
- packagevariants/status
verbs:
- get
- list
- watch
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,44 @@ metadata: # kpt-merge: /nephio-controller-bootstrap-role
annotations:
internal.kpt.dev/upstream-identifier: 'rbac.authorization.k8s.io|ClusterRole|default|nephio-controller-bootstrap-role'
rules:
- apiGroups:
- cluster.x-k8s.io
resources:
- clusters
verbs:
- get
- list
- watch
- apiGroups:
- '*'
resources:
- secrets
verbs:
- get
- list
- watch
- apiGroups:
- porch.kpt.dev
resources:
- packagerevisionresources
- packagerevisions
verbs:
- get
- list
- watch
- apiGroups:
- config.porch.kpt.dev
resources:
- repositories
verbs:
- get
- list
- watch
- apiGroups:
- porch.kpt.dev
resources:
- packagerevisionresources/status
- packagerevisions/status
- packagerevisions/approval
verbs:
- get
- apiGroups:
- cluster.x-k8s.io
resources:
- clusters
verbs:
- get
- list
- watch
- apiGroups:
- '*'
resources:
- secrets
verbs:
- get
- list
- watch
- apiGroups:
- porch.kpt.dev
resources:
- packagerevisionresources
- packagerevisions
verbs:
- get
- list
- watch
- apiGroups:
- config.porch.kpt.dev
resources:
- repositories
verbs:
- get
- list
- watch
- apiGroups:
- porch.kpt.dev
resources:
- packagerevisionresources/status
- packagerevisions/status
- packagerevisions/approval
verbs:
- get
Loading

0 comments on commit 863b166

Please sign in to comment.