Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	Makefile
#	api/api.pb.go
#	go.mod
#	go.sum
#	pkg/apis/v1alpha1/types.go
#	pkg/controller/collectorset.go
#	pkg/controller/logicmonitor.go
  • Loading branch information
lmshubhashri committed Dec 1, 2021
2 parents e60c522 + cdb715e commit 1cf49ad
Show file tree
Hide file tree
Showing 195 changed files with 16,600 additions and 8,433 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/daixiang0/gci v0.2.9 // indirect
github.com/go-openapi/runtime v0.19.4
github.com/go-openapi/strfmt v0.19.3
github.com/golang/protobuf v1.4.2
github.com/golang/protobuf v1.4.2 // indirect
github.com/googleapis/gnostic v0.4.0 // indirect
github.com/kelseyhightower/envconfig v1.4.0
github.com/kr/pretty v0.2.0 // indirect
Expand All @@ -16,7 +16,7 @@ require (
github.com/spf13/cobra v1.0.0
github.com/spf13/viper v1.7.1
google.golang.org/grpc v1.27.0
google.golang.org/protobuf v1.25.0 // indirect
google.golang.org/protobuf v1.25.0
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v2 v2.2.8
k8s.io/api v0.17.0
Expand Down
38 changes: 4 additions & 34 deletions go.sum

Large diffs are not rendered by default.

85 changes: 1 addition & 84 deletions pkg/controller/collectorset.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ func createStsObject(collectorset *crv1alpha2.CollectorSet, ids []int32, ignoreS
}
statefulset.Spec.PodManagementPolicy = appsv1.ParallelPodManagement

log.Infof("statefulset object= %v", statefulset.Spec.Template.Spec)
return &statefulset, nil
}

Expand Down Expand Up @@ -300,90 +301,6 @@ func validateTolerations(tolerations []apiv1.Toleration) {
}
}

func getCollectorImage(collectorset *crv1alpha1.CollectorSet) string {
if collectorset.Spec.ImageRepository == "" {
return constants.DefaultCollectorImage
}
imageTag := collectorset.Spec.ImageTag
if imageTag == "" {
imageTag = constants.DefaultCollectorImageTag
}
return collectorset.Spec.ImageRepository + ":" + imageTag
}

func getCollectorImagePullPolicy(collectorset *crv1alpha1.CollectorSet) (apiv1.PullPolicy, error) {
if collectorset.Spec.ImagePullPolicy == "" {
return constants.DefaultCollectorImagePullPolicy, nil
}
switch collectorset.Spec.ImagePullPolicy {
case apiv1.PullAlways, apiv1.PullNever, apiv1.PullIfNotPresent:
return collectorset.Spec.ImagePullPolicy, nil
}
return "", fmt.Errorf("unsupported imagePullPolicy value: %v, supported values: [%v, %v, %v]", collectorset.Spec.ImagePullPolicy, apiv1.PullAlways, apiv1.PullNever, apiv1.PullIfNotPresent)

}

func setProxyConfiguration(collectorset *crv1alpha1.CollectorSet, statefulset *appsv1.StatefulSet) {
if collectorset.Spec.ProxyURL == "" {
return
}
container := &statefulset.Spec.Template.Spec.Containers[0]
container.Env = append(container.Env,
apiv1.EnvVar{
Name: "proxy_url",
Value: collectorset.Spec.ProxyURL,
},
)
if collectorset.Spec.SecretName != "" {
secretIsOptionalTrue := true
container.Env = append(container.Env,
apiv1.EnvVar{
Name: "proxy_user",
ValueFrom: &apiv1.EnvVarSource{
SecretKeyRef: &apiv1.SecretKeySelector{
LocalObjectReference: apiv1.LocalObjectReference{
Name: collectorset.Spec.SecretName,
},
Key: "proxyUser",
Optional: &secretIsOptionalTrue,
},
},
},
apiv1.EnvVar{
Name: "proxy_pass",
ValueFrom: &apiv1.EnvVarSource{
SecretKeyRef: &apiv1.SecretKeySelector{
LocalObjectReference: apiv1.LocalObjectReference{
Name: collectorset.Spec.SecretName,
},
Key: "proxyPass",
Optional: &secretIsOptionalTrue,
},
},
},
)
}
}

func getTolerations(collectorset *crv1alpha1.CollectorSet) []v1.Toleration {
tolerations := []v1.Toleration{}
if collectorset.Spec.Tolerations != nil {
log.Debugf("Tolerations: %v", collectorset.Spec.Tolerations)
for _, toleration := range collectorset.Spec.Tolerations {
if toleration.Operator == v1.TolerationOpExists && toleration.Value != "" {
log.Errorf("Value must be empty when 'operator' is 'Exists'. Toleration: %v", toleration)
} else if toleration.Operator != v1.TolerationOpExists && toleration.Key == "" {
log.Errorf("Operator must be 'Exists' when 'key' is empty. Toleration: %v", toleration)
} else if toleration.Effect != v1.TaintEffectNoExecute && toleration.TolerationSeconds != nil {
log.Errorf("Effect must be 'NoExecute' when 'tolerationSeconds' is set. Toleration: %v", toleration)
} else {
tolerations = append(tolerations, toleration)
}
}
}
return tolerations
}

func updateCollectors(client *client.LMSdkGo, ids []int32) error {
// if there is only one collector, there will be no backup for it
if len(ids) < 2 {
Expand Down
10 changes: 5 additions & 5 deletions vendor/github.com/google/go-cmp/cmp/compare.go

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

2 changes: 1 addition & 1 deletion vendor/github.com/google/go-cmp/cmp/export_panic.go

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

2 changes: 1 addition & 1 deletion vendor/github.com/google/go-cmp/cmp/export_unsafe.go

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

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

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

50 changes: 28 additions & 22 deletions vendor/github.com/google/go-cmp/cmp/internal/diff/diff.go

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

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

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

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

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

2 changes: 1 addition & 1 deletion vendor/github.com/google/go-cmp/cmp/internal/value/name.go

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

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

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

2 changes: 1 addition & 1 deletion vendor/github.com/google/go-cmp/cmp/internal/value/sort.go

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

2 changes: 1 addition & 1 deletion vendor/github.com/google/go-cmp/cmp/internal/value/zero.go

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

7 changes: 5 additions & 2 deletions vendor/github.com/google/go-cmp/cmp/options.go

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

2 changes: 1 addition & 1 deletion vendor/github.com/google/go-cmp/cmp/path.go

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

2 changes: 1 addition & 1 deletion vendor/github.com/google/go-cmp/cmp/report.go

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

Loading

0 comments on commit 1cf49ad

Please sign in to comment.