mirror of
https://github.com/kubevela/kubevela.git
synced 2026-02-14 10:00:06 +00:00
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 38s
* chore: adds logic to pull workflow crd from pkg repo Signed-off-by: Amit Singh <singhamitch@outlook.com> Signed-off-by: Ayush <ayushshyamkumar888@gmail.com> Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com> * feat: introduce GetIteratorLabel utility function and refactor label retrieval in CUE processing Signed-off-by: Ayush <ayushshyamkumar888@gmail.com> Co-authored-by: Vishal Kumar <vishal210893@gmail.com> * feat: refactor FromCUE method to use GetIteratorLabel utility for improved label retrieval Signed-off-by: Ayush <ayushshyamkumar888@gmail.com> Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com> * feat: remove unused imports and optimize list concatenation in template files Signed-off-by: Ayush <ayushshyamkumar888@gmail.com> Co-authored-by: Vishal Kumar <vishal210893@gmail.com> * refactor: standardize import formatting across multiple YAML and Go files Signed-off-by: Ayush <ayushshyamkumar888@gmail.com> Co-authored-by: Vishal Kumar <vishal210893@gmail.com> Signed-off-by: Ayush <ayushshyamkumar888@gmail.com> * refactor: import statements in multiple YAML templates for consistency - Removed unnecessary parentheses around import statements in various CUE templates. - Ensured a consistent import style across all templates in the vela-core chart. Signed-off-by: Ayush <ayushshyamkumar888@gmail.com> * feat: add disk space cleanup steps before and after cross-build in Go workflow Signed-off-by: Ayush <ayushshyamkumar888@gmail.com> * refactor: update check-diff target to depend on build for improved consistency Signed-off-by: Ayush <ayushshyamkumar888@gmail.com> * refactor: update reviewable target to include build for improved consistency in check-diff Signed-off-by: Ayush <ayushshyamkumar888@gmail.com> --------- Signed-off-by: Amit Singh <singhamitch@outlook.com> Signed-off-by: Ayush <ayushshyamkumar888@gmail.com> Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com> Co-authored-by: Vishal Kumar <vishal210893@gmail.com>
34 lines
1.1 KiB
Go
34 lines
1.1 KiB
Go
/*
|
|
Copyright 2021 The KubeVela Authors.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
package util
|
|
|
|
import "cuelang.org/go/cue"
|
|
|
|
// GetIteratorLabel returns the label string from a CUE iterator using the
|
|
// non-deprecated Selector API. It handles both string labels and other label types.
|
|
func GetIteratorLabel(iter cue.Iterator) string {
|
|
selector := iter.Selector()
|
|
|
|
// If it's a quoted string, unquote it safely
|
|
if selector.IsString() && selector.LabelType() == cue.StringLabel {
|
|
return selector.Unquoted()
|
|
}
|
|
|
|
// For other label types, use the string representation
|
|
return selector.String()
|
|
}
|