Skip to content

Commit

Permalink
[weave] Add support for default version override
Browse files Browse the repository at this point in the history
In this commit, we enable users to override default version
of networking/Weave specs.

Signed-off-by: dntosas <ntosas@gmail.com>
  • Loading branch information
dntosas committed Nov 19, 2020
1 parent 27f9114 commit e9a172e
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,7 @@ k8s.io/cloud-provider v0.20.0-beta.2/go.mod h1:xu40/8K5o/wqZyuChUVqD5CoqVOVzKXE/
k8s.io/cloud-provider-openstack v1.18.0 h1:v/ebjNEdx0hBaygsRohSS643f41lj2CwvapCbn+aLOs=
k8s.io/cloud-provider-openstack v1.18.0/go.mod h1:03202t5Sp+4Vmk6pxJ/hVH0fEkm9gMc/pku/QpkJQMQ=
k8s.io/cluster-bootstrap v0.20.0-beta.2/go.mod h1:kYKZIdQhCt0sh13R7Bjm1JXDg9QVjez8TLlyhtDC8Ck=
k8s.io/code-generator v0.20.0-beta.2 h1:9b5RwuTexjs/UH3BUMCMI4lTECshBUc/DenKnKc3eCs=
k8s.io/code-generator v0.20.0-beta.2/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg=
k8s.io/component-base v0.20.0-beta.2 h1:jg3eglA+HSDgimMoHoFvAiwHAGYxEy2D5HKhLPR4AjM=
k8s.io/component-base v0.20.0-beta.2/go.mod h1:PS+w/i0JTsaQbtzk8EVPlj2WrY9E23MfWK/K4MNy7uc=
Expand Down
3 changes: 3 additions & 0 deletions k8s/crds/kops.k8s.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2684,6 +2684,9 @@ spec:
description: NPCMemoryRequest memory request of weave npc container. Default 200Mi
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
version:
description: Version overrides the default tag of Weave container image.
type: string
type: object
type: object
nodeAuthorization:
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/kops/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ type WeaveNetworkingSpec struct {
NPCCPULimit *resource.Quantity `json:"npcCPULimit,omitempty"`
// NPCExtraArgs are extra arguments that are passed to weave-npc.
NPCExtraArgs string `json:"npcExtraArgs,omitempty"`

// Version overrides the default tag of Weave container image.
Version string `json:"version,omitempty"`
}

// FlannelNetworkingSpec declares that we want Flannel networking
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/kops/v1alpha2/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ type WeaveNetworkingSpec struct {
NPCCPULimit *resource.Quantity `json:"npcCPULimit,omitempty"`
// NPCExtraArgs are extra arguments that are passed to weave-npc.
NPCExtraArgs string `json:"npcExtraArgs,omitempty"`

// Version overrides the default tag of Weave container image.
Version string `json:"version,omitempty"`
}

// FlannelNetworkingSpec declares that we want Flannel networking
Expand Down
1 change: 1 addition & 0 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.

5 changes: 5 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go

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

4 changes: 2 additions & 2 deletions upup/models/bindata.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ spec:
name: weave-net
key: network-password
{{- end }}
image: 'weaveworks/weave-kube:2.7.0'
image: 'weaveworks/weave-kube:{{ or .Networking.Weave.Version "2.7.0" }}'
ports:
- name: metrics
containerPort: 6782
Expand Down Expand Up @@ -224,7 +224,7 @@ spec:
- name: EXTRA_ARGS
value: "{{ .Networking.Weave.NPCExtraArgs }}"
{{- end }}
image: 'weaveworks/weave-npc:2.7.0'
image: 'weaveworks/weave-npc:{{ or .Networking.Weave.Version "2.7.0" }}'
ports:
- name: metrics
containerPort: 6781
Expand Down

0 comments on commit e9a172e

Please sign in to comment.