1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

[Feature] Add spec.upgrade.debugLog option to configure upgrade container logging - GT-356 (#1442)

This commit is contained in:
Nikita Vaniasin 2023-10-19 11:11:23 +02:00 committed by GitHub
parent 6f6fcb8ba4
commit 3e846a9dce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 63 additions and 9 deletions

View file

@ -4,6 +4,7 @@
- (Maintenance) Update go-driver to v1.6.0, update IsNotFound() checks
- (Improvement) Print assigned node name to log and condition message when pod is scheduled
- (Maintenance) Remove obsolete docs, restructure for better UX, generate index files
- (Feature) Add `spec.upgrade.debugLog` option to configure upgrade container logging
## [1.2.34](https://github.com/arangodb/kube-arangodb/tree/1.2.34) (2023-10-16)
- (Bugfix) Fix make manifests-crd-file command

View file

@ -4074,7 +4074,18 @@ Must be in format accepted by "tzdata", e.g. `America/New_York` or `Europe/Londo
### .spec.upgrade.autoUpgrade: bool
Flag specify if upgrade should be auto-injected, even if is not required (in case of stuck)
AutoUpgrade flag specifies if upgrade should be auto-injected, even if is not required (in case of stuck)
[Code Reference](/pkg/apis/deployment/v1/deployment_upgrade_spec.go#L25)
Default Value: false
[Code Reference](/pkg/apis/deployment/v1/deployment_upgrade_spec.go#L26)
### .spec.upgrade.debugLog: bool
DebugLog flag specifies if containers running upgrade process should print more debugging information.
This applies only to init containers.
Default Value: false
[Code Reference](/pkg/apis/deployment/v1/deployment_upgrade_spec.go#L30)

View file

@ -1,7 +1,7 @@
//
// DISCLAIMER
//
// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
// Copyright 2016-2023 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.
@ -21,8 +21,13 @@
package v1
type DeploymentUpgradeSpec struct {
// Flag specify if upgrade should be auto-injected, even if is not required (in case of stuck)
// AutoUpgrade flag specifies if upgrade should be auto-injected, even if is not required (in case of stuck)
// +doc/default: false
AutoUpgrade bool `json:"autoUpgrade"`
// DebugLog flag specifies if containers running upgrade process should print more debugging information.
// This applies only to init containers.
// +doc/default: false
DebugLog bool `json:"debugLog"`
}
func (d *DeploymentUpgradeSpec) Get() DeploymentUpgradeSpec {

View file

@ -252,7 +252,7 @@ type DeploymentSpec struct {
// Architecture defines the list of supported architectures.
// First element on the list is marked as default architecture.
// +doc/link: Architecture Change|/docs/design/arch_change.md
// +doc/link: Architecture Change|/docs/how-to/arch_change.md
// +doc/type: []string
// +doc/default: ['amd64']
Architecture ArangoDeploymentArchitecture `json:"architecture,omitempty"`

View file

@ -1,7 +1,7 @@
//
// DISCLAIMER
//
// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
// Copyright 2016-2023 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.
@ -21,8 +21,13 @@
package v2alpha1
type DeploymentUpgradeSpec struct {
// Flag specify if upgrade should be auto-injected, even if is not required (in case of stuck)
// AutoUpgrade flag specifies if upgrade should be auto-injected, even if is not required (in case of stuck)
// +doc/default: false
AutoUpgrade bool `json:"autoUpgrade"`
// DebugLog flag specifies if containers running upgrade process should print more debugging information.
// This applies only to init containers.
// +doc/default: false
DebugLog bool `json:"debugLog"`
}
func (d *DeploymentUpgradeSpec) Get() DeploymentUpgradeSpec {

View file

@ -1,7 +1,7 @@
//
// DISCLAIMER
//
// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
// Copyright 2016-2023 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.
@ -57,3 +57,32 @@ func (u autoUpgrade) Args(i Input) k8sutil.OptionPairs {
return k8sutil.NewOptionPair(k8sutil.OptionPair{Key: "--database.auto-upgrade", Value: "true"})
}
func UpgradeDebug() Builder {
return upgradeDebug{}
}
type upgradeDebug struct{}
func (u upgradeDebug) Envs(i Input) []core.EnvVar {
return nil
}
func (u upgradeDebug) Verify(i Input, cachedStatus interfaces.Inspector) error {
return nil
}
func (u upgradeDebug) Volumes(i Input) ([]core.Volume, []core.VolumeMount) {
return nil, nil
}
func (u upgradeDebug) Args(i Input) k8sutil.OptionPairs {
pairs := k8sutil.NewOptionPair()
if i.Deployment.Upgrade.Get().DebugLog {
pairs = append(pairs, k8sutil.OptionPair{
Key: "--log.level",
Value: "all=debug",
})
}
return pairs
}

View file

@ -662,7 +662,10 @@ func (a *ArangoUpgradeContainer) GetCommand() ([]string, error) {
return nil, err
}
upgradeArgs := pod.AutoUpgrade().Args(a.input).Sort().AsArgs()
upgradeArgs := append(
pod.AutoUpgrade().Args(a.input).Sort().AsArgs(),
pod.UpgradeDebug().Args(a.input).Sort().AsArgs()...,
)
return append(args, upgradeArgs...), nil
}