Skip to content

Commit

Permalink
Merge pull request #34 from invidian/release-v0.9.0
Browse files Browse the repository at this point in the history
Release v0.9.0
  • Loading branch information
invidian authored Aug 28, 2023
2 parents 5b4da12 + 61c8d65 commit eed093f
Show file tree
Hide file tree
Showing 16 changed files with 1,618 additions and 270 deletions.
37 changes: 33 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,25 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: golangci/golangci-lint:v1.46.0
container: golangci/golangci-lint:v1.54.2
steps:
- uses: actions/checkout@v2
with:
# Required for Codecov report uploading.
fetch-depth: 0
- run: make install-cc-test-reporter install-changelog BIN_PATH=/usr/local/bin
- run: make build build-test test-update-linters lint test-tidy test-changelog
- run: |
# Required to avoid error 'fatal: detected dubious ownership in repository at' while calling
# 'git status --porcelain'.
git config --global --add safe.directory /__w/terraform-provider-flexkube/terraform-provider-flexkube
make build build-test test-update-linters lint test-tidy test-changelog
- run: make test-cover-upload
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.18'
go-version: '1.21'
- uses: actions/cache@v2
with:
path: |
Expand All @@ -33,7 +37,32 @@ jobs:
- uses: actions/checkout@v2
- uses: hashicorp/setup-terraform@v1
- name: Setup containerd
uses: crazy-max/ghaction-setup-containerd@v1.3.0
run: |
# From https://docs.docker.com/engine/install/ubuntu/.
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
# From Flatcar default configuration and image-builder containerd role.
sudo sed -i 's/^disabled_plugins.*/disabled_plugins = []/g' /etc/containerd/config.toml
cat <<EOF | sudo tee -a /etc/containerd/config.toml
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
# setting runc.options unsets parent settings
runtime_type = "io.containerd.runc.v2"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
SystemdCgroup = true
EOF
sudo systemctl restart containerd
- name: Fetch dependencies and configure tests
run: |
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
Expand Down
20 changes: 14 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ linters-settings:

linters:
disable:
# We don't need this tight control over imports.
- depguard
# Disabled until we implement some error types and migrate to use them.
- goerr113
# As we use formatting rules from different linter and they are conflicting.
Expand All @@ -66,17 +68,17 @@ linters:
- maligned
- golint
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- containedctx
- contextcheck
- cyclop
- deadcode
- decorder
- depguard
- dogsled
- dupl
- dupword
- durationcheck
- errchkjson
- errname
Expand All @@ -86,6 +88,7 @@ linters:
- exportloopref
- forbidigo
- funlen
- gocheckcompilerdirectives
- gochecknoglobals
- gochecknoinits
- gocognit
Expand All @@ -101,14 +104,17 @@ linters:
- gomnd
- gomodguard
- goprintffuncname
- gosmopolitan
- grouper
- ifshort
- importas
- ineffassign
- interfacebloat
- lll
- maintidx
- makezero
- mirror
- misspell
- musttag
- nakedret
- nestif
- nilerr
Expand All @@ -122,20 +128,22 @@ linters:
- prealloc
- predeclared
- promlinter
- reassign
- revive
- sqlclosecheck
- structcheck
- stylecheck
- tagalign
- tagliatelle
- tenv
- testableexamples
- testpackage
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- varcheck
- usestdlibvars
- wastedassign
- whitespace
- wrapcheck
- wsl
- zerologlint
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.9.0] - 2023-08-28
### Changed
- Updated `libflexkube` version to `v0.10.0`.
- Updated remaining dependencies to latest versions.

## [0.8.0] - 2022-09-13
### Changed
- Updated `libflexkube` version to `v0.9.0`.
Expand Down Expand Up @@ -65,6 +70,7 @@ in `libflexkube` and `flexkube_pki` and `flexkube_etcd_cluster` resources compla
### Changed
- flexkube_containers: rename 'container' to 'host_configured_container'.

