From a5e9ac8a0fd3a04f9da32725a8ae228bc82c8e22 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Fri, 4 Jun 2021 14:03:35 -0700 Subject: [PATCH] stdlib: kubernetes: rename #Apply to #Resources Code convention: use nouns instead of verbs whenever possible. Reasoning: One can apply just about anything to Kubernetes via this: deployment, load balancer, RBAC policy, a custom CRD resource, etc. Upstream those are called resources: You give `kubectl apply` one or more manifests and it will create the corresponding resources. Signed-off-by: Andrea Luzzardi --- examples/kubernetes-app/main.cue | 2 +- stdlib/kubernetes/kubernetes.cue | 4 ++-- tests/stdlib/kubernetes/kubernetes.cue | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/kubernetes-app/main.cue b/examples/kubernetes-app/main.cue index 31247209..3185ef5b 100644 --- a/examples/kubernetes-app/main.cue +++ b/examples/kubernetes-app/main.cue @@ -36,7 +36,7 @@ cluster: eks.#KubeConfig & { } // Example of a simple `kubectl apply` using a simple config -kubeApply: kubernetes.#Apply & { +kubeApply: kubernetes.#Resources & { manifest: yaml.Marshal(kubeSrc) namespace: "test" kubeconfig: cluster.kubeconfig diff --git a/stdlib/kubernetes/kubernetes.cue b/stdlib/kubernetes/kubernetes.cue index f6499a92..55aa4c5f 100644 --- a/stdlib/kubernetes/kubernetes.cue +++ b/stdlib/kubernetes/kubernetes.cue @@ -43,8 +43,8 @@ import ( ] } -// Apply a Kubernetes configuration -#Apply: { +// Apply Kubernetes resources +#Resources: { // Kubernetes config to deploy source?: dagger.#Artifact @dagger(input) diff --git a/tests/stdlib/kubernetes/kubernetes.cue b/tests/stdlib/kubernetes/kubernetes.cue index 123f26ba..311b247a 100644 --- a/tests/stdlib/kubernetes/kubernetes.cue +++ b/tests/stdlib/kubernetes/kubernetes.cue @@ -26,7 +26,7 @@ TestKubeApply: { } // Apply deployment - apply: kubernetes.#Apply & { + apply: kubernetes.#Resources & { "kubeconfig": kubeconfig namespace: "dagger-test" manifest: yaml.Marshal(kubeSrc)