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 20, 2020
1 parent 27f9114 commit 7d579c1
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
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
2 changes: 2 additions & 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.

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 7d579c1

Please sign in to comment.