[0.9.0]: https://github.com/flexkube/terraform-provider-flexkube/compare/v0.8.0...v0.9.0
[0.8.0]: https://github.com/flexkube/terraform-provider-flexkube/compare/v0.7.0...v0.8.0
[0.7.0]: https://github.com/flexkube/terraform-provider-flexkube/compare/v0.6.0...v0.7.0
[0.6.0]: https://github.com/flexkube/terraform-provider-flexkube/compare/v0.5.1...v0.6.0
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ GOBUILD=CGO_ENABLED=$(CGO_ENABLED) $(GOCMD) build -v -buildmode=exe -ldflags $(L
GO_PACKAGES=./...
GO_TESTS=^.*$

GOLANGCI_LINT_VERSION=v1.46.0
GOLANGCI_LINT_VERSION=v1.54.2

BIN_PATH=$$HOME/bin

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ terraform {
required_providers {
flexkube = {
source = "flexkube/flexkube"
version = "0.7.0"
version = "0.9.0"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions e2e/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
FROM hashicorp/terraform:1.1.9
FROM hashicorp/terraform:1.5.5

RUN apk add -U make bash bash-completion vim coreutils

RUN wget https://get.helm.sh/helm-v3.8.1-linux-amd64.tar.gz -O - | tar -xzvf - linux-amd64/helm && \
RUN wget https://get.helm.sh/helm-v3.12.3-linux-amd64.tar.gz -O - | tar -xzvf - linux-amd64/helm && \
mv linux-amd64/helm /usr/local/bin/

RUN wget -O /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$(wget -q -O- https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& echo -e 'source /usr/share/bash-completion/bash_completion\nsource <(kubectl completion bash)' >> $HOME/.bashrc

RUN VERSION=0.56.6 OS=linux && \
RUN VERSION=0.56.17 OS=linux && \
wget "https://github.com/vmware-tanzu/sonobuoy/releases/download/v${VERSION}/sonobuoy_${VERSION}_${OS}_amd64.tar.gz" -O sonobuoy.tar.gz && \
tar -xzf sonobuoy.tar.gz -C /usr/local/bin && \
chmod +x /usr/local/bin/sonobuoy && \
Expand Down
12 changes: 6 additions & 6 deletions e2e/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ variable "metrics_server_helm_chart_source" {
}

variable "kube_apiserver_helm_chart_version" {
default = "0.5.0"
default = "0.8.0"
}

variable "kubernetes_helm_chart_version" {
default = "0.6.0"
default = "0.9.0"
}

variable "kube_proxy_helm_chart_version" {
default = "0.5.0"
default = "0.8.0"
}

variable "tls_bootstrapping_helm_chart_version" {
Expand All @@ -75,15 +75,15 @@ variable "coredns_helm_chart_version" {
}

variable "metrics_server_helm_chart_version" {
default = "3.0.9"
default = "3.0.10"
}

variable "kubelet_rubber_stamp_helm_chart_version" {
default = "0.1.8"
default = "0.1.9"
}

variable "calico_helm_chart_version" {
default = "0.4.22"
default = "0.5.1"
}

variable "flatcar_channel" {
Expand Down
4 changes: 2 additions & 2 deletions flexkube/direct.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
"github.com/flexkube/libflexkube/pkg/host/transport/direct"
)

func directMarshal(c direct.Config) interface{} {
func directMarshal(direct.Config) interface{} {
return []interface{}{map[string]interface{}{}}
}

func directUnmarshal(i interface{}) *direct.Config {
func directUnmarshal(interface{}) *direct.Config {
return &direct.Config{}
}

Expand Down
2 changes: 1 addition & 1 deletion flexkube/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func Provider() *schema.Provider {
}
}

func providerConfigure(d *schema.ResourceData) (interface{}, error) {
func providerConfigure(*schema.ResourceData) (interface{}, error) {
return &meta{
helmClientLock: sync.Mutex{},
}, nil
Expand Down
2 changes: 1 addition & 1 deletion flexkube/resource_controlplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func controlplaneUnmarshal(d getter, includeState bool) types.ResourceConfig {
return c
}

func controlplaneDestroy(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
func controlplaneDestroy(_ context.Context, d *schema.ResourceData, _ interface{}) diag.Diagnostics {
c := controlplaneUnmarshal(d, true)

c.(*controlplane.Controlplane).Destroy = true
Expand Down
6 changes: 3 additions & 3 deletions flexkube/resource_helm_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/flexkube/libflexkube/pkg/helm/release"
)

func validateYAML(v interface{}, s string) ([]string, []error) {
func validateYAML(v interface{}, _ string) ([]string, []error) {
var i interface{}

if err := yaml.Unmarshal([]byte(v.(string)), &i); err != nil {
Expand Down Expand Up @@ -123,7 +123,7 @@ func resourceHelmReleaseCreate(ctx context.Context, d *schema.ResourceData, m in
return nil
}

func resourceHelmReleaseRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
func resourceHelmReleaseRead(_ context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
release, err := getRelease(d, m)
if err != nil {
return diagFromErr(err)
Expand All @@ -143,7 +143,7 @@ func resourceHelmReleaseRead(ctx context.Context, d *schema.ResourceData, m inte
return nil
}

func resourceHelmReleaseDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
func resourceHelmReleaseDelete(_ context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
release, err := getRelease(d, m)
if err != nil {
return diagFromErr(err)
Expand Down
6 changes: 3 additions & 3 deletions flexkube/resource_pki.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func savePKI(d *schema.ResourceData, p *pki.PKI) error {
return nil
}

func resourcePKICreate(c context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
func resourcePKICreate(_ context.Context, d *schema.ResourceData, _ interface{}) diag.Diagnostics {
p, err := getPKI(d)
if err != nil {
return diagFromErr(fmt.Errorf("getting PKI: %w", err))
Expand All @@ -133,12 +133,12 @@ func resourcePKICreate(c context.Context, d *schema.ResourceData, m interface{})
return diagFromErr(savePKI(d, p))
}

func resourcePKIDelete(c context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
func resourcePKIDelete(_ context.Context, d *schema.ResourceData, _ interface{}) diag.Diagnostics {
d.SetId("")

return nil
}

func resourcePKIRead(c context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
func resourcePKIRead(context.Context, *schema.ResourceData, interface{}) diag.Diagnostics {
return nil
}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/flexkube/terraform-provider-flexkube
go 1.16

require (
github.com/flexkube/libflexkube v0.9.0
github.com/flexkube/libflexkube v0.10.0
github.com/google/go-cmp v0.5.9
github.com/hashicorp/terraform-plugin-sdk/v2 v2.22.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.28.0
sigs.k8s.io/yaml v1.3.0
)
Loading

0 comments on commit eed093f

Please sign in to comment.