@@ -45,8 +45,7 @@ type Deployer struct {
4545 dockerCreds * dockerauth.Credentials
4646 envrcFile string
4747
48- kubeContext string
49- clusterResourceKinds map [string ]struct {}
48+ kubeContext string
5049
5150 config Config
5251
@@ -264,40 +263,11 @@ func New(log *logger.Logger) (*Deployer, error) {
264263
265264 d .kubeContext = env .GetCurrentContext ()
266265
267- if d .kubeContext != "" {
268- clusterResourceKinds , err := d .getClusterResourceKinds ()
269- if err != nil {
270- return nil , fmt .Errorf ("failed to get cluster resource kinds: %w" , err )
271- }
272- d .clusterResourceKinds = clusterResourceKinds
273- }
274-
275266 log .Success ("🚀 ACS Deployer initialized" )
276267
277268 return d , nil
278269}
279270
280- func (d * Deployer ) getClusterResourceKinds () (map [string ]struct {}, error ) {
281- result , err := d .runKubectl (context .Background (), k8s.KubectlOptions {
282- Args : []string {"api-resources" , "-o" , "name" },
283- })
284- if err != nil {
285- return nil , fmt .Errorf ("failed to get cluster resource kinds: %w" , err )
286- }
287- kinds := make (map [string ]struct {})
288- lines := strings .Split (strings .TrimSpace (result .Stdout ), "\n " )
289- for _ , line := range lines {
290- fields := strings .SplitN (line , "." , 2 )
291- if len (fields ) == 0 || fields [0 ] == "" {
292- continue
293- }
294- kind := fields [0 ]
295- kinds [kind ] = struct {}{}
296- }
297-
298- return kinds , nil
299- }
300-
301271// Cleanup cleans up any temporary resources created by the deployer, such as temporary files.
302272func (d * Deployer ) Cleanup () {
303273 if d .tempDir != "" && d .envrcFile == "" {
0 commit comments