Skip to content

Commit

Permalink
Merge branch 'master' into linasn/sts-rolling-restart
Browse files Browse the repository at this point in the history
* master:
  Backwards compatibility when using the original update annoation with an OnDelete update strategy (#284)
  Add support for parallel node updates within a statefulset (#283)
  Support namespace ExtendedOptions in cluster spec (#282)
  [controller] Support multi instance placement add (#275)
  [gomod] Update M3DB dependency (#277)
  [cmd] Fix instrument package name (#280)

# Conflicts:
#	pkg/k8sops/annotations/annotations.go
  • Loading branch information
soundvibe committed Apr 1, 2021
2 parents 1042a2e + 5d3e770 commit 10021af
Show file tree
Hide file tree
Showing 25 changed files with 901 additions and 241 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ linux-amd64/

# Helm packages
helm/**/*.tgz

# Vim swap files
*.swp
4 changes: 3 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ linters-settings:
github.com/golang/protobuf/proto: "replace with github.com/gogo/protobuf/proto"
google.golang.org/protobuf/proto: "replace with github.com/gogo/protobuf/proto"
github.com/tj/assert: "use github.com/stretchr/testify/assert"
github.com/m3db/m3x/instrument: "use github.com/m3db/m3/instrument"
github.com/m3db/m3x/instrument: "use github.com/m3db/m3/src/x/instrument"
misspell:
# Correct spellings using locale preferences for US or UK.
# Default is to use a neutral variety of English.
Expand Down Expand Up @@ -211,6 +211,8 @@ linters:
# New line required before return would require a large fraction of the
# code base to need updating, it's not worth the perceived benefit.
- nlreturn
# Opinionated and sometimes wrong.
- paralleltest
disable-all: false
presets:
# bodyclose, errcheck, gosec, govet, scopelint, staticcheck, typecheck
Expand Down
2 changes: 1 addition & 1 deletion cmd/m3db-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
"github.com/m3db/m3db-operator/pkg/k8sops/m3db"
"github.com/m3db/m3db-operator/pkg/k8sops/podidentity"

"github.com/m3db/m3x/instrument"
"github.com/m3db/m3/src/x/instrument"

apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ require (
github.com/googleapis/gnostic v0.3.1 // indirect
github.com/hashicorp/go-retryablehttp v0.6.0
github.com/m3db/build-tools v0.0.0-20181013000606-edd1bdd1df8a
github.com/m3db/m3 v0.15.18-0.20201027011129-53414ba8082a
github.com/m3db/m3x v0.0.0-20190408051622-ebf3c7b94afd
github.com/m3db/m3 v1.1.1-0.20210302095536-802492679da1
github.com/m3db/tools v0.0.0-20181008195521-c6ded3f34878
github.com/pkg/errors v0.9.1
github.com/rakyll/statik v0.1.6
github.com/stretchr/testify v1.7.0
github.com/toqueteos/webbrowser v1.2.0 // indirect
github.com/uber-go/tally v3.3.13+incompatible
github.com/uber-go/tally v3.3.17+incompatible
github.com/urfave/cli v1.22.2 // indirect
go.uber.org/atomic v1.6.0
go.uber.org/zap v1.13.0
Expand Down
59 changes: 30 additions & 29 deletions go.sum

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions pkg/apis/m3dboperator/v1alpha1/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ const (
// been created for the cluster.
ClusterConditionPlacementInitialized ClusterConditionType = "PlacementInitialized"

// ClusterConditionPodBootstrapping indicates there is a pod bootstrapping.
ClusterConditionPodBootstrapping ClusterConditionType = "PodBootstrapping"
// ClusterConditionPodsBootstrapping indicates there are pods bootstrapping.
ClusterConditionPodsBootstrapping ClusterConditionType = "PodsBootstrapping"
)

// M3DBCluster defines the cluster
Expand Down Expand Up @@ -103,10 +103,10 @@ func (s *M3DBStatus) HasInitializedPlacement() bool {
return s.hasConditionTrue(ClusterConditionPlacementInitialized)
}

// HasPodBootstrapping returns true if conditions indicate a pod is currently
// HasPodsBootstrapping returns true if conditions indicate a pod is currently
// bootstrapping.
func (s *M3DBStatus) HasPodBootstrapping() bool {
return s.hasConditionTrue(ClusterConditionPodBootstrapping)
func (s *M3DBStatus) HasPodsBootstrapping() bool {
return s.hasConditionTrue(ClusterConditionPodsBootstrapping)
}

// GetCondition returns the specified cluster condition if it exists with a bool
Expand Down Expand Up @@ -319,6 +319,10 @@ type ClusterSpec struct {
// SidecarVolumes is used to add any volumes that are required by sidecar
// containers.
SidecarVolumes []corev1.Volume `json:"sidecarVolumes,omitempty"`

// OnDeleteUpdateStrategy sets StatefulSets created by the operator to
// have OnDelete as the update strategy instead of RollingUpdate.
OnDeleteUpdateStrategy bool `json:"onDeleteUpdateStrategy,omitempty"`
}

// ExternalCoordinatorConfig defines parameters for using an external
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/m3dboperator/v1alpha1/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ func TestStatus(t *testing.T) {
f: func(s *M3DBStatus) bool { return s.HasInitializedPlacement() },
},
{
cond: ClusterConditionPodBootstrapping,
f: func(s *M3DBStatus) bool { return s.HasPodBootstrapping() },
cond: ClusterConditionPodsBootstrapping,
f: func(s *M3DBStatus) bool { return s.HasPodsBootstrapping() },
},
} {
t.Run(string(test.cond), func(t *testing.T) {
Expand Down
11 changes: 11 additions & 0 deletions pkg/apis/m3dboperator/v1alpha1/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

package v1alpha1

import "encoding/json"

// Namespace defines an M3DB namespace or points to a preset M3DB namespace.
type Namespace struct {
// Name is the namespace name.
Expand Down Expand Up @@ -98,6 +100,12 @@ type DownsampleOptions struct {
All bool `json:"all,omitempty"`
}

// ExtendedOptions stores the extended namespace options.
type ExtendedOptions struct {
Type string `json:"type,omitempty"`
Options map[string]json.RawMessage `json:"options,omitempty"`
}

// NamespaceOptions defines parameters for an M3DB namespace. See
// https://m3db.github.io/m3/operational_guide/namespace_configuration/ for more
// details.
Expand Down Expand Up @@ -131,4 +139,7 @@ type NamespaceOptions struct {

// AggregationOptions sets the aggregation parameters.
AggregationOptions AggregationOptions `json:"aggregationOptions,omitempty"`

// ExtendedOptions stores the extended namespace options.
ExtendedOptions *ExtendedOptions `json:"extendedOptions,omitempty"`
}
7 changes: 7 additions & 0 deletions pkg/apis/m3dboperator/v1alpha1/openapi_generated.go

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

38 changes: 38 additions & 0 deletions pkg/apis/m3dboperator/v1alpha1/zz_generated.deepcopy.go

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

Loading

0 comments on commit 10021af

Please sign in to comment.