2018-05-22 19:43:36 +00:00
|
|
|
// Copyright 2016-2018, Pulumi Corporation.
|
|
|
|
//
|
|
|
|
// 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.
|
Make some updates based on CR feedback
This change implements some feedback from @ellismg.
* Make backend.Stack an interface and let backends implement it,
enabling dynamic type testing/casting to access information
specific to that backend. For instance, the cloud.Stack conveys
the cloud URL, org name, and PPC name, for each stack.
* Similarly expose specialized backend.Backend interfaces,
local.Backend and cloud.Backend, to convey specific information.
* Redo a bunch of the commands in terms of these.
* Keeping with this theme, turn the CreateStack options into an
opaque interface{}, and let the specific backends expose their
own structures with their own settings (like PPC name in cloud).
* Show both the org and PPC names in the cloud column printed in
the stack ls command, in addition to the Pulumi Cloud URL.
Unrelated, but useful:
* Special case the 401 HTTP response and make a friendly error,
to tell the developer they must use `pulumi login`. This is
better than tossing raw "401: Unauthorized" errors in their face.
* Change the "Updating stack '..' in the Pulumi Cloud" message to
use the correct action verb ("Previewing", "Destroying", etc).
2017-12-03 15:51:18 +00:00
|
|
|
|
2018-09-04 19:38:58 +00:00
|
|
|
package filestate
|
Make some updates based on CR feedback
This change implements some feedback from @ellismg.
* Make backend.Stack an interface and let backends implement it,
enabling dynamic type testing/casting to access information
specific to that backend. For instance, the cloud.Stack conveys
the cloud URL, org name, and PPC name, for each stack.
* Similarly expose specialized backend.Backend interfaces,
local.Backend and cloud.Backend, to convey specific information.
* Redo a bunch of the commands in terms of these.
* Keeping with this theme, turn the CreateStack options into an
opaque interface{}, and let the specific backends expose their
own structures with their own settings (like PPC name in cloud).
* Show both the org and PPC names in the cloud column printed in
the stack ls command, in addition to the Pulumi Cloud URL.
Unrelated, but useful:
* Special case the 401 HTTP response and make a friendly error,
to tell the developer they must use `pulumi login`. This is
better than tossing raw "401: Unauthorized" errors in their face.
* Change the "Updating stack '..' in the Pulumi Cloud" message to
use the correct action verb ("Previewing", "Destroying", etc).
2017-12-03 15:51:18 +00:00
|
|
|
|
|
|
|
import (
|
2018-05-08 01:23:03 +00:00
|
|
|
"context"
|
2023-05-08 13:54:43 +00:00
|
|
|
"sync/atomic"
|
2018-09-14 03:54:42 +00:00
|
|
|
"time"
|
2018-05-08 01:23:03 +00:00
|
|
|
|
2021-03-17 13:20:05 +00:00
|
|
|
"github.com/pulumi/pulumi/sdk/v3/go/common/tokens"
|
2023-01-12 15:33:17 +00:00
|
|
|
"github.com/pulumi/pulumi/sdk/v3/go/common/workspace"
|
2019-03-14 22:32:10 +00:00
|
|
|
|
2021-03-17 13:20:05 +00:00
|
|
|
"github.com/pulumi/pulumi/pkg/v3/backend"
|
2023-09-18 11:01:28 +00:00
|
|
|
"github.com/pulumi/pulumi/pkg/v3/display"
|
2021-03-17 13:20:05 +00:00
|
|
|
"github.com/pulumi/pulumi/pkg/v3/operations"
|
|
|
|
"github.com/pulumi/pulumi/pkg/v3/resource/deploy"
|
2022-08-18 14:31:34 +00:00
|
|
|
"github.com/pulumi/pulumi/pkg/v3/secrets"
|
2023-01-04 15:45:21 +00:00
|
|
|
"github.com/pulumi/pulumi/pkg/v3/secrets/passphrase"
|
2021-03-17 13:20:05 +00:00
|
|
|
"github.com/pulumi/pulumi/sdk/v3/go/common/apitype"
|
2023-02-10 12:24:28 +00:00
|
|
|
"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
|
2021-03-17 13:20:05 +00:00
|
|
|
"github.com/pulumi/pulumi/sdk/v3/go/common/util/result"
|
Make some updates based on CR feedback
This change implements some feedback from @ellismg.
* Make backend.Stack an interface and let backends implement it,
enabling dynamic type testing/casting to access information
specific to that backend. For instance, the cloud.Stack conveys
the cloud URL, org name, and PPC name, for each stack.
* Similarly expose specialized backend.Backend interfaces,
local.Backend and cloud.Backend, to convey specific information.
* Redo a bunch of the commands in terms of these.
* Keeping with this theme, turn the CreateStack options into an
opaque interface{}, and let the specific backends expose their
own structures with their own settings (like PPC name in cloud).
* Show both the org and PPC names in the cloud column printed in
the stack ls command, in addition to the Pulumi Cloud URL.
Unrelated, but useful:
* Special case the 401 HTTP response and make a friendly error,
to tell the developer they must use `pulumi login`. This is
better than tossing raw "401: Unauthorized" errors in their face.
* Change the "Updating stack '..' in the Pulumi Cloud" message to
use the correct action verb ("Previewing", "Destroying", etc).
2017-12-03 15:51:18 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// localStack is a local stack descriptor.
|
|
|
|
type localStack struct {
|
2023-05-08 13:54:43 +00:00
|
|
|
// the stack's reference (qualified name).
|
|
|
|
ref *localBackendReference
|
|
|
|
// a snapshot representing the latest deployment state, allocated on first use. It's valid for the
|
|
|
|
// snapshot itself to be nil.
|
|
|
|
snapshot atomic.Pointer[*deploy.Snapshot]
|
|
|
|
// a pointer to the backend this stack belongs to.
|
|
|
|
b *localBackend
|
Make some updates based on CR feedback
This change implements some feedback from @ellismg.
* Make backend.Stack an interface and let backends implement it,
enabling dynamic type testing/casting to access information
specific to that backend. For instance, the cloud.Stack conveys
the cloud URL, org name, and PPC name, for each stack.
* Similarly expose specialized backend.Backend interfaces,
local.Backend and cloud.Backend, to convey specific information.
* Redo a bunch of the commands in terms of these.
* Keeping with this theme, turn the CreateStack options into an
opaque interface{}, and let the specific backends expose their
own structures with their own settings (like PPC name in cloud).
* Show both the org and PPC names in the cloud column printed in
the stack ls command, in addition to the Pulumi Cloud URL.
Unrelated, but useful:
* Special case the 401 HTTP response and make a friendly error,
to tell the developer they must use `pulumi login`. This is
better than tossing raw "401: Unauthorized" errors in their face.
* Change the "Updating stack '..' in the Pulumi Cloud" message to
use the correct action verb ("Previewing", "Destroying", etc).
2017-12-03 15:51:18 +00:00
|
|
|
}
|
|
|
|
|
2023-05-08 13:54:43 +00:00
|
|
|
func newStack(ref *localBackendReference, b *localBackend) backend.Stack {
|
2023-02-10 12:24:28 +00:00
|
|
|
contract.Requiref(ref != nil, "ref", "ref was nil")
|
|
|
|
|
Make some updates based on CR feedback
This change implements some feedback from @ellismg.
* Make backend.Stack an interface and let backends implement it,
enabling dynamic type testing/casting to access information
specific to that backend. For instance, the cloud.Stack conveys
the cloud URL, org name, and PPC name, for each stack.
* Similarly expose specialized backend.Backend interfaces,
local.Backend and cloud.Backend, to convey specific information.
* Redo a bunch of the commands in terms of these.
* Keeping with this theme, turn the CreateStack options into an
opaque interface{}, and let the specific backends expose their
own structures with their own settings (like PPC name in cloud).
* Show both the org and PPC names in the cloud column printed in
the stack ls command, in addition to the Pulumi Cloud URL.
Unrelated, but useful:
* Special case the 401 HTTP response and make a friendly error,
to tell the developer they must use `pulumi login`. This is
better than tossing raw "401: Unauthorized" errors in their face.
* Change the "Updating stack '..' in the Pulumi Cloud" message to
use the correct action verb ("Previewing", "Destroying", etc).
2017-12-03 15:51:18 +00:00
|
|
|
return &localStack{
|
2023-05-08 13:54:43 +00:00
|
|
|
ref: ref,
|
|
|
|
b: b,
|
Make some updates based on CR feedback
This change implements some feedback from @ellismg.
* Make backend.Stack an interface and let backends implement it,
enabling dynamic type testing/casting to access information
specific to that backend. For instance, the cloud.Stack conveys
the cloud URL, org name, and PPC name, for each stack.
* Similarly expose specialized backend.Backend interfaces,
local.Backend and cloud.Backend, to convey specific information.
* Redo a bunch of the commands in terms of these.
* Keeping with this theme, turn the CreateStack options into an
opaque interface{}, and let the specific backends expose their
own structures with their own settings (like PPC name in cloud).
* Show both the org and PPC names in the cloud column printed in
the stack ls command, in addition to the Pulumi Cloud URL.
Unrelated, but useful:
* Special case the 401 HTTP response and make a friendly error,
to tell the developer they must use `pulumi login`. This is
better than tossing raw "401: Unauthorized" errors in their face.
* Change the "Updating stack '..' in the Pulumi Cloud" message to
use the correct action verb ("Previewing", "Destroying", etc).
2017-12-03 15:51:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-11 16:04:14 +00:00
|
|
|
func (s *localStack) Ref() backend.StackReference { return s.ref }
|
|
|
|
func (s *localStack) Snapshot(ctx context.Context, secretsProvider secrets.Provider) (*deploy.Snapshot, error) {
|
2023-05-08 13:54:43 +00:00
|
|
|
if v := s.snapshot.Load(); v != nil {
|
|
|
|
return *v, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
snap, err := s.b.getSnapshot(ctx, secretsProvider, s.ref)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
s.snapshot.Store(&snap)
|
|
|
|
return snap, nil
|
2023-01-11 16:04:14 +00:00
|
|
|
}
|
|
|
|
func (s *localStack) Backend() backend.Backend { return s.b }
|
|
|
|
func (s *localStack) Tags() map[apitype.StackTagName]string { return nil }
|
Make some updates based on CR feedback
This change implements some feedback from @ellismg.
* Make backend.Stack an interface and let backends implement it,
enabling dynamic type testing/casting to access information
specific to that backend. For instance, the cloud.Stack conveys
the cloud URL, org name, and PPC name, for each stack.
* Similarly expose specialized backend.Backend interfaces,
local.Backend and cloud.Backend, to convey specific information.
* Redo a bunch of the commands in terms of these.
* Keeping with this theme, turn the CreateStack options into an
opaque interface{}, and let the specific backends expose their
own structures with their own settings (like PPC name in cloud).
* Show both the org and PPC names in the cloud column printed in
the stack ls command, in addition to the Pulumi Cloud URL.
Unrelated, but useful:
* Special case the 401 HTTP response and make a friendly error,
to tell the developer they must use `pulumi login`. This is
better than tossing raw "401: Unauthorized" errors in their face.
* Change the "Updating stack '..' in the Pulumi Cloud" message to
use the correct action verb ("Previewing", "Destroying", etc).
2017-12-03 15:51:18 +00:00
|
|
|
|
2018-05-08 01:23:03 +00:00
|
|
|
func (s *localStack) Remove(ctx context.Context, force bool) (bool, error) {
|
|
|
|
return backend.RemoveStack(ctx, s, force)
|
Make some updates based on CR feedback
This change implements some feedback from @ellismg.
* Make backend.Stack an interface and let backends implement it,
enabling dynamic type testing/casting to access information
specific to that backend. For instance, the cloud.Stack conveys
the cloud URL, org name, and PPC name, for each stack.
* Similarly expose specialized backend.Backend interfaces,
local.Backend and cloud.Backend, to convey specific information.
* Redo a bunch of the commands in terms of these.
* Keeping with this theme, turn the CreateStack options into an
opaque interface{}, and let the specific backends expose their
own structures with their own settings (like PPC name in cloud).
* Show both the org and PPC names in the cloud column printed in
the stack ls command, in addition to the Pulumi Cloud URL.
Unrelated, but useful:
* Special case the 401 HTTP response and make a friendly error,
to tell the developer they must use `pulumi login`. This is
better than tossing raw "401: Unauthorized" errors in their face.
* Change the "Updating stack '..' in the Pulumi Cloud" message to
use the correct action verb ("Previewing", "Destroying", etc).
2017-12-03 15:51:18 +00:00
|
|
|
}
|
|
|
|
|
Correctly rename stack files during a rename (#5812)
* Correctly rename stack files during a rename
This fixes pulumi/pulumi#4463, by renaming a stack's configuration
file based on its stack-part, and ignoring the owner-part. Our
workspace system doesn't recognize configuration files with fully
qualified names. That, by the way, causes problems if we have
multiple stacks in different organizations that share a stack-part.
The fix here is simple: propagate the new StackReference from the
Rename operation and rely on the backend's normalization to a
simple name, and then use that the same way we are using a
StackReference to determine the path for the origin stack.
An alternative fix is to recognize fully qualified config files,
however, there's a fair bit of cleanup we will be doing as part of
https://github.com/pulumi/pulumi/issues/2522 and
https://github.com/pulumi/pulumi/issues/4605, so figured it is best
to make this work the way the system expects first, and revisit it
as part of those overall workstreams. I also suspect we may want to
consider changing the default behavior here as part of
https://github.com/pulumi/pulumi/issues/5731.
Tests TBD; need some advice on how best to test this since it
only happens with our HTTP state backend -- all integration tests
appear to use the local filestate backend at the moment.
* Add a changelog entry for bug fix
* Add some stack rename tests
* Fix a typo
* Address CR feedback
* Make some logic clearer
Use "parsedName" instead of "qn", add a comment explaining why
we're doing this, and also explicitly ignore the error rather
than implicitly doing so with _.
2020-12-02 00:55:48 +00:00
|
|
|
func (s *localStack) Rename(ctx context.Context, newName tokens.QName) (backend.StackReference, error) {
|
2019-03-14 22:32:10 +00:00
|
|
|
return backend.RenameStack(ctx, s, newName)
|
|
|
|
}
|
|
|
|
|
2022-01-31 10:31:51 +00:00
|
|
|
func (s *localStack) Preview(
|
|
|
|
ctx context.Context,
|
2023-03-03 16:36:39 +00:00
|
|
|
op backend.UpdateOperation,
|
|
|
|
) (*deploy.Plan, display.ResourceChanges, result.Result) {
|
2018-09-05 14:20:25 +00:00
|
|
|
return backend.PreviewStack(ctx, s, op)
|
2018-05-05 18:57:09 +00:00
|
|
|
}
|
|
|
|
|
2022-06-27 14:08:06 +00:00
|
|
|
func (s *localStack) Update(ctx context.Context, op backend.UpdateOperation) (display.ResourceChanges, result.Result) {
|
2018-09-05 14:20:25 +00:00
|
|
|
return backend.UpdateStack(ctx, s, op)
|
Make some updates based on CR feedback
This change implements some feedback from @ellismg.
* Make backend.Stack an interface and let backends implement it,
enabling dynamic type testing/casting to access information
specific to that backend. For instance, the cloud.Stack conveys
the cloud URL, org name, and PPC name, for each stack.
* Similarly expose specialized backend.Backend interfaces,
local.Backend and cloud.Backend, to convey specific information.
* Redo a bunch of the commands in terms of these.
* Keeping with this theme, turn the CreateStack options into an
opaque interface{}, and let the specific backends expose their
own structures with their own settings (like PPC name in cloud).
* Show both the org and PPC names in the cloud column printed in
the stack ls command, in addition to the Pulumi Cloud URL.
Unrelated, but useful:
* Special case the 401 HTTP response and make a friendly error,
to tell the developer they must use `pulumi login`. This is
better than tossing raw "401: Unauthorized" errors in their face.
* Change the "Updating stack '..' in the Pulumi Cloud" message to
use the correct action verb ("Previewing", "Destroying", etc).
2017-12-03 15:51:18 +00:00
|
|
|
}
|
|
|
|
|
2020-10-14 11:51:53 +00:00
|
|
|
func (s *localStack) Import(ctx context.Context, op backend.UpdateOperation,
|
2023-03-03 16:36:39 +00:00
|
|
|
imports []deploy.Import,
|
|
|
|
) (display.ResourceChanges, result.Result) {
|
2020-10-14 11:51:53 +00:00
|
|
|
return backend.ImportStack(ctx, s, op, imports)
|
|
|
|
}
|
|
|
|
|
2022-06-27 14:08:06 +00:00
|
|
|
func (s *localStack) Refresh(ctx context.Context, op backend.UpdateOperation) (display.ResourceChanges, result.Result) {
|
2018-09-05 14:20:25 +00:00
|
|
|
return backend.RefreshStack(ctx, s, op)
|
Implement a refresh command
This change implements a `pulumi refresh` command. It operates a bit
like `pulumi update`, and friends, in that it supports `--preview` and
`--diff`, along with the usual flags, and will update your checkpoint.
It works through substitution of the deploy.Source abstraction, which
generates a sequence of resource registration events. This new
deploy.RefreshSource takes in a prior checkpoint and will walk it,
refreshing the state via the associated resource providers by invoking
Read for each resource encountered, and merging the resulting state with
the prior checkpoint, to yield a new resource.Goal state. This state is
then fed through the engine in the usual ways with a few minor caveats:
namely, although the engine must generate steps for the logical
operations (permitting us to get nice summaries, progress, and diffs),
it mustn't actually carry them out because the state being imported
already reflects reality (a deleted resource has *already* been deleted,
so of course the engine need not perform the deletion). The diffing
logic also needs to know how to treat the case of refresh slightly
differently, because we are going to be diffing outputs and not inputs.
Note that support for managed stacks is not yet complete, since that
requires updates to the service to support a refresh endpoint. That
will be coming soon ...
2018-04-10 18:22:39 +00:00
|
|
|
}
|
|
|
|
|
2022-06-27 14:08:06 +00:00
|
|
|
func (s *localStack) Destroy(ctx context.Context, op backend.UpdateOperation) (display.ResourceChanges, result.Result) {
|
2018-09-05 14:20:25 +00:00
|
|
|
return backend.DestroyStack(ctx, s, op)
|
Make some updates based on CR feedback
This change implements some feedback from @ellismg.
* Make backend.Stack an interface and let backends implement it,
enabling dynamic type testing/casting to access information
specific to that backend. For instance, the cloud.Stack conveys
the cloud URL, org name, and PPC name, for each stack.
* Similarly expose specialized backend.Backend interfaces,
local.Backend and cloud.Backend, to convey specific information.
* Redo a bunch of the commands in terms of these.
* Keeping with this theme, turn the CreateStack options into an
opaque interface{}, and let the specific backends expose their
own structures with their own settings (like PPC name in cloud).
* Show both the org and PPC names in the cloud column printed in
the stack ls command, in addition to the Pulumi Cloud URL.
Unrelated, but useful:
* Special case the 401 HTTP response and make a friendly error,
to tell the developer they must use `pulumi login`. This is
better than tossing raw "401: Unauthorized" errors in their face.
* Change the "Updating stack '..' in the Pulumi Cloud" message to
use the correct action verb ("Previewing", "Destroying", etc).
2017-12-03 15:51:18 +00:00
|
|
|
}
|
|
|
|
|
2021-06-21 07:34:21 +00:00
|
|
|
func (s *localStack) Watch(ctx context.Context, op backend.UpdateOperation, paths []string) result.Result {
|
|
|
|
return backend.WatchStack(ctx, s, op, paths)
|
2019-11-06 20:56:29 +00:00
|
|
|
}
|
|
|
|
|
2023-01-11 16:04:14 +00:00
|
|
|
func (s *localStack) GetLogs(ctx context.Context, secretsProvider secrets.Provider, cfg backend.StackConfiguration,
|
2023-03-03 16:36:39 +00:00
|
|
|
query operations.LogQuery,
|
|
|
|
) ([]operations.LogEntry, error) {
|
2023-01-11 16:04:14 +00:00
|
|
|
return backend.GetStackLogs(ctx, secretsProvider, s, cfg, query)
|
Make some updates based on CR feedback
This change implements some feedback from @ellismg.
* Make backend.Stack an interface and let backends implement it,
enabling dynamic type testing/casting to access information
specific to that backend. For instance, the cloud.Stack conveys
the cloud URL, org name, and PPC name, for each stack.
* Similarly expose specialized backend.Backend interfaces,
local.Backend and cloud.Backend, to convey specific information.
* Redo a bunch of the commands in terms of these.
* Keeping with this theme, turn the CreateStack options into an
opaque interface{}, and let the specific backends expose their
own structures with their own settings (like PPC name in cloud).
* Show both the org and PPC names in the cloud column printed in
the stack ls command, in addition to the Pulumi Cloud URL.
Unrelated, but useful:
* Special case the 401 HTTP response and make a friendly error,
to tell the developer they must use `pulumi login`. This is
better than tossing raw "401: Unauthorized" errors in their face.
* Change the "Updating stack '..' in the Pulumi Cloud" message to
use the correct action verb ("Previewing", "Destroying", etc).
2017-12-03 15:51:18 +00:00
|
|
|
}
|
2018-01-05 20:46:13 +00:00
|
|
|
|
2018-05-08 01:23:03 +00:00
|
|
|
func (s *localStack) ExportDeployment(ctx context.Context) (*apitype.UntypedDeployment, error) {
|
|
|
|
return backend.ExportStackDeployment(ctx, s)
|
2018-01-05 20:46:13 +00:00
|
|
|
}
|
|
|
|
|
2018-05-08 01:23:03 +00:00
|
|
|
func (s *localStack) ImportDeployment(ctx context.Context, deployment *apitype.UntypedDeployment) error {
|
|
|
|
return backend.ImportStackDeployment(ctx, s, deployment)
|
2018-01-05 20:46:13 +00:00
|
|
|
}
|
2018-09-14 03:54:42 +00:00
|
|
|
|
2023-01-12 15:33:17 +00:00
|
|
|
func (s *localStack) DefaultSecretManager(info *workspace.ProjectStack) (secrets.Manager, error) {
|
|
|
|
return passphrase.NewPromptingPassphraseSecretsManager(info, false /* rotatePassphraseSecretsProvider */)
|
2022-08-18 14:31:34 +00:00
|
|
|
}
|
|
|
|
|
2018-09-14 03:54:42 +00:00
|
|
|
type localStackSummary struct {
|
2021-07-28 01:37:25 +00:00
|
|
|
name backend.StackReference
|
|
|
|
chk *apitype.CheckpointV3
|
2018-09-14 03:54:42 +00:00
|
|
|
}
|
|
|
|
|
2021-07-28 01:37:25 +00:00
|
|
|
func newLocalStackSummary(name backend.StackReference, chk *apitype.CheckpointV3) localStackSummary {
|
|
|
|
return localStackSummary{name: name, chk: chk}
|
2018-09-14 03:54:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (lss localStackSummary) Name() backend.StackReference {
|
2021-07-28 01:37:25 +00:00
|
|
|
return lss.name
|
2018-09-14 03:54:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (lss localStackSummary) LastUpdate() *time.Time {
|
2021-07-28 01:37:25 +00:00
|
|
|
if lss.chk != nil && lss.chk.Latest != nil {
|
|
|
|
if t := lss.chk.Latest.Manifest.Time; !t.IsZero() {
|
2018-09-14 03:54:42 +00:00
|
|
|
return &t
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (lss localStackSummary) ResourceCount() *int {
|
2021-07-28 01:37:25 +00:00
|
|
|
if lss.chk != nil && lss.chk.Latest != nil {
|
|
|
|
count := len(lss.chk.Latest.Resources)
|
2018-09-14 03:54:42 +00:00
|
|
|
return &count
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|