-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added replacement for prometheus secrets and configmaps mount path at…
… objects conversion, updated docs with proper mount name paths for secrets and configmaps, update typo at examples
- Loading branch information
Showing
9 changed files
with
85 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package converter | ||
|
||
import ( | ||
v1beta1vm "github.com/VictoriaMetrics/operator/api/v1beta1" | ||
v1 "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1" | ||
"testing" | ||
) | ||
|
||
func TestConvertTlsConfig(t *testing.T) { | ||
type args struct { | ||
tlsConf *v1.TLSConfig | ||
} | ||
tests := []struct { | ||
name string | ||
args args | ||
want *v1beta1vm.TLSConfig | ||
}{ | ||
{ | ||
name: "replace prom secret path", | ||
args: args{ | ||
tlsConf: &v1.TLSConfig{ | ||
CAFile: "/etc/prom_add/ca", | ||
CertFile: "/etc/prometheus/secrets/cert.crt", | ||
KeyFile: "/etc/prometheus/configmaps/key.pem", | ||
}, | ||
}, | ||
want: &v1beta1vm.TLSConfig{ | ||
CAFile: "/etc/prom_add/ca", | ||
CertFile: "/etc/vm/secrets/cert.crt", | ||
KeyFile: "/etc/vm/configs/key.pem", | ||
}, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
got := ConvertTlsConfig(tt.args.tlsConf) | ||
if got.KeyFile != tt.want.KeyFile || got.CertFile != tt.want.CertFile || got.CAFile != tt.want.CAFile { | ||
t.Errorf("ConvertTlsConfig() = \n%v, \nwant \n%v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters