Skip to content

Commit

Permalink
Move packages related options to separate struct
Browse files Browse the repository at this point in the history
  • Loading branch information
Ciprian Hacman committed Dec 23, 2020
1 parent 4e804c9 commit 8bc3ce5
Show file tree
Hide file tree
Showing 18 changed files with 342 additions and 258 deletions.
10 changes: 6 additions & 4 deletions docs/cluster_spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -926,8 +926,9 @@ kOps uses the `.tar.gz` packages for installing containerd on any supported OS.
```yaml
spec:
containerd:
packageUrlAmd64: https://github.com/containerd/containerd/releases/download/v1.4.3/cri-containerd-cni-1.4.3-linux-amd64.tar.gz
packageHashAmd64: 2697a342e3477c211ab48313e259fd7e32ad1f5ded19320e6a559f50a82bff3d
packages:
urlAmd64: https://github.com/containerd/containerd/releases/download/v1.4.3/cri-containerd-cni-1.4.3-linux-amd64.tar.gz
hashAmd64: 2697a342e3477c211ab48313e259fd7e32ad1f5ded19320e6a559f50a82bff3d
```

The format of the custom package must be identical to the official packages:
Expand Down Expand Up @@ -1005,8 +1006,9 @@ kOps uses the `.tgz` (static) packages for installing Docker on any supported OS
```yaml
spec:
containerd:
packageUrlAmd64: https://download.docker.com/linux/static/stable/x86_64/docker-20.10.1.tgz
packageHashAmd64: 8790f3b94ee07ca69a9fdbd1310cbffc729af0a07e5bf9f34a79df1e13d2e50e
packages:
urlAmd64: https://download.docker.com/linux/static/stable/x86_64/docker-20.10.1.tgz
hashAmd64: 8790f3b94ee07ca69a9fdbd1310cbffc729af0a07e5bf9f34a79df1e13d2e50e
```

The format of the custom package must be identical to the official packages:
Expand Down
58 changes: 32 additions & 26 deletions k8s/crds/kops.k8s.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -493,19 +493,22 @@ spec:
description: LogLevel controls the logging details [trace, debug,
info, warn, error, fatal, panic] (default "info").
type: string
packageHashAmd64:
description: PackageHash overrides the hash for the AMD64 package.
type: string
packageHashArm64:
description: PackageHashArm64 overrides the hash for the ARM64
package.
type: string
packageUrlAmd64:
description: PackageUrl overrides the URL for the AMD64 package.
type: string
packageUrlArm64:
description: PackageUrlArm64 overrides the URL for the ARM64 package.
type: string
packages:
description: Packages overrides the URL and hash for the packages.
properties:
hashAmd64:
description: HashAmd64 overrides the hash for the AMD64 package.
type: string
hashArm64:
description: HashArm64 overrides the hash for the ARM64 package.
type: string
urlAmd64:
description: UrlAmd64 overrides the URL for the AMD64 package.
type: string
urlArm64:
description: UrlArm64 overrides the URL for the ARM64 package.
type: string
type: object
root:
description: Root directory for persistent data (default "/var/lib/containerd").
type: string
Expand Down Expand Up @@ -648,19 +651,22 @@ spec:
description: MTU is the containers network MTU
format: int32
type: integer
packageHashAmd64:
description: PackageHash overrides the hash for the AMD64 package.
type: string
packageHashArm64:
description: PackageHashArm64 overrides the hash for the ARM64
package.
type: string
packageUrlAmd64:
description: PackageUrl overrides the URL for the AMD64 package.
type: string
packageUrlArm64:
description: PackageUrlArm64 overrides the URL for the ARM64 package.
type: string
packages:
description: Packages overrides the URL and hash for the packages.
properties:
hashAmd64:
description: HashAmd64 overrides the hash for the AMD64 package.
type: string
hashArm64:
description: HashArm64 overrides the hash for the ARM64 package.
type: string
urlAmd64:
description: UrlAmd64 overrides the URL for the AMD64 package.
type: string
urlArm64:
description: UrlArm64 overrides the URL for the ARM64 package.
type: string
type: object
registryMirrors:
description: RegistryMirrors is a referred list of docker registry
mirror
Expand Down
11 changes: 11 additions & 0 deletions pkg/apis/kops/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -789,3 +789,14 @@ type RollingUpdate struct {
// +optional
MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"`
}

