This repository has been archived by the owner on Jan 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 488
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hide manifests behind button toggle (#2841)
Signed-off-by: Sam Foo <[email protected]>
- Loading branch information
Sam Foo
authored
Sep 8, 2021
1 parent
d4f47ac
commit 3946917
Showing
13 changed files
with
187 additions
and
39 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 octant | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/vmware-tanzu/octant/internal/manifest" | ||
"github.com/vmware-tanzu/octant/pkg/action" | ||
"github.com/vmware-tanzu/octant/pkg/log" | ||
) | ||
|
||
type Manifest struct { | ||
logger log.Logger | ||
} | ||
|
||
var _ action.Dispatcher = (*Manifest)(nil) | ||
|
||
func NewManifest(logger log.Logger) *Manifest { | ||
return &Manifest{logger: logger} | ||
} | ||
|
||
func (m *Manifest) ActionName() string { | ||
return ActionGetManifest | ||
} | ||
|
||
func (m *Manifest) Handle(ctx context.Context, _ action.Alerter, payload action.Payload) error { | ||
m.logger.With("payload", payload).Debugf("received action payload") | ||
image, err := payload.String("image") | ||
if err != nil { | ||
return err | ||
} | ||
hostOS, err := payload.String("host") | ||
if err != nil { | ||
return err | ||
} | ||
|
||
_, _, err = manifest.ManifestManager.GetImageManifest(ctx, hostOS, image) | ||
if err != nil { | ||
return fmt.Errorf("getting manifest for image %s: %w", image, err) | ||
} | ||
return nil | ||
} |
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
Oops, something went wrong.