Skip to content

Commit dd0d28f

Browse files
authored
fix(ci): collect fallback cluster support bundle in airgap (#1462)
* fix(ci): collect fallback cluster support bundle in airgap * f * f * Trigger Build
1 parent edae52c commit dd0d28f

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

e2e/cluster/docker/cluster.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ func NewCluster(in *ClusterInput) *Cluster {
4242
func NewNode(in *ClusterInput, name string) *Container {
4343
c := NewContainer(in.T, name).
4444
WithImage(fmt.Sprintf("replicated/ec-distro:%s", in.Distro)).
45-
WithScripts()
45+
WithScripts().
46+
WithTroubleshootDir()
4647
if in.K0sDir != "" {
4748
in.T.Logf("using k0s dir %s", in.K0sDir)
4849
c = c.WithVolume(in.K0sDir)

e2e/cluster/docker/container.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@ func (c *Container) GetScriptPath(script string) string {
111111
return fmt.Sprintf("/usr/local/bin/%s", script)
112112
}
113113

114+
func (c *Container) WithTroubleshootDir() *Container {
115+
troubleshootPath, err := filepath.Abs("../operator/charts/embedded-cluster-operator/troubleshoot")
116+
if err != nil {
117+
c.t.Fatalf("failed to get absolute path to troubleshoot dir: %v", err)
118+
}
119+
c = c.WithVolume(fmt.Sprintf("%s:%s", troubleshootPath, "/automation/troubleshoot"))
120+
return c
121+
}
122+
114123
func (c *Container) WithVolume(volume string) *Container {
115124
c.Volumes = append(c.Volumes, volume)
116125
return c

e2e/cluster/lxd/cluster.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,10 @@ func CopyDirsToNode(in *ClusterInput, node string) {
482482
SourcePath: "playwright",
483483
DestPath: "/automation/playwright",
484484
},
485+
{
486+
SourcePath: "../operator/charts/embedded-cluster-operator/troubleshoot",
487+
DestPath: "/automation/troubleshoot",
488+
},
485489
}
486490
for _, dir := range dirs {
487491
CopyDirToNode(in, node, dir)

e2e/scripts/collect-support-bundle-cluster.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ DIR=/usr/local/bin
66

77
main() {
88
if ! kubectl support-bundle --output cluster.tar.gz --interactive=false --load-cluster-specs ; then
9-
# NOTE: this will fail in airgap but we've already failed above
10-
# TODO: improve this by downloading the spec through the proxy and running with a file path
11-
local url="https://raw.githubusercontent.com/replicatedhq/embedded-cluster-operator/main/charts/embedded-cluster-operator/troubleshoot/cluster-support-bundle.yaml"
12-
if ! kubectl support-bundle --output cluster.tar.gz --interactive=false --load-cluster-specs "$url" ; then
9+
if ! kubectl support-bundle --output cluster.tar.gz --interactive=false --load-cluster-specs "/automation/troubleshoot/cluster-support-bundle.yaml" ; then
1310
echo "Failed to collect cluster support bundle"
1411
return 1
1512
fi

0 commit comments

Comments
 (0)