type PackagesConfig struct {
// HashAmd64 overrides the hash for the AMD64 package.
HashAmd64 *string `json:"hashAmd64,omitempty"`
// HashArm64 overrides the hash for the ARM64 package.
HashArm64 *string `json:"hashArm64,omitempty"`
// UrlAmd64 overrides the URL for the AMD64 package.
UrlAmd64 *string `json:"urlAmd64,omitempty"`
// UrlArm64 overrides the URL for the ARM64 package.
UrlArm64 *string `json:"urlArm64,omitempty"`
}
10 changes: 2 additions & 8 deletions pkg/apis/kops/containerdconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,8 @@ type ContainerdConfig struct {
ConfigOverride *string `json:"configOverride,omitempty"`
// LogLevel controls the logging details [trace, debug, info, warn, error, fatal, panic] (default "info").
LogLevel *string `json:"logLevel,omitempty" flag:"log-level"`
// PackageHash overrides the hash for the AMD64 package.
PackageHashAmd64 *string `json:"packageHashAmd64,omitempty"`
// PackageHashArm64 overrides the hash for the ARM64 package.
PackageHashArm64 *string `json:"packageHashArm64,omitempty"`
// PackageUrl overrides the URL for the AMD64 package.
PackageUrlAmd64 *string `json:"packageUrlAmd64,omitempty"`
// PackageUrlArm64 overrides the URL for the ARM64 package.
PackageUrlArm64 *string `json:"packageUrlArm64,omitempty"`
// Packages overrides the URL and hash for the packages.
Packages *PackagesConfig `json:"packages,omitempty"`
// Root directory for persistent data (default "/var/lib/containerd").
Root *string `json:"root,omitempty" flag:"root"`
// SkipInstall prevents kOps from installing and modifying containerd in any way (default "false").
Expand Down
10 changes: 2 additions & 8 deletions pkg/apis/kops/dockerconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,8 @@ type DockerConfig struct {
MetricsAddress *string `json:"metricsAddress,omitempty" flag:"metrics-addr"`
// MTU is the containers network MTU
MTU *int32 `json:"mtu,omitempty" flag:"mtu"`
// PackageHash overrides the hash for the AMD64 package.
PackageHashAmd64 *string `json:"packageHashAmd64,omitempty"`
// PackageHashArm64 overrides the hash for the ARM64 package.
PackageHashArm64 *string `json:"packageHashArm64,omitempty"`
// PackageUrl overrides the URL for the AMD64 package.
PackageUrlAmd64 *string `json:"packageUrlAmd64,omitempty"`
// PackageUrlArm64 overrides the URL for the ARM64 package.
PackageUrlArm64 *string `json:"packageUrlArm64,omitempty"`
// Packages overrides the URL and hash for the packages.
Packages *PackagesConfig `json:"packages,omitempty"`
// RegistryMirrors is a referred list of docker registry mirror
RegistryMirrors []string `json:"registryMirrors,omitempty" flag:"registry-mirror,repeat"`
// Runtimes registers an additional OCI compatible runtime (default [])
Expand Down
11 changes: 11 additions & 0 deletions pkg/apis/kops/v1alpha2/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -674,3 +674,14 @@ type RollingUpdate struct {
// +optional
MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"`
}

type PackagesConfig struct {
// HashAmd64 overrides the hash for the AMD64 package.
HashAmd64 *string `json:"hashAmd64,omitempty"`
// HashArm64 overrides the hash for the ARM64 package.
HashArm64 *string `json:"hashArm64,omitempty"`
// UrlAmd64 overrides the URL for the AMD64 package.
UrlAmd64 *string `json:"urlAmd64,omitempty"`
// UrlArm64 overrides the URL for the ARM64 package.
UrlArm64 *string `json:"urlArm64,omitempty"`
}
10 changes: 2 additions & 8 deletions pkg/apis/kops/v1alpha2/containerdconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,8 @@ type ContainerdConfig struct {
ConfigOverride *string `json:"configOverride,omitempty"`
// LogLevel controls the logging details [trace, debug, info, warn, error, fatal, panic] (default "info").
LogLevel *string `json:"logLevel,omitempty" flag:"log-level"`
// PackageHash overrides the hash for the AMD64 package.
PackageHashAmd64 *string `json:"packageHashAmd64,omitempty"`
// PackageHashArm64 overrides the hash for the ARM64 package.
PackageHashArm64 *string `json:"packageHashArm64,omitempty"`
// PackageUrl overrides the URL for the AMD64 package.
PackageUrlAmd64 *string `json:"packageUrlAmd64,omitempty"`
// PackageUrlArm64 overrides the URL for the ARM64 package.
PackageUrlArm64 *string `json:"packageUrlArm64,omitempty"`
// Packages overrides the URL and hash for the packages.
Packages *PackagesConfig `json:"packages,omitempty"`
// Root directory for persistent data (default "/var/lib/containerd").
Root *string `json:"root,omitempty" flag:"root"`
// SkipInstall prevents kOps from installing and modifying containerd in any way (default "false").
Expand Down
10 changes: 2 additions & 8 deletions pkg/apis/kops/v1alpha2/dockerconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,8 @@ type DockerConfig struct {
MetricsAddress *string `json:"metricsAddress,omitempty" flag:"metrics-addr"`
// MTU is the containers network MTU
MTU *int32 `json:"mtu,omitempty" flag:"mtu"`
// PackageHash overrides the hash for the AMD64 package.
PackageHashAmd64 *string `json:"packageHashAmd64,omitempty"`
// PackageHashArm64 overrides the hash for the ARM64 package.
PackageHashArm64 *string `json:"packageHashArm64,omitempty"`
// PackageUrl overrides the URL for the AMD64 package.
PackageUrlAmd64 *string `json:"packageUrlAmd64,omitempty"`
// PackageUrlArm64 overrides the URL for the ARM64 package.
PackageUrlArm64 *string `json:"packageUrlArm64,omitempty"`
// Packages overrides the URL and hash for the packages.
Packages *PackagesConfig `json:"packages,omitempty"`
// RegistryMirrors is a referred list of docker registry mirror
RegistryMirrors []string `json:"registryMirrors,omitempty" flag:"registry-mirror,repeat"`
// Runtimes registers an additional OCI compatible runtime (default [])
Expand Down
88 changes: 72 additions & 16 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8bc3ce5

Please sign in to comment.