Skip to content

Commit

Permalink
update dependency packages
Browse files Browse the repository at this point in the history
Signed-off-by: pixiake <[email protected]>
  • Loading branch information
pixiake committed Jan 15, 2024
1 parent b2fd070 commit e810acf
Show file tree
Hide file tree
Showing 8 changed files with 889 additions and 1,176 deletions.
10 changes: 5 additions & 5 deletions cmd/kk/apis/kubekey/v1alpha2/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ const (
DefaultEtcdVersion = "v3.5.6"
DefaultEtcdPort = "2379"
DefaultDockerVersion = "24.0.6"
DefaultContainerdVersion = "1.7.8"
DefaultRuncVersion = "v1.1.10"
DefaultCrictlVersion = "v1.24.0"
DefaultKubeVersion = "v1.23.10"
DefaultContainerdVersion = "1.7.12"
DefaultRuncVersion = "v1.1.11"
DefaultCrictlVersion = "v1.29.0"
DefaultKubeVersion = "v1.23.15"
DefaultCalicoVersion = "v3.26.1"
DefaultFlannelVersion = "v0.21.3"
DefaultFlannelCniPluginVersion = "v1.1.2"
Expand All @@ -54,7 +54,7 @@ const (
DefaulthybridnetVersion = "v0.8.6"
DefaultKubeovnVersion = "v1.10.6"
DefalutMultusVersion = "v3.8"
DefaultHelmVersion = "v3.9.0"
DefaultHelmVersion = "v3.13.3"
DefaultDockerComposeVersion = "v2.2.2"
DefaultRegistryVersion = "2"
DefaultHarborVersion = "v2.5.3"
Expand Down
64 changes: 34 additions & 30 deletions cmd/kk/pkg/addons/manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import (
"os"
"path/filepath"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/sets"

versionutil "k8s.io/apimachinery/pkg/util/version"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/printers"
"k8s.io/cli-runtime/pkg/resource"
"k8s.io/client-go/util/homedir"
"k8s.io/kubectl/pkg/cmd/apply"
cmdutil "k8s.io/kubectl/pkg/cmd/util"
Expand Down Expand Up @@ -57,12 +57,14 @@ func CreateApplyOptions(configFlags *genericclioptions.ConfigFlags, manifests []
f := cmdutil.NewFactory(matchVersionKubeConfigFlags)
ioStreams := genericclioptions.IOStreams{In: nil, Out: os.Stdout, ErrOut: os.Stderr}

flags := apply.NewApplyFlags(f, ioStreams)
return ToOptions(flags, manifests, version)
flags := apply.NewApplyFlags(ioStreams)

return ToOptions(f, flags, manifests, version)
}

func ToOptions(flags *apply.ApplyFlags, manifests []string, version string) (*apply.ApplyOptions, error) {
func ToOptions(f cmdutil.Factory, flags *apply.ApplyFlags, manifests []string, version string) (*apply.ApplyOptions, error) {
serverSideApply := false

cmp, err := versionutil.MustParseSemantic(version).Compare("v1.16.0")
if err != nil {
return nil, errors.New(fmt.Sprintf("Failed to compare version: %v", err))
Expand All @@ -75,22 +77,17 @@ func ToOptions(flags *apply.ApplyFlags, manifests []string, version string) (*ap

dryRunStrategy := cmdutil.DryRunNone

dynamicClient, err := flags.Factory.DynamicClient()
dynamicClient, err := f.DynamicClient()
if err != nil {
return nil, err
}

dryRunVerifier := resource.NewQueryParamVerifier(dynamicClient, flags.Factory.OpenAPIGetter(), resource.QueryParamDryRun)
fieldValidationVerifier := resource.NewQueryParamVerifier(dynamicClient, flags.Factory.OpenAPIGetter(), resource.QueryParamFieldValidation)
fieldManager := "client-side-apply"

// allow for a success message operation to be specified at print time
toPrinter := func(operation string) (printers.ResourcePrinter, error) {
flags.PrintFlags.NamePrintFlags.Operation = operation
cmdutil.PrintFlagsWithDryRunStrategy(flags.PrintFlags, dryRunStrategy)
return flags.PrintFlags.ToPrinter()
}
_ = flags.RecordFlags.CompleteWithChangeCause("")

recorder, err := flags.RecordFlags.ToRecorder()
if err != nil {
Expand All @@ -110,53 +107,60 @@ func ToOptions(flags *apply.ApplyFlags, manifests []string, version string) (*ap
return nil, err
}

openAPISchema, _ := flags.Factory.OpenAPISchema()
validator, err := flags.Factory.Validator("Ignore", fieldValidationVerifier)
openAPISchema, _ := f.OpenAPISchema()

validationDirective := metav1.FieldValidationIgnore
validator, err := f.Validator(validationDirective)
if err != nil {
return nil, err
}
builder := flags.Factory.NewBuilder()
mapper, err := flags.Factory.ToRESTMapper()
builder := f.NewBuilder()
mapper, err := f.ToRESTMapper()
if err != nil {
return nil, err
}

namespace, enforceNamespace, err := flags.Factory.ToRawKubeConfigLoader().Namespace()
namespace, enforceNamespace, err := f.ToRawKubeConfigLoader().Namespace()
if err != nil {
return nil, err
}

var applySet *apply.ApplySet

o := &apply.ApplyOptions{
// Store baseName for use in printing warnings / messages involving the base command name.
// This is useful for downstream command that wrap this one.

PrintFlags: flags.PrintFlags,

DeleteOptions: deleteOptions,
ToPrinter: toPrinter,
ServerSideApply: serverSideApply,
ForceConflicts: true,
FieldManager: fieldManager,
FieldManager: apply.FieldManagerClientSideApply,
Selector: flags.Selector,
DryRunStrategy: dryRunStrategy,
DryRunVerifier: dryRunVerifier,
Prune: flags.Prune,
PruneResources: flags.PruneResources,
All: flags.All,
Overwrite: flags.Overwrite,
OpenAPIPatch: flags.OpenAPIPatch,
PruneWhitelist: flags.PruneWhitelist,

Recorder: recorder,
Namespace: namespace,
EnforceNamespace: enforceNamespace,
Validator: validator,
Builder: builder,
Mapper: mapper,
DynamicClient: dynamicClient,
OpenAPISchema: openAPISchema,
Recorder: recorder,
Namespace: namespace,
EnforceNamespace: enforceNamespace,
Validator: validator,
ValidationDirective: validationDirective,
Builder: builder,
Mapper: mapper,
DynamicClient: dynamicClient,
OpenAPISchema: openAPISchema,

IOStreams: flags.IOStreams,

VisitedUids: sets.NewString(),
VisitedNamespaces: sets.NewString(),
VisitedUids: sets.New[types.UID](),
VisitedNamespaces: sets.New[string](),

ApplySet: applySet,
}

o.PostProcessorFn = o.PrintAndPrunePostProcessor()
Expand Down
2 changes: 2 additions & 0 deletions cmd/kk/pkg/artifact/templates/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ spec:
- type: {{ $v.Type }}
version: {{ $v.Version }}
{{- end}}
calicoctl:
version: {{ .Options.Components.Calicoctl.Version }}
crictl:
version: {{ .Options.Components.Crictl.Version }}
##
Expand Down
2 changes: 1 addition & 1 deletion cmd/kk/pkg/images/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ func (p *PushManifest) Execute(_ connector.Runtime) error {
logger.Log.Infof("Push multi-arch manifest list: %s", imageName)
// todo: the function can't support specify a certs dir
digest, length, err := manifestregistry.PushManifestList(auth.Username, auth.Password, manifestSpec,
false, true, auth.PlainHTTP, "")
false, true, auth.PlainHTTP, manifesttypes.OCI, "")
if err != nil {
return errors.Wrap(errors.WithStack(err), fmt.Sprintf("push image %s multi-arch manifest failed", imageName))
}
Expand Down
Loading

0 comments on commit e810acf

Please sign in to comment.