Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ dashboard/assets.go: $(DASHBOARDSOURCES) $(DASHBOARDDIR)/Dockerfile.build
.PHONY: bin
bin: $(BIN)

.PHONY: test-bin
test-bin: $(TESTBIN)

$(BIN): $(SOURCES) dashboard/assets.go VERSION
@mkdir -p $(BINDIR)
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -installsuffix netgo -ldflags "-X main.projectVersion=$(VERSION) -X main.projectBuild=$(COMMIT)" -o $(BIN) $(REPOPATH)
Expand Down
44 changes: 44 additions & 0 deletions pkg/apis/deployment/v1/const.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// DISCLAIMER
//
// Copyright 2020 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//

package v1

type LabelsMode string

const (
// LabelsDisabledMode disable annotations/labels override. Default if there is no annotations/labels set in ArangoDeployment
LabelsDisabledMode LabelsMode = "disabled"
// LabelsAppendMode add new annotations/labels without affecting old ones
LabelsAppendMode LabelsMode = "append"
// LabelsReplaceMode replace existing annotations/labels
LabelsReplaceMode LabelsMode = "replace"
)

func (a LabelsMode) New() *LabelsMode {
return &a
}

func (a *LabelsMode) Get(def LabelsMode) LabelsMode {
if a == nil {
return def
}

return *a
}
12 changes: 10 additions & 2 deletions pkg/apis/deployment/v1/deployment_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,18 @@ type DeploymentSpec struct {

NetworkAttachedVolumes *bool `json:"networkAttachedVolumes,omitempty"`

// Annotations specified the annotations added to all resources
// Annotations specified the annotations added to Pods in this group.
Annotations map[string]string `json:"annotations,omitempty"`
// Labels specified the labels added to all resources
// AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored
AnnotationsIgnoreList []string `json:"annotationsIgnoreList,omitempty"`
// AnnotationsMode Define annotations mode which should be use while overriding annotations
AnnotationsMode *LabelsMode `json:"annotationsMode,omitempty"`
// Labels specified the labels added to Pods in this group.
Labels map[string]string `json:"labels,omitempty"`
// LabelsIgnoreList list regexp or plain definitions which labels should be ignored
LabelsIgnoreList []string `json:"labelsIgnoreList,omitempty"`
// LabelsMode Define labels mode which should be use while overriding labels
LabelsMode *LabelsMode `json:"labelsMode,omitempty"`

RestoreFrom *string `json:"restoreFrom,omitempty"`

Expand Down
8 changes: 8 additions & 0 deletions pkg/apis/deployment/v1/server_group_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,16 @@ type ServerGroupSpec struct {
Tolerations []core.Toleration `json:"tolerations,omitempty"`
// Annotations specified the annotations added to Pods in this group.
Annotations map[string]string `json:"annotations,omitempty"`
// AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored
AnnotationsIgnoreList []string `json:"annotationsIgnoreList,omitempty"`
// AnnotationsMode Define annotations mode which should be use while overriding annotations
AnnotationsMode *LabelsMode `json:"annotationsMode,omitempty"`
// Labels specified the labels added to Pods in this group.
Labels map[string]string `json:"labels,omitempty"`
// LabelsIgnoreList list regexp or plain definitions which labels should be ignored
LabelsIgnoreList []string `json:"labelsIgnoreList,omitempty"`
// LabelsMode Define labels mode which should be use while overriding labels
LabelsMode *LabelsMode `json:"labelsMode,omitempty"`
// Envs allow to specify additional envs in this group.
Envs ServerGroupEnvVars `json:"envs,omitempty"`
// ServiceAccountName specifies the name of the service account used for Pods in this group.
Expand Down
40 changes: 40 additions & 0 deletions pkg/apis/deployment/v1/zz_generated.deepcopy.go

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

Loading