Skip to content

Instantly share code, notes, and snippets.

@displague
Last active February 3, 2020 14:38
Show Gist options
  • Save displague/ee4621d2d25ac03af3af10a12ccf018b to your computer and use it in GitHub Desktop.
Save displague/ee4621d2d25ac03af3af10a12ccf018b to your computer and use it in GitHub Desktop.

you can expect output.yaml from this gist, if in the branch crossplane/crossplane#1217, you:

  • remove this file: cluster/test/template-engine/helm2/stack.yaml
  • create behavior.yaml from this gist
  • run:
    go run cmd/crossplane/main.go stack unpack --content-dir=$GOPATH/src/github.com/crossplaneio/crossplane/cluster/test/template-engine/helm2  --permission-scope=Cluster
    
# cluster/test/template-engine/helm2/behavior.yaml
crd:
kind: SampleClaim
apiVersion: samples.stacks.crossplane.io/v1alpha1
reconcile:
path: 'resources'
engine:
type: helm2
source:
image: crossplane/sample-stack-claim-test:helm2
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
stacks.crossplane.io/stack-title: ""
creationTimestamp: null
labels:
app.kubernetes.io/managed-by: stack-manager
crossplane.io/scope: environment
name: sampleclaims.samples.stacks.crossplane.io
spec:
group: samples.stacks.crossplane.io
names:
kind: SampleClaim
plural: sampleclaims
scope: ""
validation:
openAPIV3Schema:
description: SampleClaim is an example of a CRD that a template stack may want
to watch
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: SampleClaimSpec defines some configuration that will be passed
to the resource engine run by the template stack controller
type: object
status:
description: SampleClaimStatus tracks the state of the operations executed
by the template stack controller
type: object
type: object
versions:
- name: v1alpha1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: stacks.crossplane.io/v1alpha1
kind: StackDefinition
metadata:
creationTimestamp: null
spec:
behavior:
crd:
apiVersion: samples.stacks.crossplane.io/v1alpha1
kind: SampleClaim
engine:
type: helm2
reconcile:
path: resources
source:
image: crossplane/sample-stack-claim-test:helm2
controller:
deployment:
name: ""
spec:
selector:
matchLabels:
app: tc-something
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: tc-something
spec:
containers:
- args:
- manager
- --resources-dir
- /behaviors
- --stack-definition-namespace
- ""
- --stack-definition-name
- ""
image: bymafmaf/templating-controller:0.0.1
name: tc-something
resources: {}
volumeMounts:
- mountPath: /behaviors
name: behaviors
initContainers:
- command:
- cp
- -xR
- /
- /behaviors
image: crossplane/sample-stack-claim-test:helm2
name: stack-package
resources: {}
volumeMounts:
- mountPath: /behaviors
name: behaviors
restartPolicy: Never
volumes:
- emptyDir: {}
name: behaviors
customresourcedefinitions:
- apiVersion: samples.stacks.crossplane.io/
kind: SampleClaim
- apiVersion: samples.stacks.crossplane.io/
kind: SampleClaim
license: Apache-2.0
permissionScope: Cluster
permissions:
rules:
- apiGroups:
- ""
resources:
- configmaps
- events
- secrets
verbs:
- '*'
- apiGroups:
- samples.stacks.crossplane.io
resources:
- sampleclaims
verbs:
- '*'
status: {}
# actually remove this file: cluster/test/template-engine/helm2/stack.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment