Skip to content

Commit

Permalink
Merge pull request #19 from ytsarev/yamllint
Browse files Browse the repository at this point in the history
Setup yaml lint and local render target
  • Loading branch information
ytsarev authored Jan 4, 2024
2 parents 61bd1b0 + 4e4c6a0 commit c49f8bc
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 97 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: yamllint
on: [pull_request]
jobs:
yamllint:
name: runner / yamllint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: yamllint
uses: reviewdog/[email protected]
with:
reporter: github-pr-review
filter_mode: nofilter
yamllint_flags: 'apis/'
fail_on_error: true
5 changes: 5 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends: default

rules:
line-length: disable
document-start: disable
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,12 @@ uptest: $(UPTEST) $(KUBECTL) $(KUTTL)
# - UPTEST_CLOUD_CREDENTIALS, cloud credentials for the provider being tested, e.g. export UPTEST_CLOUD_CREDENTIALS=$(cat ~/.aws/credentials)
e2e: build controlplane.up local.xpkg.deploy.configuration.$(PROJECT_NAME) uptest

.PHONY: uptest e2e
render:
crossplane beta render examples/eks-xr.yaml apis/composition.yaml examples/functions.yaml -r

yamllint:
@$(INFO) running yamllint
@yamllint ./apis || $(FAIL)
@$(OK) running yamllint

.PHONY: uptest e2e render yamllint
18 changes: 9 additions & 9 deletions apis/composition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ spec:
matchLabels:
role: controlplane
vpcConfig:
- endpointPrivateAccess: true
endpointPublicAccess: true
subnetIdSelector:
matchLabels:
access: public
- endpointPrivateAccess: true
endpointPublicAccess: true
subnetIdSelector:
matchLabels:
access: public
patches:
- patchSetName: providerConfigRef
type: PatchSet
Expand Down Expand Up @@ -491,10 +491,10 @@ spec:
- fromFieldPath: metadata.uid
toFieldPath: spec.credentials.secretRef.name
transforms:
- string:
fmt: '%s-ekscluster'
type: Format
type: string
- string:
fmt: '%s-ekscluster'
type: Format
type: string
type: FromCompositeFieldPath
readinessChecks:
- type: None
Expand Down
174 changes: 87 additions & 87 deletions apis/definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,95 +4,95 @@ metadata:
name: xeks.aws.platform.upbound.io
spec:
connectionSecretKeys:
- kubeconfig
- kubeconfig
group: aws.platform.upbound.io
names:
kind: XEKS
plural: xeks
versions:
- name: v1alpha1
served: true
referenceable: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
parameters:
type: object
description: EKS configuration parameters.
properties:
id:
type: string
description: ID of this Cluster that other objects will use to refer to it.
region:
type: string
description: Region is the region you'd like your resource to be created in.
iam:
type: object
description: IAM configuration to connect as ClusterAdmin.
properties:
roleArn:
description: The IAM Role ARN to connect as ClusterAdmin.
type: string
default: roleArn
userArn:
description: The IAM User ARN to connect as ClusterAdmin.
type: string
default: userArn
autoscalerArn:
description: The AutoScaler Role ARN to connect as ClusterAdmin.
type: string
default: autoscalerArn
deletionPolicy:
description: Delete the external resources when the Claim/XR is deleted. Defaults to Delete
enum:
- Delete
- Orphan
type: string
default: Delete
providerConfigName:
description: Crossplane ProviderConfig to use for provisioning this resources
type: string
default: default
version:
description: Kubernetes version
type: string
enum:
- "1.28"
- "1.27"
- "1.26"
- "1.25"
default: "1.27"
nodes:
type: object
description: EKS node configuration parameters.
properties:
count:
type: integer
description: Desired node count, from 1 to 100.
instanceType:
type: string
description: instance types associated with the Node Group.
default: t3.small
required:
- count
- instanceType
required:
- id
- region
- deletionPolicy
- providerConfigName
- nodes
required:
- parameters
status:
description: A Status represents the observed state
properties:
eks:
description: Freeform field containing status information for eks
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
- name: v1alpha1
served: true
referenceable: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
parameters:
type: object
description: EKS configuration parameters.
properties:
id:
type: string
description: ID of this Cluster that other objects will use to refer to it.
region:
type: string
description: Region is the region you'd like your resource to be created in.
iam:
type: object
description: IAM configuration to connect as ClusterAdmin.
properties:
roleArn:
description: The IAM Role ARN to connect as ClusterAdmin.
type: string
default: roleArn
userArn:
description: The IAM User ARN to connect as ClusterAdmin.
type: string
default: userArn
autoscalerArn:
description: The AutoScaler Role ARN to connect as ClusterAdmin.
type: string
default: autoscalerArn
deletionPolicy:
description: Delete the external resources when the Claim/XR is deleted. Defaults to Delete
enum:
- Delete
- Orphan
type: string
default: Delete
providerConfigName:
description: Crossplane ProviderConfig to use for provisioning this resources
type: string
default: default
version:
description: Kubernetes version
type: string
enum:
- "1.28"
- "1.27"
- "1.26"
- "1.25"
default: "1.27"
nodes:
type: object
description: EKS node configuration parameters.
properties:
count:
type: integer
description: Desired node count, from 1 to 100.
instanceType:
type: string
description: instance types associated with the Node Group.
default: t3.small
required:
- count
- instanceType
required:
- id
- region
- deletionPolicy
- providerConfigName
- nodes
required:
- parameters
status:
description: A Status represents the observed state
properties:
eks:
description: Freeform field containing status information for eks
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
6 changes: 6 additions & 0 deletions examples/functions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: pkg.crossplane.io/v1beta1
kind: Function
metadata:
name: upbound-function-patch-and-transform
spec:
package: xpkg.upbound.io/upbound/function-patch-and-transform:v0.2.1

0 comments on commit c49f8bc

Please sign in to comment.