Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package okteto for openSUSE:Factory checked in at 2023-01-14 00:03:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/okteto (Old) and /work/SRC/openSUSE:Factory/.okteto.new.32243 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "okteto" Sat Jan 14 00:03:13 2023 rev:38 rq:1058198 version:2.11.1 Changes: -------- --- /work/SRC/openSUSE:Factory/okteto/okteto.changes 2023-01-04 20:18:24.949565856 +0100 +++ /work/SRC/openSUSE:Factory/.okteto.new.32243/okteto.changes 2023-01-14 00:04:03.602005271 +0100 @@ -1,0 +2,6 @@ +Fri Jan 13 10:28:35 UTC 2023 - ka...@b1-systems.de + +- Update to version 2.11.1: + * fix: add markdown reading (#3332) (#3333) + +------------------------------------------------------------------- Old: ---- okteto-2.11.0.tar.gz New: ---- okteto-2.11.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ okteto.spec ++++++ --- /var/tmp/diff_new_pack.jloTuY/_old 2023-01-14 00:04:04.922012960 +0100 +++ /var/tmp/diff_new_pack.jloTuY/_new 2023-01-14 00:04:04.926012983 +0100 @@ -19,7 +19,7 @@ %define __arch_install_post export NO_BRP_STRIP_DEBUG=true Name: okteto -Version: 2.11.0 +Version: 2.11.1 Release: 0 Summary: Develop your applications directly in your Kubernetes Cluster License: Apache-2.0 ++++++ _service ++++++ --- /var/tmp/diff_new_pack.jloTuY/_old 2023-01-14 00:04:04.966013216 +0100 +++ /var/tmp/diff_new_pack.jloTuY/_new 2023-01-14 00:04:04.970013239 +0100 @@ -3,10 +3,10 @@ <param name="url">https://github.com/okteto/okteto</param> <param name="scm">git</param> <param name="exclude">.git</param> - <param name="revision">2.11.0</param> + <param name="revision">2.11.1</param> <param name="versionformat">@PARENT_TAG@</param> <param name="changesgenerate">enable</param> - <param name="match-tag">2.11.0</param> + <param name="match-tag">2.11.1</param> </service> <service name="set_version" mode="disabled"> <param name="basename">okteto</param> @@ -16,7 +16,7 @@ <param name="compression">gz</param> </service> <service name="go_modules" mode="disabled"> - <param name="archive">okteto-2.11.0.tar.gz</param> + <param name="archive">okteto-2.11.1.tar.gz</param> </service> </services> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.jloTuY/_old 2023-01-14 00:04:04.998013403 +0100 +++ /var/tmp/diff_new_pack.jloTuY/_new 2023-01-14 00:04:05.002013426 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/okteto/okteto</param> - <param name="changesrevision">d93825c4012637a96f0d89dc3233779f9c4df340</param></service></servicedata> + <param name="changesrevision">8e0fcf7935591905b92af53c591c1fea22fb6b4a</param></service></servicedata> (No newline at EOF) ++++++ okteto-2.11.0.tar.gz -> okteto-2.11.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/okteto-2.11.0/integration/deploy/external_test.go new/okteto-2.11.1/integration/deploy/external_test.go --- old/okteto-2.11.0/integration/deploy/external_test.go 1970-01-01 01:00:00.000000000 +0100 +++ new/okteto-2.11.1/integration/deploy/external_test.go 2023-01-12 17:08:01.000000000 +0100 @@ -0,0 +1,115 @@ +//go:build integration +// +build integration + +// Copyright 2023 The Okteto Authors +// 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. + +package deploy + +import ( + "context" + b64 "encoding/base64" + "os" + "path/filepath" + "testing" + + "github.com/okteto/okteto/cmd/deploy" + "github.com/okteto/okteto/integration" + "github.com/okteto/okteto/integration/commands" + "github.com/okteto/okteto/pkg/okteto" + "github.com/stretchr/testify/require" +) + +const ( + oktetoManifestWithExternalContent = ` +deploy: + - name: test command + command: echo hola +external: + test: + notes: readme.md + endpoints: + - name: test-endpoint + url: https://test.com +` + notesContent = `## TEST +# This is a test +` +) + +func Test_ExternalsFromOktetoManifestWithNotesContent(t *testing.T) { + ctx := context.Background() + t.Parallel() + oktetoPath, err := integration.GetOktetoPath() + require.NoError(t, err) + + dir := t.TempDir() + require.NoError(t, createExternalNotes(dir)) + require.NoError(t, createManifest(dir)) + + testNamespace := integration.GetTestNamespace("ExternalDeploy", user) + namespaceOpts := &commands.NamespaceOptions{ + Namespace: testNamespace, + OktetoHome: dir, + Token: token, + } + require.NoError(t, commands.RunOktetoCreateNamespace(oktetoPath, namespaceOpts)) + defer commands.RunOktetoDeleteNamespace(oktetoPath, namespaceOpts) + require.NoError(t, commands.RunOktetoKubeconfig(oktetoPath, dir)) + + deployOptions := &commands.DeployOptions{ + Workdir: dir, + Namespace: testNamespace, + OktetoHome: dir, + Token: token, + } + require.NoError(t, commands.RunOktetoDeploy(oktetoPath, deployOptions)) + + externalControl, err := deploy.GetExternalControl(okteto.NewK8sClientProvider(), filepath.Join(dir, ".kube", "config")) + require.NoError(t, err) + + externals, err := externalControl.List(ctx, namespaceOpts.Namespace, "") + + require.NoError(t, err) + require.Len(t, externals, 1) + + decodedContent, err := b64.StdEncoding.DecodeString(externals[0].Notes.Markdown) + require.NoError(t, err) + + require.Equal(t, string(decodedContent), notesContent) + + destroyOptions := &commands.DestroyOptions{ + Workdir: dir, + Namespace: testNamespace, + OktetoHome: dir, + } + require.NoError(t, commands.RunOktetoDestroy(oktetoPath, destroyOptions)) +} + +func createExternalNotes(dir string) error { + notesPath := filepath.Join(dir, "readme.md") + notesContent := []byte(notesContent) + if err := os.WriteFile(notesPath, notesContent, 0600); err != nil { + return err + } + return nil +} + +func createManifest(dir string) error { + manifestPath := filepath.Join(dir, "okteto.yml") + manifestContent := []byte(oktetoManifestWithExternalContent) + if err := os.WriteFile(manifestPath, manifestContent, 0600); err != nil { + return err + } + return nil +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/okteto-2.11.0/pkg/externalresource/external_resource.go new/okteto-2.11.1/pkg/externalresource/external_resource.go --- old/okteto-2.11.0/pkg/externalresource/external_resource.go 2022-12-23 16:08:42.000000000 +0100 +++ new/okteto-2.11.1/pkg/externalresource/external_resource.go 2023-01-12 17:08:01.000000000 +0100 @@ -55,7 +55,7 @@ // LoadMarkdownContent loads and store markdown content related to external resource func (ef *ERFilesystemManager) LoadMarkdownContent(manifestPath string) error { - markdownAbsPath := filepath.Join(manifestPath, ef.ExternalResource.Notes.Path) + markdownAbsPath := filepath.Join(filepath.Dir(manifestPath), ef.ExternalResource.Notes.Path) b, err := afero.ReadFile(ef.Fs, markdownAbsPath) if err != nil { return err diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/okteto-2.11.0/pkg/externalresource/external_resource_test.go new/okteto-2.11.1/pkg/externalresource/external_resource_test.go --- old/okteto-2.11.0/pkg/externalresource/external_resource_test.go 2022-12-23 16:08:42.000000000 +0100 +++ new/okteto-2.11.1/pkg/externalresource/external_resource_test.go 2023-01-12 17:08:01.000000000 +0100 @@ -49,7 +49,7 @@ } func TestExternalResource_LoadMarkdownContent(t *testing.T) { - manifestPath := "/test" + manifestPath := "/test/okteto.yml" markdownContent := "## Markdown content" fs := afero.NewMemMapFs() afero.WriteFile(fs, "/test/external/readme.md", []byte(markdownContent), 0600) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/okteto-2.11.0/pkg/model/manifest.go new/okteto-2.11.1/pkg/model/manifest.go --- old/okteto-2.11.0/pkg/model/manifest.go 2022-12-23 16:08:42.000000000 +0100 +++ new/okteto-2.11.1/pkg/model/manifest.go 2023-01-12 17:08:01.000000000 +0100 @@ -32,6 +32,7 @@ "github.com/okteto/okteto/pkg/filesystem" oktetoLog "github.com/okteto/okteto/pkg/log" "github.com/okteto/okteto/pkg/model/forward" + "github.com/spf13/afero" yaml "gopkg.in/yaml.v2" yaml3 "gopkg.in/yaml.v3" ) @@ -588,6 +589,16 @@ return nil, fmt.Errorf("%w: %s", oktetoErrors.ErrInvalidManifest, err.Error()) } + ef := externalresource.ERFilesystemManager{ + Fs: afero.NewOsFs(), + } + + for name, external := range manifest.External { + external.SetDefaults(name) + ef.ExternalResource = *external + ef.LoadMarkdownContent(devPath) + } + for _, dev := range manifest.Dev { if err := dev.loadAbsPaths(devPath); err != nil { ++++++ vendor.tar.gz ++++++ /work/SRC/openSUSE:Factory/okteto/vendor.tar.gz /work/SRC/openSUSE:Factory/.okteto.new.32243/vendor.tar.gz differ: char 5, line 1