Skip to content

Commit

Permalink
stdlib: kubernetes: rename #Apply to #Resources
Browse files Browse the repository at this point in the history
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 <aluzzardi@gmail.com>
  • Loading branch information
aluzzardi committed Jun 4, 2021
1 parent 19db780 commit a5e9ac8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/kubernetes-app/main.cue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions stdlib/kubernetes/kubernetes.cue
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ import (
]
}

// Apply a Kubernetes configuration
#Apply: {
// Apply Kubernetes resources
#Resources: {

// Kubernetes config to deploy
source?: dagger.#Artifact @dagger(input)
Expand Down
2 changes: 1 addition & 1 deletion tests/stdlib/kubernetes/kubernetes.cue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ TestKubeApply: {
}

// Apply deployment
apply: kubernetes.#Apply & {
apply: kubernetes.#Resources & {
"kubeconfig": kubeconfig
namespace: "dagger-test"
manifest: yaml.Marshal(kubeSrc)
Expand Down

0 comments on commit a5e9ac8

Please sign in to comment.