Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-v1.3] improve yurtstaticset template metadata #1591

Merged
merged 1 commit into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions charts/yurthub/templates/yurthub-cloud-yurtstaticset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ spec:
metadata:
labels:
k8s-app: yurt-hub-cloud
name: yurt-hub-cloud
namespace: {{ .Release.Namespace }}
spec:
volumes:
- name: hub-dir
Expand Down
2 changes: 0 additions & 2 deletions charts/yurthub/templates/yurthub-yurtstaticset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ spec:
metadata:
labels:
k8s-app: yurt-hub
name: yurt-hub
namespace: {{ .Release.Namespace }}
spec:
volumes:
- name: hub-dir
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/apps/v1alpha1/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ func SetDefaultsYurtStaticSet(obj *YurtStaticSet) {
if podSpec != nil {
SetDefaultPodSpec(podSpec)
}

// use YurtStaticSet name and namespace to replace name and namespace in template metadata
obj.Spec.Template.Name = obj.Name
obj.Spec.Template.Namespace = obj.Namespace
}

// SetDefaultsYurtAppDaemon set default values for YurtAppDaemon.
Expand Down