Skip to content

Commit

Permalink
Merge pull request #18 from kcl-lang/extra-label-examples
Browse files Browse the repository at this point in the history
feat: add extra pod metadata label examples
  • Loading branch information
Peefy authored Jul 24, 2024
2 parents c43bd76 + fdc51f0 commit bf4f771
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 41 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/cla.yml

This file was deleted.

3 changes: 3 additions & 0 deletions examples/server/app_secret/prod/main.k
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ appConfiguration: frontend.Server {
type = "Opaque"
}
]
podMetadata.labels: {
"app.kubernetes.io/env" = "myenv"
}
}
2 changes: 1 addition & 1 deletion models/kube/render/render.k
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ remove_duplicated_iter = lambda data: [], func {

__renderServerFrontendInstances__ = [inst for inst in frontend.Server.instances() if typeof(inst) == "Server"]
__renderServerBackendInstances__ = [backend.ServerBackend(inst) for inst in __renderServerFrontendInstances__]
__serverExtraResources: [{str:}] = [v for s in __renderServerFrontendInstances__ for k, v in s.extraResources]
__serverExtraResources: [{str:}] = [v for s in __renderServerFrontendInstances__ for k, v in s.extraResources or []]

__renderJobFrontendInstances__ = [inst for inst in frontend.Job.instances() if typeof(inst) == "Job"]
__renderJobBackendInstances__ = [backend.JobBackend(inst) for inst in __renderJobFrontendInstances__]
Expand Down
4 changes: 2 additions & 2 deletions models/kube/utils/metadata_builder.k
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import models.kube.metadata

MetadataBuilder = lambda config -> {str:} {
{
name: metadata.__META_APP_NAME
namespace: metadata.__META_APP_NAME
name: config?.name or metadata.__META_APP_NAME
namespace: config?.name or metadata.__META_APP_NAME
labels: config?.labels
annotations: config?.annotations
}
Expand Down

0 comments on commit bf4f771

Please sign in to comment.