diff --git a/docs/longhornctl.md b/docs/longhornctl.md index bc38f358..5dd634e9 100644 --- a/docs/longhornctl.md +++ b/docs/longhornctl.md @@ -26,4 +26,4 @@ CLI for Longhorn troubleshooting and operations. * [longhornctl trim](longhornctl_trim.md) - Longhorn trimming operations * [longhornctl version](longhornctl_version.md) - Print longhornctl version -###### Auto generated by spf13/cobra on 27-Sep-2024 +###### Auto generated by spf13/cobra on 13-Oct-2024 diff --git a/docs/longhornctl_check.md b/docs/longhornctl_check.md index decde19a..80ef696b 100644 --- a/docs/longhornctl_check.md +++ b/docs/longhornctl_check.md @@ -16,4 +16,4 @@ Longhorn checking operations * [longhornctl](longhornctl.md) - Longhorn commandline interface. * [longhornctl check preflight](longhornctl_check_preflight.md) - Check Longhorn preflight -###### Auto generated by spf13/cobra on 27-Sep-2024 +###### Auto generated by spf13/cobra on 13-Oct-2024 diff --git a/docs/longhornctl_check_preflight.md b/docs/longhornctl_check_preflight.md index 9e8793d0..41c64600 100644 --- a/docs/longhornctl_check_preflight.md +++ b/docs/longhornctl_check_preflight.md @@ -57,4 +57,4 @@ INFO[2024-07-16T17:17:42+08:00] Completed preflight checker * [longhornctl check](longhornctl_check.md) - Longhorn checking operations -###### Auto generated by spf13/cobra on 27-Sep-2024 +###### Auto generated by spf13/cobra on 13-Oct-2024 diff --git a/docs/longhornctl_doc.md b/docs/longhornctl_doc.md index e8afb556..f834d8b3 100644 --- a/docs/longhornctl_doc.md +++ b/docs/longhornctl_doc.md @@ -28,4 +28,4 @@ longhornctl doc [output directory] [flags] * [longhornctl](longhornctl.md) - Longhorn commandline interface. -###### Auto generated by spf13/cobra on 27-Sep-2024 +###### Auto generated by spf13/cobra on 13-Oct-2024 diff --git a/docs/longhornctl_export.md b/docs/longhornctl_export.md index ec42a6c2..096f8c2d 100644 --- a/docs/longhornctl_export.md +++ b/docs/longhornctl_export.md @@ -16,4 +16,4 @@ Export Longhorn resources * [longhornctl](longhornctl.md) - Longhorn commandline interface. * [longhornctl export replica](longhornctl_export_replica.md) - Export Longhorn replica -###### Auto generated by spf13/cobra on 27-Sep-2024 +###### Auto generated by spf13/cobra on 13-Oct-2024 diff --git a/docs/longhornctl_export_replica.md b/docs/longhornctl_export_replica.md index 53f6d505..ffe3ace1 100644 --- a/docs/longhornctl_export_replica.md +++ b/docs/longhornctl_export_replica.md @@ -62,4 +62,4 @@ lost+found * [longhornctl export](longhornctl_export.md) - Export Longhorn resources * [longhornctl export replica stop](longhornctl_export_replica_stop.md) - Stop exporting Longhorn replica -###### Auto generated by spf13/cobra on 27-Sep-2024 +###### Auto generated by spf13/cobra on 13-Oct-2024 diff --git a/docs/longhornctl_export_replica_stop.md b/docs/longhornctl_export_replica_stop.md index d3aa8082..e9895d2b 100644 --- a/docs/longhornctl_export_replica_stop.md +++ b/docs/longhornctl_export_replica_stop.md @@ -31,4 +31,4 @@ INFO[2024-07-16T17:29:14+08:00] Successfully stopped exporting replica * [longhornctl export replica](longhornctl_export_replica.md) - Export Longhorn replica -###### Auto generated by spf13/cobra on 27-Sep-2024 +###### Auto generated by spf13/cobra on 13-Oct-2024 diff --git a/docs/longhornctl_get.md b/docs/longhornctl_get.md index d65a9509..14d6a5e0 100644 --- a/docs/longhornctl_get.md +++ b/docs/longhornctl_get.md @@ -16,4 +16,4 @@ Longhorn information gathering operations * [longhornctl](longhornctl.md) - Longhorn commandline interface. * [longhornctl get replica](longhornctl_get_replica.md) - Get Longhorn replica information -###### Auto generated by spf13/cobra on 27-Sep-2024 +###### Auto generated by spf13/cobra on 13-Oct-2024 diff --git a/docs/longhornctl_get_replica.md b/docs/longhornctl_get_replica.md index 497e51df..9e7c91db 100644 --- a/docs/longhornctl_get_replica.md +++ b/docs/longhornctl_get_replica.md @@ -60,4 +60,4 @@ INFO[2024-07-16T17:23:51+08:00] Completed replica getter * [longhornctl get](longhornctl_get.md) - Longhorn information gathering operations -###### Auto generated by spf13/cobra on 27-Sep-2024 +###### Auto generated by spf13/cobra on 13-Oct-2024 diff --git a/docs/longhornctl_global-options.md b/docs/longhornctl_global-options.md index 5324adc6..0984fd29 100644 --- a/docs/longhornctl_global-options.md +++ b/docs/longhornctl_global-options.md @@ -28,4 +28,4 @@ longhornctl global-options [flags] * [longhornctl](longhornctl.md) - Longhorn commandline interface. -###### Auto generated by spf13/cobra on 27-Sep-2024 +###### Auto generated by spf13/cobra on 13-Oct-2024 diff --git a/docs/longhornctl_install.md b/docs/longhornctl_install.md index 5d6f6ee1..c19e6824 100644 --- a/docs/longhornctl_install.md +++ b/docs/longhornctl_install.md @@ -16,4 +16,4 @@ Longhorn installation operations * [longhornctl](longhornctl.md) - Longhorn commandline interface. * [longhornctl install preflight](longhornctl_install_preflight.md) - Install Longhorn preflight -###### Auto generated by spf13/cobra on 27-Sep-2024 +###### Auto generated by spf13/cobra on 13-Oct-2024 diff --git a/docs/longhornctl_install_preflight.md b/docs/longhornctl_install_preflight.md index a82c7e7f..32578b49 100644 --- a/docs/longhornctl_install_preflight.md +++ b/docs/longhornctl_install_preflight.md @@ -45,4 +45,4 @@ INFO[2024-07-16T17:09:08+08:00] Completed preflight installer. Use 'longhornctl * [longhornctl install](longhornctl_install.md) - Longhorn installation operations * [longhornctl install preflight stop](longhornctl_install_preflight_stop.md) - Stop Longhorn preflight installer -###### Auto generated by spf13/cobra on 27-Sep-2024 +###### Auto generated by spf13/cobra on 13-Oct-2024 diff --git a/docs/longhornctl_install_preflight_stop.md b/docs/longhornctl_install_preflight_stop.md index 2bc7cb7b..b5e2718f 100644 --- a/docs/longhornctl_install_preflight_stop.md +++ b/docs/longhornctl_install_preflight_stop.md @@ -32,4 +32,4 @@ INFO[2024-07-16T17:21:32+08:00] Successfully stopped preflight installer * [longhornctl install preflight](longhornctl_install_preflight.md) - Install Longhorn preflight -###### Auto generated by spf13/cobra on 27-Sep-2024 +###### Auto generated by spf13/cobra on 13-Oct-2024 diff --git a/docs/longhornctl_trim.md b/docs/longhornctl_trim.md index 083cb6f7..ccce939c 100644 --- a/docs/longhornctl_trim.md +++ b/docs/longhornctl_trim.md @@ -16,4 +16,4 @@ Longhorn trimming operations * [longhornctl](longhornctl.md) - Longhorn commandline interface. * [longhornctl trim volume](longhornctl_trim_volume.md) - Trim a Longhorn volume -###### Auto generated by spf13/cobra on 27-Sep-2024 +###### Auto generated by spf13/cobra on 13-Oct-2024 diff --git a/docs/longhornctl_trim_volume.md b/docs/longhornctl_trim_volume.md index 60f5c66c..e85b2e30 100644 --- a/docs/longhornctl_trim_volume.md +++ b/docs/longhornctl_trim_volume.md @@ -42,4 +42,4 @@ INFO[2024-07-16T17:32:01+08:00] Completed volume trimmer vo * [longhornctl trim](longhornctl_trim.md) - Longhorn trimming operations -###### Auto generated by spf13/cobra on 27-Sep-2024 +###### Auto generated by spf13/cobra on 13-Oct-2024 diff --git a/docs/longhornctl_version.md b/docs/longhornctl_version.md index 0f17521f..d4a14fe6 100644 --- a/docs/longhornctl_version.md +++ b/docs/longhornctl_version.md @@ -24,4 +24,4 @@ longhornctl version [flags] * [longhornctl](longhornctl.md) - Longhorn commandline interface. -###### Auto generated by spf13/cobra on 27-Sep-2024 +###### Auto generated by spf13/cobra on 13-Oct-2024 diff --git a/go.mod b/go.mod index 494a53ee..012a7a09 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/longhorn/cli -go 1.22.7 +go 1.23 toolchain go1.23.2 @@ -99,7 +99,7 @@ require ( k8s.io/mount-utils v0.31.1 // indirect sigs.k8s.io/controller-runtime v0.19.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/kustomize/api v0.17.2 // indirect + sigs.k8s.io/kustomize/api v0.18.0 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/go.sum b/go.sum index 885f95fa..a0052902 100644 --- a/go.sum +++ b/go.sum @@ -276,8 +276,8 @@ sigs.k8s.io/controller-runtime v0.19.0 h1:nWVM7aq+Il2ABxwiCizrVDSlmDcshi9llbaFbC sigs.k8s.io/controller-runtime v0.19.0/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/kustomize/api v0.17.2 h1:E7/Fjk7V5fboiuijoZHgs4aHuexi5Y2loXlVOAVAG5g= -sigs.k8s.io/kustomize/api v0.17.2/go.mod h1:UWTz9Ct+MvoeQsHcJ5e+vziRRkwimm3HytpZgIYqye0= +sigs.k8s.io/kustomize/api v0.18.0 h1:hTzp67k+3NEVInwz5BHyzc9rGxIauoXferXyjv5lWPo= +sigs.k8s.io/kustomize/api v0.18.0/go.mod h1:f8isXnX+8b+SGLHQ6yO4JG1rdkZlvhaCf/uZbLVMb0U= sigs.k8s.io/kustomize/kyaml v0.18.1 h1:WvBo56Wzw3fjS+7vBjN6TeivvpbW9GmRaWZ9CIVmt4E= sigs.k8s.io/kustomize/kyaml v0.18.1/go.mod h1:C3L2BFVU1jgcddNBE1TxuVLgS46TjObMwW5FT9FcjYo= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= diff --git a/vendor/modules.txt b/vendor/modules.txt index fb515993..a7eca963 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -835,8 +835,8 @@ sigs.k8s.io/controller-runtime/pkg/conversion ## explicit; go 1.18 sigs.k8s.io/json sigs.k8s.io/json/internal/golang/encoding/json -# sigs.k8s.io/kustomize/api v0.17.2 -## explicit; go 1.21 +# sigs.k8s.io/kustomize/api v0.18.0 +## explicit; go 1.22.7 sigs.k8s.io/kustomize/api/filters/annotations sigs.k8s.io/kustomize/api/filters/fieldspec sigs.k8s.io/kustomize/api/filters/filtersutil diff --git a/vendor/sigs.k8s.io/kustomize/api/internal/builtins/HelmChartInflationGenerator.go b/vendor/sigs.k8s.io/kustomize/api/internal/builtins/HelmChartInflationGenerator.go index c93c18c0..06d13b52 100644 --- a/vendor/sigs.k8s.io/kustomize/api/internal/builtins/HelmChartInflationGenerator.go +++ b/vendor/sigs.k8s.io/kustomize/api/internal/builtins/HelmChartInflationGenerator.go @@ -10,6 +10,7 @@ import ( "os/exec" "path/filepath" "regexp" + "slices" "strings" "sigs.k8s.io/kustomize/api/resmap" @@ -62,6 +63,9 @@ func (p *HelmChartInflationGeneratorPlugin) Config( if len(h.GeneralConfig().HelmConfig.ApiVersions) != 0 { p.HelmChart.ApiVersions = h.GeneralConfig().HelmConfig.ApiVersions } + if h.GeneralConfig().HelmConfig.Debug { + p.HelmChart.Debug = h.GeneralConfig().HelmConfig.Debug + } p.h = h if err = yaml.Unmarshal(config, p); err != nil { @@ -168,13 +172,17 @@ func (p *HelmChartInflationGeneratorPlugin) runHelmCommand( fmt.Sprintf("HELM_DATA_HOME=%s/.data", p.ConfigHome)} cmd.Env = append(os.Environ(), env...) err := cmd.Run() + errorOutput := stderr.String() + if slices.Contains(args, "--debug") { + errorOutput = " Helm stack trace:\n" + errorOutput + "\nHelm template:\n" + stdout.String() + "\n" + } if err != nil { helm := p.h.GeneralConfig().HelmConfig.Command err = errors.WrapPrefixf( fmt.Errorf( "unable to run: '%s %s' with env=%s (is '%s' installed?): %w", helm, strings.Join(args, " "), env, helm, err), - stderr.String(), + errorOutput, ) } return stdout.Bytes(), err diff --git a/vendor/sigs.k8s.io/kustomize/api/internal/builtins/SortOrderTransformer.go b/vendor/sigs.k8s.io/kustomize/api/internal/builtins/SortOrderTransformer.go index c50f627f..90e29071 100644 --- a/vendor/sigs.k8s.io/kustomize/api/internal/builtins/SortOrderTransformer.go +++ b/vendor/sigs.k8s.io/kustomize/api/internal/builtins/SortOrderTransformer.go @@ -151,6 +151,9 @@ func gvkLessThan(gvk1, gvk2 resid.Gvk, typeOrders map[string]int) bool { if index1 != index2 { return index1 < index2 } + if (gvk1.Kind == types.NamespaceKind && gvk2.Kind == types.NamespaceKind) && (gvk1.Group == "" || gvk2.Group == "") { + return legacyGVKSortString(gvk1) > legacyGVKSortString(gvk2) + } return legacyGVKSortString(gvk1) < legacyGVKSortString(gvk2) } diff --git a/vendor/sigs.k8s.io/kustomize/api/internal/konfig/builtinpluginconsts/namereference.go b/vendor/sigs.k8s.io/kustomize/api/internal/konfig/builtinpluginconsts/namereference.go index 658b0c34..383dcf83 100644 --- a/vendor/sigs.k8s.io/kustomize/api/internal/konfig/builtinpluginconsts/namereference.go +++ b/vendor/sigs.k8s.io/kustomize/api/internal/konfig/builtinpluginconsts/namereference.go @@ -421,6 +421,13 @@ nameReference: fieldSpecs: - path: spec/ingressClassName kind: Ingress + +- kind: ValidatingAdmissionPolicy + group: admissionregistration.k8s.io + fieldSpecs: + - path: spec/policyName + kind: ValidatingAdmissionPolicyBinding + group: admissionregistration.k8s.io ` ) diff --git a/vendor/sigs.k8s.io/kustomize/api/internal/plugins/fnplugin/fnplugin.go b/vendor/sigs.k8s.io/kustomize/api/internal/plugins/fnplugin/fnplugin.go index 3a033d72..0ec06756 100644 --- a/vendor/sigs.k8s.io/kustomize/api/internal/plugins/fnplugin/fnplugin.go +++ b/vendor/sigs.k8s.io/kustomize/api/internal/plugins/fnplugin/fnplugin.go @@ -77,7 +77,6 @@ func NewFnPlugin(o *types.FnPluginLoadingOptions) *FnPlugin { runFns: runfn.RunFns{ Functions: []*yaml.RNode{}, Network: o.Network, - EnableStarlark: o.EnableStar, EnableExec: o.EnableExec, StorageMounts: toStorageMounts(o.Mounts), Env: o.Env, diff --git a/vendor/sigs.k8s.io/kustomize/api/internal/target/kusttarget.go b/vendor/sigs.k8s.io/kustomize/api/internal/target/kusttarget.go index 44c82bc5..5f1d1095 100644 --- a/vendor/sigs.k8s.io/kustomize/api/internal/target/kusttarget.go +++ b/vendor/sigs.k8s.io/kustomize/api/internal/target/kusttarget.go @@ -449,9 +449,6 @@ func (kt *KustTarget) accumulateResources( ra, err = kt.accumulateDirectory(ra, ldr, false) } if err != nil { - if kusterr.IsMalformedYAMLError(errF) { // Some error occurred while tyring to decode YAML file - return nil, errF - } return nil, errors.WrapPrefixf( err, "accumulation err='%s'", errF.Error()) } @@ -460,7 +457,7 @@ func (kt *KustTarget) accumulateResources( return ra, nil } -// accumulateResources fills the given resourceAccumulator +// accumulateComponents fills the given resourceAccumulator // with resources read from the given list of paths. func (kt *KustTarget) accumulateComponents( ra *accumulator.ResAccumulator, paths []string) (*accumulator.ResAccumulator, error) { diff --git a/vendor/sigs.k8s.io/kustomize/api/resource/factory.go b/vendor/sigs.k8s.io/kustomize/api/resource/factory.go index fef2f6e4..a42f93bb 100644 --- a/vendor/sigs.k8s.io/kustomize/api/resource/factory.go +++ b/vendor/sigs.k8s.io/kustomize/api/resource/factory.go @@ -202,7 +202,10 @@ func (rf *Factory) inlineAnyEmbeddedLists( } items, ok := m["items"] if !ok { - // treat as an empty list + // Items field is not present. + // This is not a collections resource. + // read more https://kubernetes.io/docs/reference/using-api/api-concepts/#collections + result = append(result, n0) continue } slice, ok := items.([]interface{}) diff --git a/vendor/sigs.k8s.io/kustomize/api/types/helmchartargs.go b/vendor/sigs.k8s.io/kustomize/api/types/helmchartargs.go index 1ed89c01..b96fbfb1 100644 --- a/vendor/sigs.k8s.io/kustomize/api/types/helmchartargs.go +++ b/vendor/sigs.k8s.io/kustomize/api/types/helmchartargs.go @@ -96,6 +96,9 @@ type HelmChart struct { // SkipTests skips tests from templated output. SkipTests bool `json:"skipTests,omitempty" yaml:"skipTests,omitempty"` + + // debug enables debug output from the Helm chart inflator generator. + Debug bool `json:"debug,omitempty" yaml:"debug,omitempty"` } // HelmChartArgs contains arguments to helm. @@ -188,5 +191,8 @@ func (h HelmChart) AsHelmArgs(absChartHome string) []string { if h.SkipHooks { args = append(args, "--no-hooks") } + if h.Debug { + args = append(args, "--debug") + } return args } diff --git a/vendor/sigs.k8s.io/kustomize/api/types/kustomization.go b/vendor/sigs.k8s.io/kustomize/api/types/kustomization.go index f86ec0b9..6caa2966 100644 --- a/vendor/sigs.k8s.io/kustomize/api/types/kustomization.go +++ b/vendor/sigs.k8s.io/kustomize/api/types/kustomization.go @@ -22,6 +22,7 @@ const ( MetadataNamespacePath = "metadata/namespace" MetadataNamespaceApiVersion = "v1" MetadataNamePath = "metadata/name" + NamespaceKind = "Namespace" OriginAnnotations = "originAnnotations" TransformerAnnotations = "transformerAnnotations" @@ -55,6 +56,7 @@ type Kustomization struct { // Namespace to add to all objects. Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` + // Deprecated: Use the Labels field instead, which provides a superset of the functionality of CommonLabels. // CommonLabels to add to all objects and selectors. CommonLabels map[string]string `json:"commonLabels,omitempty" yaml:"commonLabels,omitempty"` diff --git a/vendor/sigs.k8s.io/kustomize/api/types/pluginconfig.go b/vendor/sigs.k8s.io/kustomize/api/types/pluginconfig.go index aa511ae7..9721eb72 100644 --- a/vendor/sigs.k8s.io/kustomize/api/types/pluginconfig.go +++ b/vendor/sigs.k8s.io/kustomize/api/types/pluginconfig.go @@ -8,6 +8,7 @@ type HelmConfig struct { Command string ApiVersions []string KubeVersion string + Debug bool } // PluginConfig holds plugin configuration. @@ -27,7 +28,6 @@ type PluginConfig struct { func EnabledPluginConfig(b BuiltinPluginLoadingOptions) (pc *PluginConfig) { pc = MakePluginConfig(PluginRestrictionsNone, b) - pc.FnpLoadingOptions.EnableStar = true pc.HelmConfig.Enabled = true // If this command is not on PATH, tests needing it should skip. pc.HelmConfig.Command = "helmV3" diff --git a/vendor/sigs.k8s.io/kustomize/api/types/pluginrestrictions.go b/vendor/sigs.k8s.io/kustomize/api/types/pluginrestrictions.go index 88b03b3f..0e4ee42e 100644 --- a/vendor/sigs.k8s.io/kustomize/api/types/pluginrestrictions.go +++ b/vendor/sigs.k8s.io/kustomize/api/types/pluginrestrictions.go @@ -46,8 +46,6 @@ const ( type FnPluginLoadingOptions struct { // Allow to run executables EnableExec bool - // Allow to run starlark - EnableStar bool // Allow container access to network Network bool NetworkName string