"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/test/framework/components/echo/kube/deployment.go" between
istio-1.10.0.tar.gz and istio-1.10.1.tar.gz

About: Istio is a platform-independent service mesh that provides a uniform way to connect, secure, control, and observe microservices.

deployment.go  (istio-1.10.0):deployment.go  (istio-1.10.1)
skipping to change at line 90 skipping to change at line 90
{{- range $i, $p := .Ports }} {{- range $i, $p := .Ports }}
- name: {{ $p.Name }} - name: {{ $p.Name }}
port: {{ $p.ServicePort }} port: {{ $p.ServicePort }}
targetPort: {{ $p.InstancePort }} targetPort: {{ $p.InstancePort }}
{{- end }} {{- end }}
selector: selector:
app: {{ .Service }} app: {{ .Service }}
` `
deploymentYAML = ` deploymentYAML = `
{{- $revVerMap := .IstioVersions }} {{- $revVerMap := .Revisions }}
{{- $subsets := .Subsets }} {{- $subsets := .Subsets }}
{{- $cluster := .Cluster }} {{- $cluster := .Cluster }}
{{- range $i, $subset := $subsets }} {{- range $i, $subset := $subsets }}
{{- range $revision, $version := $revVerMap }} {{- range $revision, $version := $revVerMap }}
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
{{- if $.IsMultiVersion }} {{- if $.IsMultiVersion }}
name: {{ $.Service }}-{{ $subset.Version }}-{{ $revision }} name: {{ $.Service }}-{{ $subset.Version }}-{{ $revision }}
{{- else }} {{- else }}
skipping to change at line 477 skipping to change at line 477
if cfg.DeployAsVM { if cfg.DeployAsVM {
if err := createVMConfig(ctx, cfg); err != nil { if err := createVMConfig(ctx, cfg); err != nil {
return nil, fmt.Errorf("failed creating vm config for %s/ %s: %v", return nil, fmt.Errorf("failed creating vm config for %s/ %s: %v",
cfg.Namespace.Name(), cfg.Namespace.Name(),
cfg.Service, cfg.Service,
err) err)
} }
} }
deploymentYAML, err := GenerateDeployment(cfg, nil, ctx.Settings().IstioV ersions) deploymentYAML, err := GenerateDeployment(cfg, nil, ctx.Settings().Revisi ons)
if err != nil { if err != nil {
return nil, fmt.Errorf("failed generating echo deployment YAML fo r %s/%s: %v", return nil, fmt.Errorf("failed generating echo deployment YAML fo r %s/%s: %v",
cfg.Namespace.Name(), cfg.Namespace.Name(),
cfg.Service, err) cfg.Service, err)
} }
// Apply the deployment to the configured cluster. // Apply the deployment to the configured cluster.
if err = ctx.Config(cfg.Cluster).ApplyYAMLNoCleanup(cfg.Namespace.Name(), deploymentYAML); err != nil { if err = ctx.Config(cfg.Cluster).ApplyYAMLNoCleanup(cfg.Namespace.Name(), deploymentYAML); err != nil {
return nil, fmt.Errorf("failed deploying echo %s to cluster %s: % v", return nil, fmt.Errorf("failed deploying echo %s to cluster %s: % v",
cfg.FQDN(), cfg.Cluster.Name(), err) cfg.FQDN(), cfg.Cluster.Name(), err)
skipping to change at line 574 skipping to change at line 574
spec: spec:
address: %s address: %s
serviceAccount: %s serviceAccount: %s
network: %q network: %q
labels: labels:
app: %s app: %s
version: %s version: %s
`, name, podIP, sa, network, service, version) `, name, podIP, sa, network, service, version)
} }
func GenerateDeployment(cfg echo.Config, settings *image.Settings, versions reso func GenerateDeployment(cfg echo.Config, settings *image.Settings, revisions res
urce.RevVerMap) (string, error) { ource.RevVerMap) (string, error) {
params, err := templateParams(cfg, settings, versions) params, err := templateParams(cfg, settings, revisions)
if err != nil { if err != nil {
return "", err return "", err
} }
deploy := deploymentTemplate deploy := deploymentTemplate
if cfg.DeployAsVM { if cfg.DeployAsVM {
deploy = vmDeploymentTemplate deploy = vmDeploymentTemplate
} }
return tmpl.Execute(deploy, params) return tmpl.Execute(deploy, params)
skipping to change at line 607 skipping to change at line 607
var VMImages = map[echo.VMDistro]string{ var VMImages = map[echo.VMDistro]string{
echo.UbuntuXenial: "app_sidecar_ubuntu_xenial", echo.UbuntuXenial: "app_sidecar_ubuntu_xenial",
echo.UbuntuFocal: "app_sidecar_ubuntu_focal", echo.UbuntuFocal: "app_sidecar_ubuntu_focal",
echo.UbuntuBionic: "app_sidecar_ubuntu_bionic", echo.UbuntuBionic: "app_sidecar_ubuntu_bionic",
echo.Debian9: "app_sidecar_debian_9", echo.Debian9: "app_sidecar_debian_9",
echo.Debian10: "app_sidecar_debian_10", echo.Debian10: "app_sidecar_debian_10",
echo.Centos7: "app_sidecar_centos_7", echo.Centos7: "app_sidecar_centos_7",
echo.Centos8: "app_sidecar_centos_8", echo.Centos8: "app_sidecar_centos_8",
} }
func templateParams(cfg echo.Config, settings *image.Settings, versions resource .RevVerMap) (map[string]interface{}, error) { func templateParams(cfg echo.Config, settings *image.Settings, revisions resourc e.RevVerMap) (map[string]interface{}, error) {
if settings == nil { if settings == nil {
var err error var err error
settings, err = image.SettingsFromCommandLine() settings, err = image.SettingsFromCommandLine()
if err != nil { if err != nil {
return nil, err return nil, err
} }
} }
supportStartupProbe := cfg.Cluster.MinKubeVersion(0) supportStartupProbe := cfg.Cluster.MinKubeVersion(0)
vmImage := VMImages[cfg.VMDistro] vmImage := VMImages[cfg.VMDistro]
skipping to change at line 653 skipping to change at line 653
"Subsets": cfg.Subsets, "Subsets": cfg.Subsets,
"TLSSettings": cfg.TLSSettings, "TLSSettings": cfg.TLSSettings,
"Cluster": cfg.Cluster.Name(), "Cluster": cfg.Cluster.Name(),
"Namespace": namespace, "Namespace": namespace,
"ImagePullSecret": imagePullSecret, "ImagePullSecret": imagePullSecret,
"VM": map[string]interface{}{ "VM": map[string]interface{}{
"Image": vmImage, "Image": vmImage,
}, },
"StartupProbe": supportStartupProbe, "StartupProbe": supportStartupProbe,
"IncludeExtAuthz": cfg.IncludeExtAuthz, "IncludeExtAuthz": cfg.IncludeExtAuthz,
"IstioVersions": versions.TemplateMap(), "Revisions": revisions.TemplateMap(),
"IsMultiVersion": versions.IsMultiVersion(), "IsMultiVersion": revisions.IsMultiVersion(),
} }
return params, nil return params, nil
} }
func lines(input string) []string { func lines(input string) []string {
out := make([]string, 0) out := make([]string, 0)
scanner := bufio.NewScanner(strings.NewReader(input)) scanner := bufio.NewScanner(strings.NewReader(input))
for scanner.Scan() { for scanner.Scan() {
out = append(out, scanner.Text()) out = append(out, scanner.Text())
} }
 End of changes. 5 change blocks. 
8 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)